Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
370 views
in Technique[技术] by (71.8m points)

full text search - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...