Hi Otmar,

For this requirement, you need to create an additional field containing the 
number of words/terms in the field.


For example.

field : blue pill
length = 2


query : if you take the blue pill
length  : 6


Please see my previous responses on the same topic:
http://search-lucene.com/m/eHNluYPa11VSxlf1&subj=Re+search+for+documents+where+all+words+of+field+present+in+the+query

http://search-lucene.com/m/eHNl9Yu6V1xx3rp&subj=Re+Match+All+terms+in+indexed+field+value

I know they are solr responses but Function Queries exists in Lucene as far as 
know.

Ahmet
On Friday, March 25, 2016 11:20 AM, Otmar Caduff <ocad...@gmail.com> wrote:



Hi all
In Lucene, I know of the possibility of Occur.SHOULD, Occur.MUST and the
“minimum should match” setting on the boolean query.

Now, when querying, I want to
- (1)  match the documents which either contain all the terms of the query
(Occur.MUST for all terms would do that) or,
- (2)  if all terms for a given field of a document are a subset of the
query terms, that document should match as well.

Any clue on how to accomplish this?

Otmar

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to