Anssi Törmä created SOLR-5435:
---------------------------------

             Summary: An edismax query wrapped in parentheses parsed wrong
                 Key: SOLR-5435
                 URL: https://issues.apache.org/jira/browse/SOLR-5435
             Project: Solr
          Issue Type: Bug
          Components: query parsers
    Affects Versions: 4.3.1
            Reporter: Anssi Törmä


I have an edismax query with the following parameters:
* q={{("jenkins " OR text:"jenkins")}}
** Yes, there is a space in {{"jenkins "}}
* qf={{used_name^7 text}}

Queries to the field {{used_name}} are analyzed like this
{noformat}
<analyzer type="query">
  <tokenizer class="solr.KeywordTokenizerFactory"/>
  <filter class="solr.PatternReplaceFilterFactory" 
       pattern="(,|\s)+" 
       replacement=" "/>
  <filter class="solr.TrimFilterFactory"/>
  <filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
{noformat}
Queries to the field {{text}} are anayzed like this:
{noformat}
<analyzer type="query">
  <tokenizer class="solr.WhitespaceTokenizerFactory"/>
  <filter class="solr.WordDelimiterFilterFactory"
                generateWordParts="0"
                generateNumberParts="0"
                catenateWords="1"
                catenateNumbers="0"
                catenateAll="0"
                preserveOriginal="1"/>
  <filter class="solr.LowerCaseFilterFactory"/>
  <filter class="solr.ASCIIFoldingFilterFactory" />
</analyzer>
{noformat}

In Solr admin console, I can see the query is parsed wrongly:
{{+((used_name:jenkins^7.0 | text:jenkins) (used_name:text:^7.0 | (text:text: 
text:text)) (used_name:jenkins^7.0 | text:jenkins))}}
See that {{(text:text: text:text)}}?

As a workaround I leave a space between parentheses and what they enclose, i.e. 
q={{( "jenkins " OR text:"jenkins" )}}, then the query is parsed as I expect, 
i.e.
{{+((used_name:jenkins^7.0 | text:jenkins) text:jenkins)}}

The query is also parsed correctly if there's no space in {{"jenkins"}}.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to