lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Krupansky" <j...@basetechnology.com>
Subject Re: Unable to match partial word
Date Tue, 05 Mar 2013 18:38:18 GMT
You could also consider using EdgeNGramFilterFactory at index time, which 
can index all or some of the prefixes for each term, so that a query of 
"prod" would find "product", "production", etc.

See:
http://lucene.apache.org/core/4_1_0/analyzers-common/org/apache/lucene/analysis/ngram/EdgeNGramFilterFactory.html

Set minGramSize="3" or 4 (your case) or more to minimize lots of short 
prefixes.

-- Jack Krupansky

-----Original Message----- 
From: Van Tassell, Kristian
Sent: Tuesday, March 05, 2013 12:18 PM
To: solr-user@lucene.apache.org
Subject: Unable to match partial word

I'm doing a search for "prod" and would assume it would pull back matches 
for product, production, etc. but I get zero hits. Any ideas?

Here is my field type:

<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
                <tokenizer class="solr.WhitespaceTokenizerFactory"/>
               <filter class="solr.StopFilterFactory" ignoreCase="true" 
words="stopwords.txt" enablePositionIncrements="true"
                              />
               <filter class="solr.WordDelimiterFilterFactory" 
generateWordParts="1" generateNumberParts="1" catenateWords="1" 
catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
               <filter class="solr.LowerCaseFilterFactory"/>
               <filter class="solr.SnowballPorterFilterFactory" 
language="English" protected="protwords.txt"/>
        </analyzer>
        <analyzer type="query">
               <tokenizer class="solr.WhitespaceTokenizerFactory"/>
               <filter class="solr.SynonymFilterFactory" 
synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
               <filter class="solr.StopFilterFactory" ignoreCase="true" 
words="stopwords.txt" enablePositionIncrements="true"
                />
               <filter class="solr.WordDelimiterFilterFactory" 
generateWordParts="1" generateNumberParts="1" catenateWords="0" 
catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
               <filter class="solr.LowerCaseFilterFactory"/>
               <filter class="solr.SnowballPorterFilterFactory" 
language="English" protected="protwords.txt"/>
        </analyzer>
</fieldType> 


Mime
View raw message