Skip to content

Commit 4e4b319

Browse files
committed
adress commments
1 parent 183f20f commit 4e4b319

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

CHANGELOG.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
[0.0.9] - 14.02.2025
10+
### Changed
11+
- Better search algorithm for article count / listing.
12+
13+
## [0.0.9] - 14.02.2025
1114

1215
### Added
1316
- Bearer token insertion in FastAPI UI.
1417

15-
### Changed
16-
- Better search algorithm for article count / listing.
17-
1818
### Fixed
1919
- Limit query size.
2020
- Add OBI copyright.

src/scholarag/app/routers/retrieval.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import logging
44
import time
5-
from typing import Annotated, Any, Dict
5+
from typing import Annotated, Any
66

77
from fastapi import APIRouter, Depends, HTTPException, Query
88
from fastapi_pagination import Page, paginate
@@ -206,6 +206,10 @@ async def article_count(
206206
Filtering query for paragraph retrieval.
207207
settings
208208
Global settings of the application
209+
topics
210+
Keyword to be matched in text.
211+
regions
212+
Keyword to be matched in text.
209213
210214
Returns
211215
-------
@@ -220,7 +224,7 @@ async def article_count(
220224
)
221225
else:
222226
# Match the keywords on abstract + title.
223-
query: Dict[str, Any] = {
227+
query: dict[str, Any] = {
224228
"query": {
225229
"bool": {
226230
"must": [
@@ -343,6 +347,10 @@ async def article_listing(
343347
Filtering query for paragraph retrieval.
344348
settings
345349
Global settings of the application
350+
topics
351+
Keyword to be matched in text. OR matching.
352+
regions
353+
Keyword to be matched in text. OR matching.
346354
number_results
347355
Number of results to return. Max 10 000.
348356
sort_by_date
@@ -360,7 +368,7 @@ async def article_listing(
360368
status_code=422, detail="Please provide at least one region or topic."
361369
)
362370
else:
363-
query: Dict[str, Any] = {
371+
query: dict[str, Any] = {
364372
"query": {
365373
"bool": {
366374
"must": [

0 commit comments

Comments
 (0)