The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

mathijs (1) [Avatar] Offline
#1
3.4.5 Combining queries: BooleanQuery
... A clause is a subquery that can be ***optional,
required***
, or prohibited. These attributes allow for logical AND, OR, and NOT combinations. You add a
clause to a BooleanQuery using this API method:
public void add(Query query, BooleanClause.Occur occur)
where occur can be BooleanClause.Occur.MUST, BooleanClause.Occur.SHOULD or
BooleanClause.Occur.MUST_NOT.


Swap optional and required, to match the order of (AND, OR, NOT) and (MUST, SHOULD, MUST_NOT).
mike.mccandless (221) [Avatar] Offline
#2
Re: pdf section 3.4.5
OK I'll try to fix; thanks. Book is going through production now so at some point I won't be able to fix anymore!