WordPress.org

Making WordPress.org

Opened 4 years ago

Closed 4 years ago

#1516 closed enhancement (fixed)

Order search results by title relevance

Reported by: keesiemeijer Owned by: coffee2code
Milestone: Priority: normal
Component: Developer Hub Keywords: has-patch has-screenshots
Cc:

Description

The search results should be ordered by title first. As it is now you get a mixed bag of content and title matches.
If it's ordered by title you get more specific results similar to the search query.

See the screenshots for "get posts"

Attachments (5)

1516.patch (1000 bytes) - added by keesiemeijer 4 years ago.
Set orderby for searches with pre_get_posts to 'search_orderby_title'
normal-orderby.png (208.9 KB) - added by keesiemeijer 4 years ago.
Order as it's now
orderby-title.png (215.5 KB) - added by keesiemeijer 4 years ago.
Search results ordered by title
1516.1.patch (4.3 KB) - added by keesiemeijer 4 years ago.
Order with shortest matches first
1516.1.png (222.4 KB) - added by keesiemeijer 4 years ago.
Search results for 1516.1 patch showing shortest match first

Download all attachments as: .zip

Change History (8)

@keesiemeijer
4 years ago

Set orderby for searches with pre_get_posts to 'search_orderby_title'

@keesiemeijer
4 years ago

Order as it's now

@keesiemeijer
4 years ago

Search results ordered by title

#1 @coffee2code
4 years ago

  • Owner set to coffee2code
  • Resolution set to fixed
  • Status changed from new to closed

In 2781:

developer.wordpress.org: Order search results by title relevance.

Props keesiemeijer.
Fixes #1516.

#2 @keesiemeijer
4 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

To get even more relevant results the order should be to show the shortest full matches first. To get the same results for sentence matches a condition with spaces converted to underscores should be added in the posts_orderby clause.

Last edited 4 years ago by keesiemeijer (previous) (diff)

@keesiemeijer
4 years ago

Order with shortest matches first

@keesiemeijer
4 years ago

Search results for 1516.1 patch showing shortest match first

#3 @coffee2code
4 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 2938:

developer.wordpress.org: Improve ordering of search results by title relevance.

  • Show shortest full matches first.
  • Convert spaces to underscores when doing title searches for short phrases.

Props keesiemeijer.
Fixes #1516.

Note: See TracTickets for help on using tickets.