You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by nithyavembu <ni...@yahoo.co.in> on 2008/03/05 14:38:07 UTC

Re: How to search multiphrase or a middle term in a word???

Thanks Hoss.

 As you said i tried NGrimTokenizer, but still i didnt get the result.
 I just added 
       <tokenizer class="solr.NGramTokenizerFactory" minGram="1"
maxGram="1"/> 
 in schema.xml during indexing and querying. But it didnt work.

 But after added this tokenizer this scenario also didnt work
  Index data : sweetheart,sweetHeart.
  Search data : Heart or heart
  Result : sweetHeart

  As i explored i didnt correctly understood the behaviour of NGrim
Tokenizer.
  I want to know the usage and the configuration in code using NGrim
Tokenizer.
  Please help me out.
  
Thanks,
Nithya.
  





your "master" examples work part of the time because of the 
WordDelimiterField can tell at indextime that the capital M in the middle 
of the word is a good place to split on.

without hints like that at index time, the only way to do "middle of the 
word" searches is with wildcard type queries -- which ar really 
inefficent.

You might want to read a it about N-Grams and consider using an 
NGramTokenizer to chunk up your input words into ngrams for easy searching 
on pieces of words.



:

-- 
View this message in context: http://www.nabble.com/How-to-search-multiphrase-or-a-middle-term-in-a-word----tp15484754p15850225.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: How to search multiphrase or a middle term in a word???

Posted by Chris Hostetter <ho...@fucit.org>.
:   As i explored i didnt correctly understood the behaviour of NGrim
: Tokenizer.
:   I want to know the usage and the configuration in code using NGrim
: Tokenizer.
:   Please help me out.

The min and max options are really all the configuration there is -- for 
your purpose they should be the same, "1" might make sense, or if wnat a 
minimum length thta you allow people to search on you might want something 
larger.

The best way to understand what's happening and why is to play arround 
with the Analysis Tool so you can get a sense of how the NGramTokenizer is 
breaking up your indexed text.  Then use debugQuery=true when you issue 
your queries to see what the queries themselves look like -- they should 
be "phrases" of single character "words".

It may be that you need to add a LowercaseFilter or remove a StopFilter 
from your FieldType to get the behavior you want -- the analysis tool will 
help you figure that out.

-Hoss