Project

General

Profile

Actions

Feature #25198

open

Add rank in search result as data attribute

Added by okkez _ over 6 years ago. Updated over 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Search engine
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

I'm developing full text search plugin for Redmine1.
I want to add rank (score) to search result to check search result rank(score) easily.
(It it very hard to read debug log in real time.)
Currently I need overwrite app/views/search/index.html.erb and app/views/search/index.api.rsb completely to add rank to search result.
But I don't want to keep maintaining views in my plugin because it is very annoying to keep following upstream changes.

This tiny patch provides functionality to display rank(score) in search result.
I don't add CSS to display data-rank attribute in search result html by default.

We can display data-rank value in search result using following CSS:

#search-results dt a::after {
  content: " (" attr(data-rank) ")";
  color: gray;
  font-size: x-small;
};

1 https://github.com/okkez/redmine_full_text_search


Files

display-rank-as-data-attribute.diff (2.94 KB) display-rank-as-data-attribute.diff okkez _, 2017-02-26 09:24
fix-test.diff (10.2 KB) fix-test.diff fix test for above patch okkez _, 2017-02-26 10:13
Actions #1

Updated by Toshi MARUYAMA over 6 years ago

  • Description updated (diff)
Actions #2

Updated by Yasukazu Nagatomi over 5 years ago

+1

Actions #3

Updated by Yuuki NARA over 5 years ago

+1

Actions #4

Updated by Akipii Oga over 5 years ago

+1

Actions #5

Updated by Go MAEDA over 5 years ago

  • Target version set to Candidate for next major release
Actions

Also available in: Atom PDF