Skip to content

Commit

Permalink
fix text queries with single integers
Browse files Browse the repository at this point in the history
  • Loading branch information
capjamesg committed Nov 18, 2024
1 parent 8840005 commit d375644
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jamesql/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,7 @@ def search(self, query: dict) -> List[str]:
total = total.union(positions)

if first_word_pos:
print(doc["title"])
doc["_score"] += (len(first_word_pos) + 1) * len(total)

if field != "title_lower":
Expand Down Expand Up @@ -1256,6 +1257,8 @@ def _run(self, query: dict, query_field: str) -> List[str]:
.get("uuid", {})
)

print(all_matches)

for word_index in range(0, len(words)):
current_word = words[word_index]
if word_index + 1 == len(words):
Expand Down Expand Up @@ -1304,6 +1307,8 @@ def _run(self, query: dict, query_field: str) -> List[str]:
current_word + " " + next_word
] = match_positions

print(all_match_positions)

if all_matches:
matching_documents.extend(
set.intersection(
Expand Down

0 comments on commit d375644

Please sign in to comment.