1

Suppose, I have 1000 sellers (S1.....S1000) of Apparels listed on my site. Since all the sellers are paying some amount to me, I am giving them equal weight-age, and the results are shown based on relevancy.

Now, I am planning to start with premium service, where I am thinking to list one supplier on top for each keywords in search results. Let say, S1 has been given premium search for keywords 'Jeans', so if a user searches 'jeans', I first wants to display this supplier on the top, then display other supplier based on relevancy. Plus, this premium service is for only for one month. So, another supplier say S2 can avail this service in next month and so on.

Is there any plugin, wherein I can store which supplier should be shown for which keyword. I am even OK with making 2 queries to meet the desire results.

Please suggest

Kamal Kishore
  • 325
  • 2
  • 4
  • 15

2 Answers2

0

I think the Query Elevation Component is your friend, you can configure which documents (and hence which suppliers) come first for any given query, see

https://wiki.apache.org/solr/QueryElevationComponent

If that's too much work, you could also add a new boolean field in your documents, indicating whether the document is to be promoted or not, and in the query, sort by this field first (so promoted documents come on top), and by score next (so most relevant documents come right after the promoted ones).

Yann
  • 1,019
  • 1
  • 8
  • 18
  • QueryElevation Component takes unique key of the schema as an argument for id. But, this is not so in my case. Is that possible that I can take any other field as an id for this component. – Kamal Kishore Mar 09 '15 at 07:26
  • I don't think so - the doc says the uniqueKey field must be a string. There's no field in your docs that you could use as a unique key? – Yann Mar 09 '15 at 09:41
  • There can be only one unique field in schema. This seller field in schema is not the unique field. Actually, the product ids of these sellers are the unique ids. Please any other solution. – Kamal Kishore Mar 09 '15 at 11:36
  • How about the other one I suggested: add a new boolean field in your documents, indicating whether the document is to be promoted or not, and in the query, sort by this field first (so promoted documents come on top), and by score next (so most relevant documents come right after the promoted ones). – Yann Mar 09 '15 at 12:54
  • I need to do this dynamically. This premium service is only for 1500 or 2000 sellers out of 5,000,000 sellers. So, creating a field for few sellers only will not be ideal for us. – Kamal Kishore Mar 12 '15 at 03:38
  • 1
    I mean add a single boolean field to every document; the boolean is true for products from promoted sellers, and false otherwise. As sellers become promoted or not, you update the index; it would be fairly straightforward to do. – Yann Mar 12 '15 at 09:05
0

You can maybe also use the reRanking Componant :

https://cwiki.apache.org/confluence/display/solr/Query+Re-Ranking

With using a query like this :

q=jean&rq={!rerank reRankQuery=$rqq reRankDocs=1000 reRankWeight=3}&rqq=(brand:S1)

The top 1000 of results from query jean will be re-ranking thanks to the boost (of 3) add to the documents which contain the field brand with the value S1.

It can be useful, but in your case I think the QueryElevationComponent is the best.

Be careful, reRanking is only available since version 4.9.

alexf
  • 1,303
  • 9
  • 20