Make WordPress Core

Opened 7 years ago

Closed 5 years ago

#39761 closed defect (bug) (duplicate)

Buggy sort of search results

Reported by: gargo's profile Gargo Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Query Keywords:
Focuses: Cc:

Description

Example:
http://gargo.of.by/?s=map

In my opinion the search results should be sorted by date (preferred for me) or by relevancy. But it seems wordpress takes the search results and mixes them unpredictably

Change History (4)

#1 @SergeyBiryukov
7 years ago

  • Component changed from Date/Time to Query

Hi @Gargo, welcome to Trac! Thanks for the report.

Search results are actually ordered by relevance. The ordering logic is as follows:

  • Full sentence matches in post titles.
  • All search terms in post titles.
  • Any search terms in post titles.
  • Full sentence matches in post content.

Each section and any remaining posts are then sorted by date.

There are also some filters for advanced customization:

  • wp_search_stopwords, to filter stop words ignored in WHERE.
  • posts_search_orderby, to filter the ORDER BY when ordering search results.

See [25632] and the discussion in #7394.

Last edited 7 years ago by SergeyBiryukov (previous) (diff)

#2 follow-up: @SergeyBiryukov
7 years ago

It looks like you have Search Everything, Search in Place, and perhaps some other plugins installed, which might affect search results.

If you'd like to report an issue with WordPress core, please check if it still happens with all plugins disabled and a default theme (Twenty Seventeen or Twenty Sixteen) activated.

If you'd like to report an issue with a plugin, please use the plugin support forum for that.

#3 in reply to: ↑ 2 @Gargo
7 years ago

Replying to SergeyBiryukov:

It looks like you have Search Everything, Search in Place, and perhaps some other plugins installed, which might affect search results.

If you'd like to report an issue with WordPress core, please check if it still happens with all plugins disabled and a default theme (Twenty Seventeen or Twenty Sixteen) activated.

If you'd like to report an issue with a plugin, please use the plugin support forum for that.

Thanks for fast answer but all the installed plugins doesn't have influence on this behaviour - I installed them later and hoped to fix the sort order with them

#4 @earnjam
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version 4.7.2 deleted

Duplicate of #34463

Also the link in the original description no longer works.

Note: See TracTickets for help on using tickets.