Apache solr and Votingapi
moshe weitzman - February 28, 2009 - 22:34
| Project: | Voting API |
| Version: | HEAD |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
Sort by votes DESC is a natural integration point. There is a hook that fires upon each vote. I propose that we mark the node for re-indexing at that time.

#1
Hi Moshe,
I like the idea, although I'm a little nervous about the indexing volume, especially on a digg type site. I'm concerned in part about running into a "index deficit" where you have more nodes getting updated on average per cron run than nodes indexed during the run...
Is this just worrying about nothing?
I think that the next logical step (and I'd say a more important one) is to provide a boost on the votes field. hopefully something a little more subtle and usable where we derive a "popularity index" based on # of votes AND total rating and let users boost on this.
Best,
Jacob
#2
But you have to keep the votes field reasonable up to date so the boost does not solve the indexing problem.
Perhaps we need a throttle control which says that no node may be indexed more frequently than twice and hour.
#3
I'm not sure it's going to be an issue - likely there are only a few nodes that are getting much vote traffic on any given day.
#4
subscribing
#5
OK, Here is a first stab. I have not fully tested it as testing is complicated by our many environments and single index and large content set. The parts that need testing are apachesolr_votingapi_apachesolr_update_index() and apachesolr_votingapi_apachesolr_modify_query(). All of this needs review.
#6
I don't think this will work:
$document->votingapi_result_value = $value;Is this a float or an int? You should use one of the dynamic fields - call it something like
sis_votingapi_result#7
Fixed problem pointed out in #4 by pwolanin.
#8
Moshe and I discussed in IRC - I think this would be good to add to CVS/d.o as a separate project so that he does not need to wait on our review to iterate the code.
#9
@Eaton says he will maintain this in votingapi package.
#10
#11
This one adds the sort using simpler API from apachesolr RC3.
#12
Im going to have a need for this so here is my battle plan. Moshe do you mind if I create a D.o Project for it?
Battle plans to extend this
1.) provide facet ranges like dates in Apache Solr module (1-20 votes, 20-40 votes etc...)
2.) Allow for indexing of multiple tags/content types functions
3.) Boosting on all of those
4.) Apache Solr Views support (drupal.org/project/apachesolr_views) for sort handlers
#13
sure, sounds like a good plan, scott.
#14
Look at the proposed updates here - including tie range fields http://drupal.org/node/641954
I think they are BC, so i'd like to get them in asap.
#15
After reassessing our orginal IA with actual live data, we have decided to significatlly lower the priority of this feature. I thought orginally that I was going to start on it this week but after this review we have revised our IA and this feature as become significantly lower priority.
So if anyone stumbles on this or decides they want to take it on, don't allow my claim to ownership stop you.