Solr sorting and relevance

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Solr sorting and relevance

scallawa
We are using solr for search on our ecommerce site that primarily sells clothing.  We index search terms based on a title field and description field.  

We want to be able to sort by most relevant and what we have more inventory (there is a field for that).  We have done some coding outside of Solr to try and achieve this but it causes the following problem.

Let's take jeans and boots as an example.  A customer might search on boots and solr returns a bunch of boots and jeans.  The jeans are included because the description might contain some data like pant legs fits easily over boots.  Now if we have more inventory in the particular jeans than the boots solr returned, the user will get back a list that shows mostly jeans at top and then somewhere down the list boots will show up.  

There isn't a problem with the jeans showing up but the boots should actually be displayed first with the ones having the most inventory then the jeans can be somewhere at the bottom of the list.

I want to eliminate the hacks that have been done to try to incorporate inventory, i.e. have solr return the results and not manipulate it in code.

I hope I have explained the problem enough for you to get the gist of what I am trying to accomplish.

Reply | Threaded
Open this post in threaded view
|

Re: Solr sorting and relevance

Joel Bernstein
It sounds like you might be able to get the mix you want with three
different boosts:

1) High boost on title
2) Lower boost on description
3) Function query boost on inventory

The high boost on title will help push products with matches in the title
to the top. The function query boost on inventory will help move higher
inventory to the top. You can also use the QueryElevationComponent to move
specific docs to the top for specific queries but this might not be
effective for your use case.

There is also a patch (SOLR-4465) which is experimental at this point but
is designed for people to move custom sort algorithms into Solr through
custom collectors. This is an advanced approach and would take a strong
understanding Lucene collectors.




On Wed, Mar 27, 2013 at 9:02 PM, scallawa <[hidden email]> wrote:

> We are using solr for search on our ecommerce site that primarily sells
> clothing.  We index search terms based on a title field and description
> field.
>
> We want to be able to sort by most relevant and what we have more inventory
> (there is a field for that).  We have done some coding outside of Solr to
> try and achieve this but it causes the following problem.
>
> Let's take jeans and boots as an example.  A customer might search on boots
> and solr returns a bunch of boots and jeans.  The jeans are included
> because
> the description might contain some data like pant legs fits easily over
> boots.  Now if we have more inventory in the particular jeans than the
> boots
> solr returned, the user will get back a list that shows mostly jeans at top
> and then somewhere down the list boots will show up.
>
> There isn't a problem with the jeans showing up but the boots should
> actually be displayed first with the ones having the most inventory then
> the
> jeans can be somewhere at the bottom of the list.
>
> I want to eliminate the hacks that have been done to try to incorporate
> inventory, i.e. have solr return the results and not manipulate it in code.
>
> I hope I have explained the problem enough for you to get the gist of what
> I
> am trying to accomplish.
>
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Solr-sorting-and-relevance-tp4051918.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



--
Joel Bernstein
Professional Services LucidWorks
Reply | Threaded
Open this post in threaded view
|

Re: Solr sorting and relevance

scallawa
Thanks for the fast response.  I am still just learning solr so please bear with me.  

This still sounds like the wrong products would appear at the top if they have more inventory unless I am misunderstanding.  High boost low boost seems to make sense to me.  That alone would return the more relevant items at the top but once we do a query boost on inventory, wouldn't jeans (using the aforementioned example) with more inventory that boots appear at top.
Reply | Threaded
Open this post in threaded view
|

Re: Solr sorting and relevance

Joel Bernstein
If you had a high boost on the title with a moderate boost on the inventory
it sounds like you'd get boots first ordered by inventory followed by jeans
ordered by inventory. Because the heavy title boost would move the boots to
the top. You can play with the boost factors to try and get the mix you're
looking for.


On Thu, Mar 28, 2013 at 1:20 PM, scallawa <[hidden email]> wrote:

> Thanks for the fast response.  I am still just learning solr so please bear
> with me.
>
> This still sounds like the wrong products would appear at the top if they
> have more inventory unless I am misunderstanding.  High boost low boost
> seems to make sense to me.  That alone would return the more relevant items
> at the top but once we do a query boost on inventory, wouldn't jeans (using
> the aforementioned example) with more inventory that boots appear at top.
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Solr-sorting-and-relevance-tp4051918p4052122.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



--
Joel Bernstein
Professional Services LucidWorks
Reply | Threaded
Open this post in threaded view
|

Re: Solr sorting and relevance

Otis Gospodnetić
Hi,

But can you ever get this universally right?
In some cases there is very little inventory and in some case there is
a ton of inventory, so even if you use a small boost for inventory,
when the intentory is very large, that will overpower the title boost,
no?

Otis
--
Solr & ElasticSearch Support
http://sematext.com/





On Thu, Mar 28, 2013 at 2:27 PM, Joel Bernstein <[hidden email]> wrote:

> If you had a high boost on the title with a moderate boost on the inventory
> it sounds like you'd get boots first ordered by inventory followed by jeans
> ordered by inventory. Because the heavy title boost would move the boots to
> the top. You can play with the boost factors to try and get the mix you're
> looking for.
>
>
> On Thu, Mar 28, 2013 at 1:20 PM, scallawa <[hidden email]> wrote:
>
>> Thanks for the fast response.  I am still just learning solr so please bear
>> with me.
>>
>> This still sounds like the wrong products would appear at the top if they
>> have more inventory unless I am misunderstanding.  High boost low boost
>> seems to make sense to me.  That alone would return the more relevant items
>> at the top but once we do a query boost on inventory, wouldn't jeans (using
>> the aforementioned example) with more inventory that boots appear at top.
>>
>>
>>
>> --
>> View this message in context:
>> http://lucene.472066.n3.nabble.com/Solr-sorting-and-relevance-tp4051918p4052122.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>
>
>
> --
> Joel Bernstein
> Professional Services LucidWorks
Reply | Threaded
Open this post in threaded view
|

Re: Solr sorting and relevance

Joel Bernstein
Otis brings up a good point. Possibly you could put logic in your function
query to account for this. But it may be that you can't achieve the mix
you're looking for without taking direct control.

That is the main reason that SOLR-4465 was put out there, for cases where
direct control is needed. I have to reiterate that SOLR-4465 is
experimental at this point and subject to change.



On Thu, Mar 28, 2013 at 3:00 PM, Otis Gospodnetic <
[hidden email]> wrote:

> Hi,
>
> But can you ever get this universally right?
> In some cases there is very little inventory and in some case there is
> a ton of inventory, so even if you use a small boost for inventory,
> when the intentory is very large, that will overpower the title boost,
> no?
>
> Otis
> --
> Solr & ElasticSearch Support
> http://sematext.com/
>
>
>
>
>
> On Thu, Mar 28, 2013 at 2:27 PM, Joel Bernstein <[hidden email]>
> wrote:
> > If you had a high boost on the title with a moderate boost on the
> inventory
> > it sounds like you'd get boots first ordered by inventory followed by
> jeans
> > ordered by inventory. Because the heavy title boost would move the boots
> to
> > the top. You can play with the boost factors to try and get the mix
> you're
> > looking for.
> >
> >
> > On Thu, Mar 28, 2013 at 1:20 PM, scallawa <[hidden email]> wrote:
> >
> >> Thanks for the fast response.  I am still just learning solr so please
> bear
> >> with me.
> >>
> >> This still sounds like the wrong products would appear at the top if
> they
> >> have more inventory unless I am misunderstanding.  High boost low boost
> >> seems to make sense to me.  That alone would return the more relevant
> items
> >> at the top but once we do a query boost on inventory, wouldn't jeans
> (using
> >> the aforementioned example) with more inventory that boots appear at
> top.
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://lucene.472066.n3.nabble.com/Solr-sorting-and-relevance-tp4051918p4052122.html
> >> Sent from the Solr - User mailing list archive at Nabble.com.
> >>
> >
> >
> >
> > --
> > Joel Bernstein
> > Professional Services LucidWorks
>



--
Joel Bernstein
Professional Services LucidWorks