Skip to content

Commit

Permalink
fix search operator bug on bm25
Browse files Browse the repository at this point in the history
  • Loading branch information
capjamesg committed Nov 18, 2024
1 parent c16853b commit 82b6537
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions jamesql/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,8 @@ def search(self, query: dict) -> List[str]:
doc["_score"] += term_score

for field in fields:
if not gsis.get(field):
continue
word_pos = gsis[field][term]["documents"]["uuid"][doc["uuid"]]
# give a boost if all terms are within 1 word of each other
# so a doc with "all too well" would do btter than "all well too"
Expand Down

0 comments on commit 82b6537

Please sign in to comment.