Hi Chandan, I will answer as my previous answer to a similar topic that got lost : "First of all, simple string autosuggestion or document autosuggestion ? ( with more additional field to show then the label) Are you interested in the analysis for the text to suggest ? Fuzzy suggestions ? exact "beginning of the phrase" suggestions ? infix suggestions ?"
If you need only the category *payloadField* should be what you need . I never used it as a feature but it is there [1] . As Reth suggested, at the moment Solr supports only one payloadField, ignoring the others ( code confirms this). In the case you want to show the label AND the category AND whatever ( in Amazon style to make it simple) . A very straighforward solution is to model a specific Solr Field for your product collection. This field will contain the name of the product, analyzed according your need. Then your autosuggester will simply hit that field on each char typed, and you can show the entire document in the suggestions ( with all the fields you want) . Or we take a look to the implementation and we contribute the support for multiple *payloadField*. Cheers [1] https://cwiki.apache.org/confluence/display/solr/Suggester On Sun, Apr 3, 2016 at 1:09 PM, Reth RM <reth.ik...@gmail.com> wrote: > There is a payload attribute but I'm not sure if this can be used for such > use case. Lets wait for others contributors to confirm. > Similar question posted here: > > http://stackoverflow.com/questions/32434186/solr-suggestion-with-multiple-payloads > . > > If its just a category that you need then the work around(although not > accurate one) that I can think of is to include the category value to the > same field with pipe separation and extract from it? > > On Sun, Apr 3, 2016 at 11:41 AM, chandan khatri <chandankhat...@gmail.com> > wrote: > > > Hi All, > > > > I've a query regarding autosuggestion. My use case is as below: > > > > 1. User enters product name (say Nokia) > > 2. I want suggestions along with the category with which the product > > belongs. (e.g Nokia belongs to "electronics" and "mobile" category) so I > > want suggestion like Nokia in electronics and Nokia in mobile. > > > > I am able to get the suggestions using the OOTB AnalyzingInFixSuggester > but > > not sure how I can get the category along with the suggestion(can this > > category be considered as facet of the suggestion??) > > > > Any help/pointer is highly appreciated. > > > > Thanks, > > Chandan > > > -- -------------------------- Benedetti Alessandro Visiting card : http://about.me/alessandro_benedetti "Tyger, tyger burning bright In the forests of the night, What immortal hand or eye Could frame thy fearful symmetry?" William Blake - Songs of Experience -1794 England