Make WordPress Core

Opened 16 years ago

Closed 14 years ago

#5149 closed enhancement (duplicate)

Search everything (or almost everything)

Reported by: ryan's profile ryan Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.3
Component: General Keywords: search
Focuses: Cc:


Extend search to include pages and other things. The more comprehensive the better, limited only by performance considerations. Care will need to be taken when including pages in the search results since themes that display full post content may break. Putting a filter that strips tags from page content returned in search results would suffice. The search should be as hookable as possible to allow customization via plugin.

Possible things to search on:

  • Post title, content, excerpt, author, tags, categories
  • Page title, content, excerpt, author, tags, categories
  • Comment content, author
  • Post/page meta fields

Features that would be nice to have:

  • Order search by relevance
  • Excerpt relevant areas of content, search engine style

Relevant discussions:

Attachments (1)

search_pages.diff (1.8 KB) - added by ryan 16 years ago.

Download all attachments as: .zip

Change History (7)

#1 @westi
16 years ago

Should we not introduce a new search loop with search result specific template tags and then the related in memory storage of search results is just a collection of objects|arrays that each represent a search result.

These could have the following properties (all exposed as new template tags):

  • Content / Excerpt
  • Title
  • Type of content: Post|Page|Comment etc.
  • ...

For Backward compatibility a normal post_loop on a search results page would only display posts.

#2 @ryan
16 years ago

We'd have to run two searches then, which seems a waste. I'd like to keep it at one search query.

As for comments, should we directly include them in the search results or just the posts they are associated with?

Anyhow, here's a quick patch that extends search to pages. There's no backward-compat filtering done on them yet.

16 years ago

#3 @ryan
16 years ago

(In [6467]) Throw pages into search queries. Let's see how they handle. see #5149

#4 @DD32
16 years ago

Also: #1435 - Pages should be searched: "Include 'static' pages in search results"

#5 @ffemtcj
16 years ago

  • Milestone changed from 2.5 to 2.6

#6 @Denis-de-Bernardy
14 years ago

  • Milestone 2.9 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

see #9785

Note: See TracTickets for help on using tickets.