Hi,

is there a way to make solr respect the order of token matches when the query 
is a multi-term string?

Here's an example:

Query String: "John C"

Indexed Strings:

- "John Cage"
- "Cargill John"

This will return both indexed strings as a result. However, "Cargill John" 
should not match in that case, because the order 
of the tokens is not the same as in the query.

Here's the fieldtype:

  <fieldType name="edgytext" class="solr.TextField" positionIncrementGap="100">

   <analyzer type="index">
     <tokenizer class="solr.WhitespaceTokenizerFactory"/>
     <filter class="solr.LowerCaseFilterFactory"/>
     <filter class="solr.StopFilterFactory" ignoreCase="true" 
words="stopwords.txt" enablePositionIncrements="true" />     
     <filter class="solr.PatternReplaceFilterFactory" pattern="([^a-z])" 
replacement="" replace="all" />
     <filter class="solr.EdgeNGramFilterFactory" minGramSize="1" 
maxGramSize="25" />
   </analyzer>

   <analyzer type="query">
     <tokenizer class="solr.WhitespaceTokenizerFactory"/>
     <filter class="solr.LowerCaseFilterFactory"/>
     <filter class="solr.StopFilterFactory" ignoreCase="true" 
words="stopwords.txt" enablePositionIncrements="true" />
     <filter class="solr.PatternReplaceFilterFactory" pattern="([^a-z])" 
replacement="" replace="all" />
   </analyzer>

  </fieldType>

Is there a way to achieve this using this fieldtype?


thanks!




Reply via email to