Home > other >  Whoosh fulltext retrieval problem
Whoosh fulltext retrieval problem

Time:11-23

Why every time a document using the following search method in the search keywords can only return the first (document has multiple matches on the same keyword), how to put all in return?

Def search (search_str) :
Title_list=[]
Print 'here'
Ix=open_dir (" E: \ \ python_idx ")
A searcher=ix. A searcher ()
Print search_str, type (search_str)
results=a searcher. Find (" content ", search_str)
For hit in the results:
Print hit [' titel]
Print hit. Score
Print hit. Highlights (" content ", top=10)
Title_list. Append (hit [' titel '])
# print 'tt, title_list
Return title_list

Search (" enable ")

CodePudding user response:

Please answer, thank you!

CodePudding user response:

Results=a searcher. Find (" content ", search_str)
Find it only returns a value
  • Related