Hi,

You can add an optional (phrase) clause to boost exact matches. If you are 
using (e)dismay

bq=typeahead:"New York World"^50 would do the trick.

Ahmet



On Tuesday, October 7, 2014 6:55 PM, Shobhit <shobhitpal48am...@gmail.com> 
wrote:
Hi,
I am trying to get the exact search term coming at top in Solr search
results, but solr is not returning the exact matching records on top,
instead exact matching terms are coming somewhere down after few records.

For example :  
I am searching for term "New York World", and I want the New York World to
come on top of solr search results, but solr is returning results as ,

New York World Journal 
New York World Telegram
New York World

*Search query used : *

http://localhost:8981/typeahead/suggest/?q=new+york+world

*schema.xml *

<fieldType name="typeahead" class="solr.TextField">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.ISOLatin1AccentFilterFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EdgeNGramFilterFactory" maxGramSize="100"
minGramSize="1"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.ISOLatin1AccentFilterFactory"/>
<filter class="solr.PatternReplaceFilterFactory" pattern="^(.{20})(.*)?"
replacement="$1" replace="all"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
</fieldType>

<field name="name_something" type="typeahead" indexed="true" stored="false"
multiValued="true"/>

*solrconfig.xml*

requestHandler name="typeahead" class="solr.SearchHandler">
<lst name="defaults">
<str name="wt">json</str>
<int name="rows">10</int>
<str name="indent">true</str>
<str name="df">autosuggest</str>
<str name="q.op">AND</str>
<str name="fl">
name_s,pk_id,city_s,state_s,country_s
</requestHandler>

kindly provide your suggestions to achieve this.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Exact-matches-are-not-coming-on-Top-for-autocomplete-search-results-tp4163162.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to