lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fuad Efendi <>
Subject Re: Different Sorts based on Different Groups
Date Fri, 04 Nov 2016 15:33:54 GMT
Hi Gustatec,

Relevancy tuning is really *huge* area, check this book when you have a

Default Solr sorting is based on TF/IDF algorithm; and sorting is not
necessarily ‘relevancy’

Trivial solution for clothes store domain would be this one, better to
explain using examples:

Product 1
Name: "Russell Athletic Men's Basic Tank Top"
Categories: “Shirt”, “Sleeveless Shirt”, “Tank Top”

Product 2
Name: "Russell Athletic Men's Cotton Muscle Shirt"
Categories: “Shirt”, “Sleeveless Shirt”, “Tank Top”

You may notice that first product has “Top” repeated twice in product name
and category; and second one has “Short” repeated twice.

Now having this real-life example you can play with boost query, boosting
results containing words from category name in their product name.

category:”Tank Top” & bq:”name:tank^10 OR name:top^5"

Solr provides “boost query” to tune sorting of output results, check “bq”
parameter in the docs at

I went from real-life scenario; your scenario and possible solutions could
be very different.

I had recently assignment at well-known retail shop where we even designed
pre-query custom boosts so that we can customize typical (most important
for the business) queries as per business needs



Fuad Efendi

(416) 993-2060
Search Relevancy, Recommender Systems

On November 4, 2016 at 10:57:02 AM, Gustatec ( wrote:

Hello everyone!

I'm currently using Solr in a project (pretty much an e-commerce POC) and
came across with the following sort situation:

I have two products one called Product1 and other one called Product2, both
of them belongs to the same categories, Shirt(ID 1) and Tank-Top(ID 2)

When i query for any of these categories, it returns both of the products,
in the same order.

Is it possible to do some kind of grouping sort in query? So when i query
for category Shirt, it returns first Product1 then Product2 and when i do
the same query for category Tank-Top it would return first Product2 then

By asking that i wonder if its possible to make a product more relevant,
based on the query.

So product1 relevancy would be
Category ID | Priority
1 | 1
2 | 2

And product2 would be
Category ID | Priority
1 | 2
2 | 1

Is it possible to achieve this "elevate" funcionality in query?

i thought in doing a <category_name>_sort field for all categories, but we
are actually talking about a few hundred categories, so i dont know if
be viable to create one sort field for each one of them in every single

Ps: I asks if its achievable that in query because i dont know if there is
any other way of changing the elevate.xml file without having to restart my
solr instance

Sorry for my bad english, and thanks in advance!

View this message in context:
Sent from the Solr - User mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message