java - Sorting SOLR autosuggestion on custom score field -


i've got apache solr web application. i'm saving queries entered in database , index , query string , query string count suggestion core.

here format

<doc>     <str name="id">superman</str>     <long name="searchcount_l">10</long>   //superman has been queried 10 times <doc> <doc>     <str name="id">superman movie</str>     <long name="searchcount_l">30</long>  //superman movie has been queried 30 times <doc> 

configuration:

 <searchcomponent name="suggest" class="solr.spellcheckcomponent">     <lst name="spellchecker">         <str name="name">suggest</str>         <str name="classname">org.apache.solr.spelling.suggest.suggester</str>         <str name="lookupimpl">org.apache.solr.spelling.suggest.fst.wfstlookupfactory</str>         <str name="buildoncommit">true</str>         <str name="field">id</str>     </lst> </searchcomponent> 

if user types in 'sup' want "superman movie" first 1 in autosuggest list.

i've looked @ implementing comparatorclass

public class mysuggestioncomparator implements comparator<suggestword>  

but suggestword class stores freq, score , string value , not value of custom searchcount_l field.

questions:

  • should implement custom search handler queries suggestion core , boost on searchcount_l field. approach autosuggest ? effect speed if use custom search request handler using given suggest component ?

  • is there configuration solr.spellcheckcomponent can use achieve ?

  • what filters being used in solr.spellcheckcomponent ?

you can check following alternatives :-

use normal search edgegrams filter generate tokens.
maintaining count, can search , sort on count.
have index grow query needs stored perform fast.

else, index each search term separate document field, not store queries.
can use facet components , facet.prefix query retrieve search suggestions.
count taken care facet count sorting default.
performance fast index size limited.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -