lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Klose ...@shi-gmbh.com>
Subject AW: AW: auto completion search with solr using NGrams in SOLR
Date Thu, 02 Aug 2012 10:10:31 GMT
If you want to search in the two fields "title" and "empname" you have to use the query parser
(e)dismax
http://wiki.apache.org/solr/ExtendedDisMax
you need to specify the qf param: qf=title empname

check your solrconfig.xml to verifiy which queryparser you are using right now.


In your usecase you do not need the asterics in the query.
"q=am" in combination with the edgengram will find aman, amar, amal

Viele Grüße aus Augsburg

Markus Klose
SHI Elektronische Medien GmbH 
 




-----Ursprüngliche Nachricht-----
Von: aniljayanti [mailto:anil.jayanti@gmail.com] 
Gesendet: Donnerstag, 2. August 2012 09:34
An: solr-user@lucene.apache.org
Betreff: Re: AW: auto completion search with solr using NGrams in SOLR

Hi,

thanks,

im searching with empname filed.  want to search with both "empname" and "title". 

below is my changed code.

<fieldType name="edgytext" class="solr.TextField"
positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.LowerCaseTokenizerFactory"/>
<filter class="solr.EdgeNGramFilterFactory" minGramSize="1" maxGramSize="15"
/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.LowerCaseTokenizerFactory"/>
</analyzer>
</fieldType>


<field name="title" type="edgytext" indexed="true" stored="true"
omitNorms="true" omitTermFreqAndPositions="true"/> <field name="empname" type="edgytext"
indexed="true" stored="true"
omitNorms="true" omitTermFreqAndPositions="true" />

<copyField source="empname" dest="text"/> <copyField source="title" dest="text"/>

SOLR Query :
http://localhost:8080/AC/select/?q=(*am*)&rows=500

1) want to search with "title" and "empname" both. 
2) am i quering correctly with above url ??

but getting result like .....

p*am*
s*am*
ra*am*a

but i want the result like ....

aman
amar
amal

please help me in this...




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

Mime
View raw message