The ordering at the lowest level in Lucene is controlled based on an arbitrary weighting factor: I believe the only option you have at the Solr level is to order by term value (eg alphabetically), or by term frequency. You could do this by creating a field with all of your "sales" - if you create one document for each "sale", and build suggestions from the name of the product sold, then the suggestions should be ordered by most-popular item

-Mike

On 4/19/14 9:15 AM, Xelion wrote:
Hi guys , we are trying to use solr on our website as a search engine , but
we have a problem , we can not sort the suggestions by the number of sales.

Schema.xml:
<field name="suggest_test" type="text_shingle" indexed="true" stored="true"
multiValued="false" />

<fieldType name="text_shingle" class="solr.TextField"
positionIncrementGap="100">
        <analyzer>
                <tokenizer class="solr.StandardTokenizerFactory"/>
                <filter class="solr.LowerCaseFilterFactory"/>
                <filter class="solr.ShingleFilterFactory" maxShingleSize="4"
                        outputUnigrams="true" outputUnigramsIfNoShingles="false" 
/>
        </analyzer>
</fieldType>

SolrConfig.xml :
Hi guys, stiamo cercando di usare solr nel nostro sito come motore di
ricerca, ma abbiamo un problema, non riusciamo a ordinare i suggerimenti per
il numero di vendite.

Schema.xml:
<field name="suggest_test" type="text_shingle" indexed="true" stored="true"
multiValued="false" />

<fieldType name="text_shingle" class="solr.TextFiesolr.
StandardTokenizerFactory"/>
                <filter class="solr.LowerCaseFilterFactory"/>
                <filter class="solr.ShingleFilterFactory" maxShingleSize="4"
                        outputUnigrams="true" outputUnigramsIfNoShingles="false" 
/>
        </analyzer>
</fieldType>

SolrConfig.xml :

   <searchComponent class="solr.SpellCheckComponent" name="spellcheck">
           <str name="queryAnalyzerFieldType">text_shingle</str>
           <lst name="spellchecker">
                <str name="name">dict_spellcheck</str>
                <str 
name="classname">org.apache.solr.spelling.suggest.Suggester</str>
                <str
name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>
                        <str name="field">suggest_test</str>
                        <str name="buildOnCommit">true</str>
                </lst>
                <lst name="spellchecker">
                <str name="name">dict_wrong_spellcheck</str>
                 <str name="classname">solr.IndexBasedSpellChecker</str>
                <str
name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>
                <str name="field">suggest_test</str>
                <str name="buildOnCommit">true</str>
                </lst>
   </searchComponent>
        
   <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
     <lst name="defaults">
                <str name="spellcheck">on</str>
                <str name="df">suggest_test</str>
                <str name="spellcheck.dictionary">dict_spellcheck</str>
                <str name="spellcheck.dictionary">dict_wrong_spellcheck</str>
                <str name="spellcheck.onlyMorePopular">true</str>
                <str name="spellcheck.count">10</str>
                <str name="spellcheck.collate">true</str>
        </lst>
<arr name="last-components">
       <str>spellcheck</str>
     </arr>
   </requestHandler>

We have read many posts on this forum, but no one was helpful.
Is there anyone who has had our own problems and was able to solve it?



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-How-to-sorting-suggestions-by-sales-tp4132118.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to