[wp-trac] [WordPress Trac] #7394: Search: order results by relevance
WordPress Trac
noreply at wordpress.org
Tue Sep 24 19:50:58 UTC 2013
#7394: Search: order results by relevance
-------------------------------------------------+-------------------------
Reporter: markjaquith | Owner:
Type: enhancement | Status: assigned
Priority: normal | Milestone: 3.7
Component: General | Version: 2.6
Severity: normal | Resolution:
Keywords: has-patch needs-testing 3.7-early |
needs-refresh |
-------------------------------------------------+-------------------------
Comment (by azaozz):
Replying to [comment:55 nacin]:
> This patch needs a refresh. On two fronts:
> * The way it integrates into WP_Query is quite messy. We should try to
keep this constrained to its own method (or multiple methods).
Was even thinking it can be handled only with filters, even the part that
is currently inline in query.php. Also, the current code reuses the
`foreach ( $q['search_terms'] as $term )` loop in `parse_search()` which
is not necessary, we can loop through the terms again when building the
ORDER BY part. That will keep the two parts independent.
> * We should consider dropping stopword support. Yes, it can cause the
query to grow more complicated, but it's also in no way truly localizable.
This is way too much of a burden on translators, and even in English, it's
fraught with issues. It would be *far* easier to implement such a major
change if we avoided stopwords entirely for now.
Stopwords are an integral part of all searching. Using them not only
produces better results, it also improves performance, quite a bit in some
cases. There's no point in using search terms that will match all table
rows, and using them several times makes it slower.
For example, currently searching for "about the about" will select all
table rows three times and make the results irrelevant. With stopwords it
will only search for the whole string making it (much) faster and
relevant.
It's a good point that adding stopwords may not be that easy for
translators. However doing a simple web search for "stopwords" brings lots
of examples for all languages, so thinking they will be able to do it. Of
course we can add better explanation, both in a comment in that function
and on http://make.wordpress.org/polyglots/.
Also can disable (return empty string) the stopwords if they haven't been
translated, although if the default English stopwords are used in another
language, it won't affect searching much.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/7394#comment:61>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list