When I search drupal.org's Issues, the resulting table of results includes a relevancy score in the far-right column, that often shows a rounding-error, eg. 27.13999999999. This has a knock-on effect with the formatting of the rest of the table. It would make sense to round this value to 2 decimal places.

CommentFileSizeAuthor
#8 2324023-search_api_relevance-float.patch899 bytesdrumm

Comments

dcam’s picture

Project: Drupal core » Drupal.org site moderators
Version: 7.31 »
Component: other » Broken link

Reports of this nature belong in the Drupal.org webmasters issue queue.

dcam’s picture

Component: Broken link » Other
iantresman’s picture

Thanks for that. Where do I find the "Drupal.org webmasters issue queue"?

dcam’s picture

I already moved it to that queue. See comment #1 where I changed the Project. You can click the Issues link just above the node title to see the queue.

It may also belong in the Drupal.org infrastructure queue. It's not clear which would be more appropriate.

iantresman’s picture

Thank you, and sorry that I didn't notice.

lizzjoy’s picture

Project: Drupal.org site moderators » Drupal.org customizations
Version: » 7.x-3.x-dev
Component: Other » Code

Moving to customizations.

drumm’s picture

Title: drupal.org Issue search score has rounding error » Score should be rounded
Project: Drupal.org customizations » Search API Database Search
Version: 7.x-3.x-dev » 7.x-1.x-dev

This column is search_api_relevance. I'm not sure if this belongs in Search API Database specifically, or Search API.

These aren't really rounding errors, that's how floating point calculations work on computers, and I don't see us changing that.

We should round the numbers to display nicely.

drumm’s picture

Title: Score should be rounded » Score should be able to be rounded
Project: Search API Database Search » Search API
Component: Code » Views integration
Assigned: Unassigned » drumm
Category: Bug report » Task
Status: Active » Needs review
Issue tags: +affects drupal.org
StatusFileSize
new899 bytes

Thanks to a tip in #3035716: Issue search score formatting improvement, I found that the Views handler needs to know the field is a float, and will handle the rounding options.

drunken monkey’s picture

Status: Needs review » Fixed

Makes sense, thanks!
Committed.

  • drunken monkey committed 8954679 on 7.x-1.x authored by drumm
    Issue #2324023 by drumm, drunken monkey: Changed Views field definition...

Status: Fixed » Closed (fixed)

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