-- Code for Search Operators
I was looking into -term operator. The code itself seemed fine, but I just realized one thing that can make this not work:
To compute -term, Yioop looks at documents not in the list of documents containing that term. When Yioop computes an index, it first computes a summary of the page to find the most important content, then adds the terms from this summary to appropriate term posting lists. A document might contain a term but it was in a location outside the summary generated for the document. In which case, the fact that the document contained the term would not be in the index. So a -term search might return that document. I think about the best you can easily hope for with the way Yioop does things is that -term means documents for which term is not very relevant (so didn't appear in doc summary).
You can make the summary bigger if you want to make -term more accurate.
Best,
Chris
(
Edited: 2019-02-28)
I was looking into -term operator. The code itself seemed fine, but I just realized one thing that can make this not work:
To compute -term, Yioop looks at documents not in the list of documents containing that term. When Yioop computes an index, it first computes a summary of the page to find the most important content, then adds the terms from this summary to appropriate term posting lists. A document might contain a term but it was in a location outside the summary generated for the document. In which case, the fact that the document contained the term would not be in the index. So a -term search might return that document. I think about the best you can easily hope for with the way Yioop does things is that -term means documents for which term is not very relevant (so didn't appear in doc summary).
You can make the summary bigger if you want to make -term more accurate.
Best,
Chris