Quote:
the search for all the words or for at least one he write for the search.
beware, that's not about "at least one", it must contain each term inserted by the user: failing just a single word, the record won't be returned.
Boolean queries are possible by using the must operator, but across queries only:
Code:
Query queryNumber = monthQb.keyword()
.onField( "monthRomanNumber" )
.matching( 2 )
.createQuery();
Query queryName = monthQb.keyword()
.onField( "name" )
.matching( "Frebruary" )
.createQuery();
Query combined = monthQb.bool().must( queryNumber ).must( queryName ).createQuery();
To enforce the "AND" operator across each term of a single String (is that the question?), then the String must still be parsed and using the good old QueryParser should be a good approach. We're also looking into some way to provide this same feature via the DSL, would you have a suggestion for the API?
As far as common use cases, most people who want to enforce AND don't want to enforce it on every single word, so having the different fields not mandating it, and then mandating the "must" operation across queries, as in the example above.