Solr Suggester Lookup Class for Predictive Search

2019-04-09 10:49发布

问题:

I'm working on Solr 3.6 for auto suggestions. I've been referring to the Solr Suggester component (http://wiki.apache.org/solr/Suggester) for the same. But I'm unable to decide which Lookup class should I use for Suggester, moreover there isn't any good documentation provided either from which I can find the best one.

I have choose among these four Lookup Class:

JaspellLookup - tree-based representation based on Jaspell, TSTLookup - ternary tree based representation, capable of immediate data structure updates, FSTLookup - automaton based representation; slower to build, but consumes far less memory at runtime (see performance notes below). WFSTLookup - weighted automaton representation: an alternative to FSTLookup for more fine-grained ranking. Solr 3.6+

Can you please help me understand this? Or help me decide which one is suitable for my requirements?

I need to deploy a suggester similar to Amazon.com, Flipkart, NewEgg with following specific requirements:

  • Auto suggest with term completion, like when I type "xpe" the suggester should return, xperia, xperia in Electronics, xperia in PCs & Laptops (this can be suggested term in category)
  • For the same term it should also return xperia ray, xperia arc, xperia play, etc. This can be popular searches listed as per their order by popularity.
  • For more complete term "xperia u" it should return xperia u, xperia u unlocked, xperia u case, xperia u st25i, etc.
  • completing the full product name when someone writes it "xperia u", it should list xperia u android mobile phone - white, xperia u android mobile phone - black... where the suggestions are specific product name.
    • We also need to filter for parent category, so when someone select baby products as category, it would not list xperia play or xperia u for xpe. Instead it might just not provide suggestions if there is no suggestion, or provide those that are only in these categories.

Edit Just to clarify that by order by popularity I mean to list suggested terms by the number of times it is used by actual users to search, and not the one that would give more numbers of items as results.

I'm sure this can be done with this, but not sure how to do it exactly using suggester component provided in Solr and specifically which one lookup should I select to achieve this kind of suggestions. You help will be highly appreciated.