How to implement EXCEPT boolean operator of ISYS using Lucene API
I've studied that EXCEPT is a boolean operator for queries in ISYS(which is an Enterprise search Engine).It has the following functionality. If this is the query First EXCEPT Second------>The retrieved documents must contain the first search term but only if the second term is not in the same paragraph as the first. Both terms can appear in the document; just not in the same paragraph.
Now how do I achieve this in Lucene?
Than开发者_StackOverflow中文版k you :)
A rough outline of an implementation strategy would be to:
- tokenize your input on paragraphs
- index each paragraph separately, with a field referring a common document identifier
- use the BooleanQueryto construct a query that takes advantage of the above construction
精彩评论