You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2015/12/02 19:07:11 UTC
[jira] [Commented] (SOLR-8345) Wrong query parsing
[ https://issues.apache.org/jira/browse/SOLR-8345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15036274#comment-15036274 ]
Hoss Man commented on SOLR-8345:
--------------------------------
to clarify the specific logic taking place here...
* {{\( ... \)}} -- parens indicate grouping, typically for the purpose of constructing a multiclause sub-BooleanQuery.
* {{myfield:}} is syntax for indicating that "myfield" should override the default field
* {{myfield:\( ... \)}} indicates that when parsing the contents of parens, myfield overrides the defualt field for _all_ clauses found in the group.
* {{-foo}} is the syntax for a negated clause
* {{myfield:\(-1\)}} constructs a negated clause for the term {{myfield:1}}, since it is the only cluase in the grooup no sub-BooleanQuery is created. since it is the only clause in the top leval query, and it is negated, Solr adds the neccessary {{\*:\*}}
this is really no different then something like {{myfield:\(+foo -bar yaz\)}} .. the prefix "\+" and "\-" characters are *always* treated as MUST and MUST_NOT modifiers unless they are quoted or escaped. ie...
{noformat}
myfield:("+foo" \-bar yaz)
{noformat}
> Wrong query parsing
> -------------------
>
> Key: SOLR-8345
> URL: https://issues.apache.org/jira/browse/SOLR-8345
> Project: Solr
> Issue Type: Bug
> Reporter: Saar Carmi
> Priority: Minor
>
> When sending a query for a numeirc field with &fq=myfield:(-1) the query is parsed as -myfield:1
> I would expect it to be either parsed as myfield:"-1" or an exception to be returned.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org