Re: BooleanQueryBuilder is not adding parenthesis around the query

2020-01-22 Thread Edward Ribeiro
Cool. Glad to help. :) Cheers, Edward Em qua, 22 de jan de 2020 16:44, Arnold Bronley escreveu: > I knew about the + and other signs and their connections to MUST and other > operators. What I did not understand was why it was not adding parentheses > around the expression. In your first replay

Re: BooleanQueryBuilder is not adding parenthesis around the query

2020-01-22 Thread Arnold Bronley
I knew about the + and other signs and their connections to MUST and other operators. What I did not understand was why it was not adding parentheses around the expression. In your first replay you mentioned that - 'roughly, a builder for each query enclosed in "parenthesis"' - that was the key po

Re: BooleanQueryBuilder is not adding parenthesis around the query

2020-01-22 Thread Arnold Bronley
Thanks, Edaward. This was the exact answer I was looking for :) On Wed, Jan 22, 2020 at 1:08 PM Edward Ribeiro wrote: > If you are using Lucene's BooleanQueryBuilder then you need to do nesting > of your queries (roughly, a builder for each query enclosed in > "parenthesis"). > > A query like (t

Re: BooleanQueryBuilder is not adding parenthesis around the query

2020-01-22 Thread Edward Ribeiro
Oh, you asked about the meaning of the plus sign too. Well, I recommend reading a book* or any tutorial, but the clauses of boolean queries there are three occurences, SHOULD, MUST and MUST_NOT, that roughly translate to OR, AND, and NOT, respectively. The plus sign means MUST, the minus sign mea

Re: BooleanQueryBuilder is not adding parenthesis around the query

2020-01-22 Thread Edward Ribeiro
If you are using Lucene's BooleanQueryBuilder then you need to do nesting of your queries (roughly, a builder for each query enclosed in "parenthesis"). A query like (text:child AND text:toys) OR age:12 would be: Query query1 = new TermQuery(new Term("text", "toys")); Query query2 = new TermQuery