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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JacobSingh’s picture

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

moshe weitzman’s picture

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.

pwolanin’s picture

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.

xnickmx’s picture

subscribing

moshe weitzman’s picture

Status: Active » Needs review
FileSize
705 bytes
3 KB
207 bytes

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.

pwolanin’s picture

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

moshe weitzman’s picture

Fixed problem pointed out in #4 by pwolanin.

pwolanin’s picture

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.

moshe weitzman’s picture

Project: Apache Solr Search » Voting
Version: 6.x-1.x-dev » master

@Eaton says he will maintain this in votingapi package.

moshe weitzman’s picture

Project: Voting » Voting API
moshe weitzman’s picture

Title: Sorting based on votingapi totals » Apachesolr Sorting based on votingapi totals
FileSize
724 bytes
3.72 KB

This one adds the sort using simpler API from apachesolr RC3.

Scott Reynolds’s picture

Title: Apachesolr Sorting based on votingapi totals » Apache solr and Votingapi

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

moshe weitzman’s picture

sure, sounds like a good plan, scott.

pwolanin’s picture

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.

Scott Reynolds’s picture

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.

torgosPizza’s picture

Subscribing.

This is probably more of an Apachesolr Views thing, but at the very least I'd love to allow the relationship for VotingAPI within a View, so that I can create my own views for different sorting options. I don't need facets or anything yet - but right now it's impossible to even add the relationship as a starting point. :(

YK85’s picture

subscribing

mr.andrey’s picture

subscribing

ezra-g’s picture

Adding the 'commonslove' tag per #1710714: Theme the Commons "Like" widget.

ezra-g’s picture

Issue tags: +commonslove

Actually adding the tag.

fizk’s picture

@Scott, @moshe,

I think this code could benefit from some exposure, so I created http://drupal.org/project/apachesolr_votingapi

I've given you both access to the project. I'll be updating the code as I find bugs.

alanmackenzie’s picture

Hi fizk,

Can you give me commit access as well please?

I have already ported moshe's code from #11 to D7/new apachesolr hooks.

The site I did that for is due to launch next week and my intention was to start feeding back the work I did on it to the community in the week after.

fizk’s picture

@alanmackenzie,

Thanks, I've given you git access. Please create a new branch for your work and create an issue in the issue queue when its ready for me to pull it into the 7.x-1.x branch.

rares’s picture

Looks like this materialized into this D7 module... http://drupal.org/project/apachesolr_votingapi

fizk’s picture

Status: Needs review » Fixed

Closing this issue since we have http://drupal.org/project/apachesolr_votingapi

Status: Fixed » Closed (fixed)
Issue tags: -commonslove

Automatically closed -- issue fixed for 2 weeks with no activity.

nareshbw’s picture

Issue summary: View changes

I am using Apache solr search . But I am unable to use voting api functionality on search page items.

Rakesh199111’s picture

Hi,
The ApacheSolr Voting api is not being showed along with my apache solr search results.How can i integrate it with the search results? Can anyone help out with the issue.