Ticket #5149 (closed enhancement: duplicate)

Opened 4 years ago

Last modified 3 years ago

Search everything (or almost everything)

Reported by: ryan Owned by: anonymous
Priority: normal Milestone:
Component: General Version: 2.3
Severity: normal Keywords: search
Cc:

Description

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

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

Change History

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.

comment:2   ryan4 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.

ryan4 years ago

comment:3   ryan4 years ago

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

comment:4   DD324 years ago

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

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

see #9785

Note: See TracTickets for help on using tickets.