manuel aldana wrote:
hi,

I am having queries:
+a b
a b

I always wondered why the + operator did not work. Looking at the http://localhost:8983/solr/admin/analysis.jsp analysis trace the query analzyer indeed is removing the + through the WordDelemiterFilterFactory. So I removed this filter (btw: why is this the default setting, which I think is a bit dangerous because the special + - operators are thus removed).

To debug quert parser, use FULL INTERFACE admin form (http://localhost:8983/solr/admin/form.jsp) and check Debug: enable and see debug info. You cannot use analysis.jsp for this purpose
because it doesn't use query parser.

Still '+a b' matches documents which have no 'a' inside the field. Now I guess solr is handling the '+' as a normal match character and not as an lucene (required) operator at all? Is this correct. If so, why is this lucene operator overridden? Maybe I need to escape the + for solr, so it treats it as an operator?

thanks.

Solr should use lucene query parser as long as you never explicitly use query parser
other than lucene through defType, localParams, etc...
I'm just guessing 'a' was filtered out by StopFilter?

With example schema.xml, you can see:

http://localhost:8983/solr/select?q=%2Ba+b&debugQuery=on

<str name="rawquerystring">+a b</str>
<str name="querystring">+a b</str>
<str name="parsedquery">text:b</str>
<str name="parsedquery_toString">text:b</str>


http://localhost:8983/solr/select?q=cat%3A(%2Ba+b)&debugQuery=on

<str name="rawquerystring">cat:(+a b)</str>
<str name="querystring">cat:(+a b)</str>
<str name="parsedquery">+cat:a cat:b</str>
<str name="parsedquery_toString">+cat:a cat:b</str>

Koji

Reply via email to