Skip to content

Commit f3d6c64

Browse files
committed
fix: semantic search returning non-existing pages
closes #109 closes #110
1 parent 314f064 commit f3d6c64

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎src/osw/wiki_tools.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class SearchParam(OswBaseModel):
134134

135135
query: Union[str, List[str]]
136136
parallel: Optional[bool] = None # is set to true if query is a list longer than 5
137-
debug: Optional[bool] = True
137+
debug: Optional[bool] = False
138138
limit: Optional[int] = 1000
139139

140140
def __init__(self, **data):
@@ -241,12 +241,12 @@ def semantic_search_(single_query):
241241
)
242242
)
243243
for page in result["query"]["results"].values():
244-
# why do we do the following?
245-
if "printouts" in page:
246-
title = page["fulltext"]
247-
if "#" not in title and query.debug:
248-
print(title)
249-
# original position of "page_list.append(title)" line
244+
title = page["fulltext"]
245+
exists = page["exists"]
246+
if "#" not in title and query.debug:
247+
print(title)
248+
# original position of "page_list.append(title)" line
249+
if exists == "1":
250250
page_list.append(title)
251251
return page_list
252252

0 commit comments

Comments
 (0)