Skip to content

Commit

Permalink
Allow some error for long queries
Browse files Browse the repository at this point in the history
  • Loading branch information
swkim101 committed Oct 16, 2024
1 parent f26fa29 commit b160062
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api.cspapers.org/db/bleve/bleve.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ func search(req *types.SearchRequest) *types.SearchResponse {
* words, we infer that a user wants a specific sentence, and skip the expensive
* query. This shows 30x faster results.
*/
if !isSentence {
if isSentence {
rq := fmt.Sprintf("%v", strings.Join(words, " "))
keywordQuery = append(keywordQuery, bleve.NewMatchQuery(rq))
} else {
for _, word := range words {
qsTitle := fmt.Sprintf("title:%v^2", word)
qsAbs := fmt.Sprintf("abstract:%v", word)
Expand Down

0 comments on commit b160062

Please sign in to comment.