Edgewall Software
Modify

Opened 13 years ago

Last modified 5 years ago

#10372 new enhancement

Search in wiki should prioritize title matches and whole word matches above partial word matches

Reported by: oleg@… Owned by:
Priority: normal Milestone: next-major-releases
Component: search system Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I am searching for "tea" in my wiki. I have a page whose title is "TeaNotes", whose contents is a list of my notes for various teas where the word "tea" appears on every single line that is not a heading (13 total occurrences).

I get 6 pages of results for "tea". This wiki page appears on page 5 of 6 of search results. Right above it are completely irrelevant pages including the word "instead" (which includes "tea") with the "tea" part of it highlighted.

When results are shown from wiki pages, the order of them should be:

  1. Whole words matched in title
  2. Whole words matched in text
  3. Partial words matched in title
  4. Partial words matched in text

The order of 2 and 3 may be switched, or maybe they should be a single bracket, but any way this is done would be an improvement over the current situation.

This particular case with tea illustrates the problem of finding stuff in the wiki very clearly, but the lack of a sensible ordering of results is a problem whenever I try to find stuff in the wiki in just about any trac installation I'm using.

TitleIndex is pretty much the only way to search for things in the wiki if you have an idea of the page title (or know that you're searching for something which appears in the title).

Attachments (0)

Change History (2)

comment:1 by Christian Boos, 12 years ago

Component: wiki systemsearch system
Milestone: next-major-0.1X

Giving more weight to matches in the title was indeed what SearchRefactoring proposed (and what the old branch did).

And in the meantime, you can use a report:

-- ## 3: Search for wiki pages ## --

-- Fill in the **`PAGE`** parameter in the form at the right side.
-- 
-- You can use % as a wildcard character.


SELECT DISTINCT 'wiki' as _realm, name as id, 
   max(version) as version, group_concat(distinct author) as authors
 FROM wiki 
WHERE name LIKE $PAGE 
GROUP BY id

(leave out the authors columns if you're not using SQlite - or replace by the corresponding aggregate function of your db)

comment:2 by Ryan J Ollos, 5 years ago

Similar changes suggested in pull request 11.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.