lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aniljayanti <anil.jaya...@gmail.com>
Subject auto completion search with solr using NGrams in SOLR
Date Wed, 01 Aug 2012 10:04:45 GMT
I want to implement an auto completion search with solr using NGrams. If the
user is searching for names of employees, then auto completion should be
applied. ie., 

if types "j" then need to show the names starts with "j" if types "ja" then
need to show the names starts with "ja" if types "jac" then need to show the
names starts with "jak" if types "jack" then need to show the names starts
with "jack"

Below is my configuration settings in schema.xml, Please suggest me if
anything wrong.

below is my code in schema.xml

<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="15" /> 
  </analyzer>
 <analyzer type="query">
  <tokenizer class="solr.KeywordTokenizerFactory" /> 
  <filter class="solr.LowerCaseFilterFactory" /> 
  </analyzer>
  </fieldType>
<field name="empname" type="edgytext" indexed="true" stored="true" />
<field name="autocomplete_text" type="edgytext" indexed="true" stored="true"
omitNorms="true" omitTermFreqAndPositions="true" /> 
<copyField source="empname" dest="text" /> 

when im searching with name "mado" or "madonna" getting employees names.But
when searching with "madon" not getting any data.

Please help me on this.


Thanks in Advance,

Anil.




--
View this message in context: http://lucene.472066.n3.nabble.com/auto-completion-search-with-solr-using-NGrams-in-SOLR-tp3998559.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message