0
votes

I am using Solr version 3.5. I want to implement an auto-suggest feature in my application through the Suggester approach. http://wiki.apache.org/solr/Suggester.

Can someone please help me with the following:

How can i return more than one fields in the query response. For example, i am trying to create an index based on the 'name' field, but i also want to return an 'id' field where these two fields are the product attributes i am search for [say movie titles]. Hence, the response should include both the 'id' and 'title' of the product

How can i do a case-insensitive search using Suggester? For example, a search term "abc" should return documents containing the name as "ABC", "Abc" etc.

Please help.

Regards.

3
Hi all, i resolved the case-sensitive suggest issue by converting everything to lower case. However, still not able to fine out a way of returning multiple fields in the response. Any suggestions will be helpful.anand tiwari
anand : bhai were you able to resolve the multiple field issue? I'm facing the same issue. Please could you share your solution. Thanks a lotnish
Hi Nish,No, Solr does not support this.anand tiwari
Thanks for the update. Any other way of doing it?nish

3 Answers

0
votes

I think you're not quite getting the point of the suggester. It is not designed to return suggestions for exactly one search result per entry (this is the only scenario where returning the ID would make sense).

You could, however, do normal wildcard searches on the title field and use the returned titles as suggestions. This way you could also get the ID (and any other index field) with the results. I imagine this could be implemented fairly easily with jQuery UI. It may be much slower than the suggest API, depending on your index schema design.

0
votes

if you are not really interested in the order of the suggestions i found that the weight_field can be [ab]used to return the document id for each suggestion

0
votes

If you're looking to get suggestions on a particular field but also return other fields in the document, you can use the 'Payload' tag. Only one payload field is allowed, but you can get around this by using a json format in the field.

https://cwiki.apache.org/confluence/display/solr/Suggester

https://stackoverflow.com/a/32558487/578582