Re:Re: Use boolean operator "-", the result is incorrect

2020-04-08 Thread slly
Thank you very much for your reply. I have understood the meaning of it. https://lucidworks.com/post/why-not-and-or-and-not/ At 2020-04-09 01:45:14, "Chris Hostetter" wrote: >: Solr/Lucene do not employ boolean logic. See Hossman’s excellent post: >: >:

Re: Use boolean operator "-", the result is incorrect

2020-04-08 Thread Chris Hostetter
: Solr/Lucene do not employ boolean logic. See Hossman’s excellent post: : : https://lucidworks.com/post/why-not-and-or-and-not/ : : Until you internalize this rather subtle difference, you’ll be surprised. A lot ;). : : You can make query parsing look a lot like boolean logic by carefully

Re: Use boolean operator "-", the result is incorrect

2020-04-08 Thread Erick Erickson
Solr/Lucene do not employ boolean logic. See Hossman’s excellent post: https://lucidworks.com/post/why-not-and-or-and-not/ Until you internalize this rather subtle difference, you’ll be surprised. A lot ;). You can make query parsing look a lot like boolean logic by carefully using

Re: Use boolean operator "-", the result is incorrect

2020-04-08 Thread Bernd Fehling
About first query, you have a negative query telling the searcher to give only results _NOT_ containing "name_s:a". From that result list you want only results of "age_i:10". Boolean table for OR is: 0 OR 0 = 0 1 OR 0 = 1 0 OR 1 = 1 1 OR 1 = 1 You get one result. About second query your

Re:Re: Use boolean operator "-", the result is incorrect

2020-04-08 Thread slly
My default query operator is OR.There are two pieces of data in the index: { "id":"1", "name_s":"a", "age_i":10, "_version_":1663396766955864064}, { "id":"2", "name_s":"b", "age_i":10, "_version_":1663396767058624512}] } 1. -name_s:a OR age_i:10 # I think two pieces of data should

Re: Use boolean operator "-", the result is incorrect

2020-04-08 Thread Bernd Fehling
What is debugQuery telling you about: - "rawquerystring" - "querystring" - "parsedquery" - "parsedquery_toString" - "QParser" Also what is your default query operator, AND or OR? This is what matters for your second example with id:("1" "2") It could be id:("1" AND "2") or id:("1" OR "2") .

Re:Re: Use boolean operator "-", the result is incorrect

2020-04-08 Thread slly
Thanks Bernd for your reply. Can you tell me what your query syntax looks like? At 2020-04-08 16:33:20, "Bernd Fehling" wrote: >Looks correct to me. > >You have to obey the level of the operators and the parenthesis. >Turn debugQuery on to see the results of parsing of your query. >

Re:Re: Use boolean operator "-", the result is incorrect

2020-04-08 Thread slly
Thanks Bernd for your reply. I run the query on the Solr Web UI in Solr 7.3.1/7.7.2, the screenshot of my execution results is as follows, I don't understand whether there is a grammatical error ? 1. -name_s:a OR age_i:10 2. id:("1" "2") AND (-name_s:a) At 2020-04-08 16:33:20, "Bernd

Re: Use boolean operator "-", the result is incorrect

2020-04-08 Thread Bernd Fehling
Looks correct to me. You have to obey the level of the operators and the parenthesis. Turn debugQuery on to see the results of parsing of your query. Regards Bernd Am 08.04.20 um 09:34 schrieb slly: > > > If the following query is executed, the result is different: > > > id:("1" "2") AND

Use boolean operator "-", the result is incorrect

2020-04-08 Thread slly
Hello Folks, We are using Solr 7.3.1, I write the following two lines of data into collection: id, name_s, age_i 1, a, 10 2, b, 10 Use the following query syntax: -name_s:a OR age_i:10 I think we should return two pieces of data, but actually only one piece of data: id, name_s, age_i 2, b, 10