You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by "O. Olson" <ol...@yahoo.it> on 2014/09/22 20:12:03 UTC

Solr Boosting Unique Values

I use Solr to index some products that have an ImageUrl field. Obviously some
of the images are duplicates. I would like to boost the rankings of products
that have unique images (i.e. more specifically, unique ImageUrl field
values, because I don't deal with the image binary). 

By this I mean, if a certain product has a value in the ImageUrl not used by
any other product, it would be boosted more than another product which has a
value in the ImageUrl used by 3 other products. 

I hope I have explained that correctly. If not, please ask and I would try
again. 

For e.g. if I want to boost the products with quantity, I can add 

&bf=log(qty) 

to the request. Is there some similar function I can add to the ImageUrl
field to boost unique values?

Thank you in advance,
O. O.




--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-Boosting-Unique-Values-tp4160507.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr Boosting Unique Values

Posted by rulinma <ru...@gmail.com>.
ok.



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-Boosting-Unique-Values-tp4160507p4161627.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr Boosting Unique Values

Posted by Chris Hostetter <ho...@fucit.org>.
: My current setup does not use the ImageUrl field for the search (more
: specifically as the default search field). The ImageUrl field contains a URL
: to the image which is for most part a GUID, which is meaningless to users.
: However, I would like to note that the ImageUrl field is Indexed and Stored. 
: 
: I'm curious how should I use tf() for the boost. On the face of it, it seems
	...

the tf() function tells you the frequency of a given *term* in each 
document ... for the context you have described -- boosting documents 
based on the "uniqueness" of whatever single term they have indexed -- 
tf() isn't going to be that useful to you.

if however the "uniqueness" factor you are describing is ultimately due to 
the fact that some products have their own images, while many other 
products get a "default" image, and you know exactly what that default 
image URL is -- then the tf() function (or more generally: the 
termfreq() function) could help you, by telling you if/when a documen has 
that specific image.  If this is the case however, then ideally you should 
just index a boolean field "hasDistinctImage".

: image URLs are not part of the search terms. tf() seems to be what I am
: looking for, if I can get the current ImageUrl field value into the
: function.

I don't think there is anyway to do that.



-Hoss
http://www.lucidworks.com/

Re: Solr Boosting Unique Values

Posted by "O. Olson" <ol...@yahoo.it>.
Thank you Erick for your prompt response. I'm sorry I could not get back to
you earlier. 

My current setup does not use the ImageUrl field for the search (more
specifically as the default search field). The ImageUrl field contains a URL
to the image which is for most part a GUID, which is meaningless to users.
However, I would like to note that the ImageUrl field is Indexed and Stored. 

I'm curious how should I use tf() for the boost. On the face of it, it seems
to be what I want, but I cannot figure out how to use it. Similar to my
example in my original post: 

&bf=log(qty)

I cannot do: 
&bf=tf(ImageUrl,field(ImageUrl))

I think it is having a problem with field(ImageUrl). If I replace it with
something static like ' http://domain/pathtoimage.jpg' then it works.
However, I would like it to have the value of the ImageUrl field instead of
this static value. 

As I mentioned in my original post, I would like to boost unique images. The
image URLs are not part of the search terms. tf() seems to be what I am
looking for, if I can get the current ImageUrl field value into the
function.

Thanks again,
O. O.



Erick Erickson wrote
> This should be happening automatically by the tf/idf
> calculations, which weighs terms that are rare in the
> index more heavily than ones that are more common.
> 
> That said, at very low numbers this may be invisibly,
> I'm not sure the relevance calculations for 3 as opposed
> to 1 are very consequential.
> 
> However, you _do_ have access to the tf in the Function Queries,
> see: https://cwiki.apache.org/confluence/display/solr/Function+Queries
> 
> You could manipulate the scores of your docs by getting
> creative with these I think for your particular case.
> 
> Best,
> Erick





--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-Boosting-Unique-Values-tp4160507p4160736.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr Boosting Unique Values

Posted by Erick Erickson <er...@gmail.com>.
This should be happening automatically by the tf/idf
calculations, which weighs terms that are rare in the
index more heavily than ones that are more common.

That said, at very low numbers this may be invisibly,
I'm not sure the relevance calculations for 3 as opposed
to 1 are very consequential.

However, you _do_ have access to the tf in the Function Queries,
see: https://cwiki.apache.org/confluence/display/solr/Function+Queries

You could manipulate the scores of your docs by getting
creative with these I think for your particular case.

Best,
Erick

On Mon, Sep 22, 2014 at 11:12 AM, O. Olson <ol...@yahoo.it> wrote:
> I use Solr to index some products that have an ImageUrl field. Obviously some
> of the images are duplicates. I would like to boost the rankings of products
> that have unique images (i.e. more specifically, unique ImageUrl field
> values, because I don't deal with the image binary).
>
> By this I mean, if a certain product has a value in the ImageUrl not used by
> any other product, it would be boosted more than another product which has a
> value in the ImageUrl used by 3 other products.
>
> I hope I have explained that correctly. If not, please ask and I would try
> again.
>
> For e.g. if I want to boost the products with quantity, I can add
>
> &bf=log(qty)
>
> to the request. Is there some similar function I can add to the ImageUrl
> field to boost unique values?
>
> Thank you in advance,
> O. O.
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Solr-Boosting-Unique-Values-tp4160507.html
> Sent from the Solr - User mailing list archive at Nabble.com.