Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Solr boost results on number of social "likes"?

I am trying to order the results based on the number of "likes".

The most obvious solution is to have a "likes" field for each row and re-index the document for every user who clicks "like". But re-indexing large documents isnt practical in this case.


(following is for the sake of example: no large documents involved)

Ideally, I would like to index both the data and the user actions in Solr as separate rows.

The data rows (as shown below) are relatively stable over time.

id:place_1 
title: ela restaurant
meta: sea food, chinese food festival
description: this place...

The action rows are inserted each time the user clicks "like".

id:action_43141
action:like
user:john
target:place_1

id:action_44323
action:like
user:doe
target:place_1

How can I boost a result based on the number of likes, given that each like exist on it's own row?


I know there exist joins in the upcoming Solr 4.0 http://wiki.apache.org/solr/Join . But would it improve scores based on number of matching rows?

like image 732
Jesvin Jose Avatar asked Dec 07 '11 07:12

Jesvin Jose


2 Answers

Take a look at ExternalFileField. There isn't a lot of documentation about it at the moment, but see this presentation.

like image 177
Mauricio Scheffer Avatar answered Oct 21 '22 14:10

Mauricio Scheffer


Also take a look at click-through relevance ranking presentation

like image 2
Monis Avatar answered Oct 21 '22 14:10

Monis