You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Anssi Törmä (JIRA)" <ji...@apache.org> on 2013/11/11 12:11:18 UTC

[jira] [Commented] (SOLR-5435) An edismax query wrapped in parentheses parsed wrong

    [ https://issues.apache.org/jira/browse/SOLR-5435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13818869#comment-13818869 ] 

Anssi Törmä commented on SOLR-5435:
-----------------------------------

This may be related to SOLR-3377. At least that's where I found the workaround to leave a space between parentheses.

> 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-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org