Last modified: 2012-04-12 18:03:31 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T23995, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 21995 - Request that reader feedback have ratings (specificly the averages) available via API
Request that reader feedback have ratings (specificly the averages) available...
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
ReaderFeedback (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-01-02 11:05 UTC by Bawolff (Brian Wolff)
Modified: 2012-04-12 18:03 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
patch to add prop=rating to query props for API (4.46 KB, patch)
2010-01-02 11:05 UTC, Bawolff (Brian Wolff)
Details

Description Bawolff (Brian Wolff) 2010-01-02 11:05:21 UTC
Created attachment 6919 [details]
patch to add prop=rating to query props for API

Hi. I would find it useful to be able to access ReaderFeedback data from the api, specifically the rating averages.

I made a patch to do that.

It adds rating as a value for prop when using action=query

Cheers,
Bawolff
Comment 1 Roan Kattouw 2010-01-02 12:04:16 UTC
Patch looks OK, but from looking at it I think the DB query in the API module is less efficient than the one in getAverageRating(). I'll run an EXPLAIN on it later to see how bad it is.
Comment 2 Bawolff (Brian Wolff) 2010-01-25 15:03:22 UTC
Runing explain on a test mediawiki db that has almost no data in it, i get (hopefully i got this query right):

mysql> describe SELECT SUM(rfh_total)/SUM(rfh_count) as avg, SUM(rfh_count) as count, rfh_tag, rfh_page_id from reader_feedback_history where rfh_page_id = 1 and rfh_date > 200 GROUP BY rfh_page_id, rfh_tag\G
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: reader_feedback_history
         type: ref
possible_keys: PRIMARY
          key: PRIMARY
      key_len: 4
          ref: const
         rows: 6
        Extra: Using where
1 row in set (0.00 sec)


(Not sure if thats useful or not). As far as i can tell, with exception to the group by clause (in order to make it one query instead of 4), the query is the same as the one in getAverageRating
Comment 3 Roan Kattouw 2010-01-25 15:47:27 UTC
I'm mostly worried about the case where $pageids contains multiple page IDs and the WHERE clause will look like WHERE rfh_page_id IN (1,2,3) AND rfh_date > 200
Comment 4 Bawolff (Brian Wolff) 2010-01-25 18:19:13 UTC
That case definitly would happen - api.php?action=query&generator=allpages&prop=rating&gaplimit=max would have 500 items in $pageids.

Note, the specific use case on wikinews that i want this feature for would only deal with one article at a time. If the patch was re-written as a api.php?action=Readerfeedback&title=foo with title only being allowed to have a single page, would that be more acceptable efficiency wise?
Comment 5 Roan Kattouw 2010-01-25 18:54:15 UTC
(In reply to comment #4)
> That case definitly would happen -
> api.php?action=query&generator=allpages&prop=rating&gaplimit=max would have 500
> items in $pageids.
> 
> Note, the specific use case on wikinews that i want this feature for would only
> deal with one article at a time. If the patch was re-written as a
> api.php?action=Readerfeedback&title=foo with title only being allowed to have a
> single page, would that be more acceptable efficiency wise?

Absolutely.
Comment 6 Aaron Schulz 2012-04-12 18:03:31 UTC
This extension is obsoleted by ArticleFeedback.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links