WordPress.org

Make WordPress Core

Opened 2 months ago

Last modified 4 days ago

#41862 new defect (bug)

"Attach to Existing Content" popup search box pulling up records that don't match search query

Reported by: subrataemfluence Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.8.1
Component: Query Keywords: close
Focuses: administration Cc:

Description

I am not very sure whether this is really a bug in WordPress core but today I encountered it accidentally.

I was Attach-ing an image from media library to an existing post. I typed in a search query (10 thing) in the search box and hit submit. Multiple records came up, while I was expecting only one which has the phrase in its title and content body. None of the other posts which appear along with, is associated with the search phrase. I checked title, body, and meta values for this post.

But when I searched with 10 things (added an "s"), I got the desired result, i.e. only a single post.

I have no third party plugin installed in my system. It is a clean install and everything is up to date.

Attachments (1)

search-result.jpg (40.5 KB) - added by subrataemfluence 2 months ago.

Download all attachments as: .zip

Change History (3)

#1 @SergeyBiryukov
2 months ago

  • Component changed from Posts, Post Types to Query
  • Keywords close added

It's likely that the found posts contain thing somewhere in content.

The search is supposed to return all the relevant results, not just strict matches, see #7394 for details. I don't see anything wrong here at a glance.

#2 @aubreypwd
4 days ago

Found that even though one of the posts had "thing" in the content, searching for "10 thing" did not yield the "This has the word th#ing in the content." I suspect it was actually the "10" keyword bringing up those other results.

http://aubrey.pw/d/2017/vwM2aZxBzd.png

http://aubrey.pw/d/2017/9fYSkyYwpi.png

http://aubrey.pw/d/2017/5r4Kr9oUwN.png

Note: See TracTickets for help on using tickets.