Hi all, I'm trying to use prefixes to match similar strings to a query string. I have the following field type:
<fieldtype name="prefix" stored="true" indexed="true" class="solr.TextField"> <analyzer> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.StopFilterFactory"/> <filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="10"/> </analyzer> </fieldtype> field: <field name="wordPrefix" type="prefix" indexed="true" stored="true"/> copyField: <copyField source="word" dest="wordPrefix"/> If I apply this to an indexed string: "ipod shuffle" and query string: "shufle" (missing f) I get matching terms for "sh", "shu" "shuf" Index Analyzer ipodshuffle ipodshuffle ipodshuffle ipipoipodshshushuf shuffshufflshuffle Query Analyzer shufle shufle shufle shshushufshufl shufle However when I query for with "shufle" i get no results: http://localhost:8983/solr/select?q=wordPrefix%3Ashufle&fl=wordPrefix&qt=standard&debugQuery=on <lst name="debug"> <str name="rawquerystring">wordPrefix:shufle</str> <str name="querystring">wordPrefix:shufle</str> - <str name="parsedquery"> PhraseQuery(wordPrefix:"sh hu uf fl le shu huf ufl fle shuf hufl ufle shufl hufle shufle") </str> - <str name="parsedquery_toString"> wordPrefix:"sh hu uf fl le shu huf ufl fle shuf hufl ufle shufl hufle shufle" </str> This post suggests that I need to set the Position Increment for the my token filter, but I'm not sure how to do that or if it's possible. http://www.lucidimagination.com/search/document/bc643c39f0b6e423/queryparser_and_ngrams#629b39ea39aa9cd4 Thoughts? Thanks...Tom