The "AND" and "-" operators are being parsed at the same level - no
parentheses are involved, so they generate a single, flat Boolean query.
So it really is equivalent to:
-name:[A TO Z] -name:[a TO z]
That is a purely negative query, so Solr should automatically supply a *:*
terms so that it is equivalent to:
*:* -name:[A TO Z] -name:[a TO z]
Now, on to the real problem... "Zareena",
"Zhariman","Zarimanabibi","Zarnabanu" etc all lexically FOLLOW "Z", so they
are NOT excluded from the results. You need an end point for the range that
is greater than or equal to all terms you want to match. That could be
something like "ZZZZZZZZZZ" and "zzzzzzzzzz".
But, that won't work either since the second character could be lower case,
so maybe it needs to be:
-name:[A TO zzzzzzzzzz]
Which covers bothe upper and lower case, but also includes the special
character between the two alpha ranges, including underscore. Is underscore
an issue here.
Maybe the following pattern will cover your cases but keep underscore names:
-name:[A TO Zzzzzzzzzz]
Is name a "string" or "text" field (which)? If a text field, does it have a
lower case filter, in which case you don't need lower case.
Worst case, you could use a regex query term, but better to avoid that if at
all possible.
-- Jack Krupansky
-----Original Message-----
From: nutchsolruser
Sent: Wednesday, August 27, 2014 12:21 AM
To: solr-user@lucene.apache.org
Subject: Solr range query issue
Hi ,
I Am using solr 4.6.1 . I have name field in my schema and I am sending
following query from solr admin UI to solr. which will find names containing
characters other english alphabets.
-name:[A TO Z] AND -name:[a TO z]
In my opinion it should return documents which do not contain name in range
between A TO Z, but in my case Solr is also returning names starting with
letter Z. e.g. "Zareena", "Zhariman","Zarimanabibi","Zarnabanu" etc
Is this correct behaviour?if yes then what would be the correct query to
find user names which contain only english alphabet characters.
Following is my debug output:
"debug": {
"rawquerystring": "-name:[A TO Z] AND -name:[a TO z]",
"querystring": "-name:[A TO Z] AND -name:[a TO z]",
"parsedquery": "-name:[a TO z] -name:[a TO z]",
"parsedquery_toString": "-name:[a TO z] -name:[a TO z]",
"QParser": "LuceneQParser",
--
View this message in context:
http://lucene.472066.n3.nabble.com/Solr-range-query-issue-tp4155327.html
Sent from the Solr - User mailing list archive at Nabble.com.