[wp-hackers] Page searching examples [was: 2.4 planning discussion]

Ryan Boren ryan at boren.nu
Sat Sep 29 05:33:33 GMT 2007


On 9/27/07, Daniel Cameron <dan at scatter3d.com> wrote:
> I've been waiting for this conversation since I started following the list.
>
> > "see what people expect"
>
> The majority of people expect for pages to show up in their results and a
> large majority of them want more options. My original release for SE was
> very basic, option to include pages and an option to include comments. I
> never liked searching comments (since the queries would take too long) but I
> added it because that's what people wanted. Now, I'm not advocating that we
> "bloat" the core with a ton of options but if we were to allow for searching
> of pages it should be an option. And if it's an option we might as well add
> some more functionality/options to give the masses what they want or at
> least fill up the new search options page :) .
>
> > see what plugins are doing
>
> Currently SE has category exclusion, post and page id exclusion and the
> searching of excerpts, comments, excerpts, drafts, attachments, meta data
> (this is huge for a lot of users) and tags (broken in 2.3). All of these
> options, except tags and drafts, have been strongly expressed by the
> community as "necessary" options, especially those who use Wordpress as a
> CMS for development.

Pages should definitely be in search.  There are back-compat problems
with mixing pages and posts in the search results, however, which is
what most if not all search plugins do.  Some themes display the
entire post content in searches.  Pages with forms and other stuff in
them will make search results look screwy.  I think we'll need to add
a means for themes to signal they are compatible with mixed search
results.  Perhaps something like set_theme_capability('full_search',
true) that can be called from the theme's functions.php.  If the
capability is not true, we either exclude non-posts from the search
results or filter the content of non-posts in the results.

As for what all should be searched by default, posts and pages are
definitely in.  Perhaps comments and meta too.  Sites with a huge
number of comments could get bogged down, however.  I think  a good
starting point for a patch in core would include posts and pages and
make it easy to plug other things in.

Ryan


More information about the wp-hackers mailing list