Commit 7010ff4 1 parent 4e4b319 commit 7010ff4 Copy full SHA for 7010ff4
File tree 1 file changed +20
-12
lines changed
src/scholarag/app/routers
1 file changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -234,13 +234,17 @@ async def article_count(
234
234
}
235
235
}
236
236
if topics :
237
- query ["query" ]["bool" ]["must" ].append (
238
- {
239
- "multi_match" : {
240
- "query" : " " .join (topics ),
241
- "fields" : ["title" , "text" ],
237
+ query ["query" ]["bool" ]["must" ].extend (
238
+ [
239
+ {
240
+ "multi_match" : {
241
+ "query" : wo ,
242
+ "fields" : ["title" , "text" ],
243
+ }
242
244
}
243
- }
245
+ for word in topics
246
+ for wo in word .split (" " )
247
+ ]
244
248
)
245
249
if regions :
246
250
query ["query" ]["bool" ]["must" ].append (
@@ -378,13 +382,17 @@ async def article_listing(
378
382
}
379
383
}
380
384
if topics :
381
- query ["query" ]["bool" ]["must" ].append (
382
- {
383
- "multi_match" : {
384
- "query" : " " .join (topics ),
385
- "fields" : ["title" , "text" ],
385
+ query ["query" ]["bool" ]["must" ].extend (
386
+ [
387
+ {
388
+ "multi_match" : {
389
+ "query" : wo ,
390
+ "fields" : ["title" , "text" ],
391
+ }
386
392
}
387
- }
393
+ for word in topics
394
+ for wo in word .split (" " )
395
+ ]
388
396
)
389
397
if regions :
390
398
query ["query" ]["bool" ]["must" ].append (
You can’t perform that action at this time.
0 commit comments