On Wed, Sep 30, 2009 at 11:24 PM, <aod...@gmail.com> wrote: > If I index the following text: "I live in Dublin Ireland where > Guinness is brewed" > > Then search for: duvlin > > Should Solr return a match? > > In the admin interface under the analysis section, Solr highlights > some NGram matches? > > When I enter the following query string into my browser address bar, I > get 0 results? > > http://localhost:8983/solr/select/?q=duvlin&debugQuery=true > > Nor do I get results for dub, dubli, ublin, dublin (du does return a > result). > > I also notice when I use debugQuery=true, the parsed query is a > PhraseQuery. This doesn't make sense to me, as surely the point of the > NGram is to use a Boolean OR between each Gram?? > > However, if I don't use an NGramFilterFactory at query time, I can get > results for: dub, ublin, du, but not duvlin. > > Is the n-grammed field specified as the <defaultSearchField> in your schema.xml? If not, then you will have to specify the field name during querying e.g. field_name:duvlin. You can see exactly how your query is being parsed if you add debugQuery=on as a request parameter.
-- Regards, Shalin Shekhar Mangar.