You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (Commented) (JIRA)" <ji...@apache.org> on 2012/04/11 16:15:17 UTC

[jira] [Commented] (SOLR-3350) TextField's parseFieldQuery method not using analyzer's enablePosIncr parameter

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

Robert Muir commented on SOLR-3350:
-----------------------------------

How can this be taken from the analyzers configuration?

the Analyzer can use a mix of enablePositionIncrements=true or enablePositionIncrements=false
for the different filters that support that option.

Here is an example of a real use case (from text_ga):
{noformat}
...
<!-- removes n-, etc. position increments is intentionally false! -->
<filter class="solr.StopFilterFactory" ignoreCase="true" 
        words="lang/hyphenations_ga.txt"
        enablePositionIncrements="false"/>
<filter class="solr.IrishLowerCaseFilterFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" 
        words="lang/stopwords_ga.txt" 
        enablePositionIncrements="true"/>
...
{noformat}

                
> TextField's parseFieldQuery method not using analyzer's enablePosIncr parameter
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-3350
>                 URL: https://issues.apache.org/jira/browse/SOLR-3350
>             Project: Solr
>          Issue Type: Bug
>          Components: Schema and Analysis
>    Affects Versions: 3.5, 4.0
>            Reporter: Tommaso Teofili
>            Priority: Minor
>
> parseFieldQuery method of TextField class just set 
> {code}
>   ...
>   boolean enablePositionIncrements = true;
>   ...
> {code}
> while that should be taken from Analyzer's configuration.
> The above condition is evaluated afterwards in two points:
> {code}
>   ...
>   if (enablePositionIncrements) {
>     mpq.add((Term[]) multiTerms.toArray(new Term[0]), position);
>   } else {
>     mpq.add((Term[]) multiTerms.toArray(new Term[0]));
>   }
>   return mpq;
>   ...
>   ...
>   if (enablePositionIncrements) {
>     position += positionIncrement;
>     pq.add(new Term(field, term), position);
>   } else {
>      pq.add(new Term(field, term));
>   }
>   ...
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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