On Tue, Nov 24, 2009 at 11:58 PM, darniz <rnizamud...@edmunds.com> wrote:
> > > i created a filed as same as the lucid blog says. > > <field name="autocomp" type="edgytext" indexed="true" stored="true" > omitNorms="true" omitTermFreqAndPositions="true"/> > > with the following field configurtion > > <fieldType name="edgytext" class="solr.TextField" > positionIncrementGap="100"> > − > <analyzer type="index"> > <tokenizer class="solr.KeywordTokenizerFactory"/> > <filter class="solr.LowerCaseFilterFactory"/> > <filter class="solr.EdgeNGramFilterFactory" minGramSize="1" > maxGramSize="25"/> > </analyzer> > − > <analyzer type="query"> > <tokenizer class="solr.KeywordTokenizerFactory"/> > <filter class="solr.LowerCaseFilterFactory"/> > </analyzer> > </fieldType> > > Now when i query i get the correct phrases for example if search for > autocomp:"how to" i get all the correct phrases like > > How to find a car > How to find a mechanic > How to choose the right insurance company > > etc... which is good. > > Now I have two question. > 1) Is it necessary to give the query in quote. My gut feeling is yes, since > if you dont give quote i get phrases beginning with How followed by some > other words like How can etc... > Yes since we want to do phrase searches on n-grams > 2)if i search for word for example choose, it gives me nothing > I was expecting to see a result considering there is a word "choose" in the > phrase > How to choose the right insurance company > > i might look more at documentation but do you have anything to advice. > > EdgeNgram creates n-grams from the starting or the ending edge therefore you can't match words in the middle of a phrase. Try using NGramFilterFactory instead. -- Regards, Shalin Shekhar Mangar.