Opened 9 years ago
Closed 9 years ago
#35762 closed enhancement (fixed)
Search in post excerpt
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Query | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
I think that search should check post_excerpt field.
Attachments (4)
Change History (10)
#3
follow-up:
↓ 4
@
9 years ago
- Keywords has-unit-tests added; needs-unit-tests removed
- Milestone changed from Awaiting Review to Future Release
#4
in reply to:
↑ 3
@
9 years ago
- Keywords needs-patch needs-unit-tests added; has-patch has-unit-tests removed
Replying to swissspidy:
The previous patch was missing an additional
$like
passed to$wpdb->prepare
.
35762.diff adds that, and an accompanying test.
I like the idea of also searching the post excerpt and have implemented this on a couple of sites myself. Perhaps even 4.5 material?
We'll need to add post_excerpt
to the orderby
logic in WP_Query::parse_search_order()
. It could be lumped in with post_content
or even, I'd suggest, one step higher in the priority than post_content
.
If we get this, we'll slip it into 4.5.
#5
@
9 years ago
- Keywords has-patch has-unit-tests added; needs-patch needs-unit-tests removed
- Milestone changed from Future Release to 4.5
35762.3.diff includes the suggested fixes and additional tests for that.
Post search order is now like this:
- post title
- post excerpt
- post content
Note: See
TracTickets for help on using
tickets.
The previous patch was missing an additional
$like
passed to$wpdb->prepare
.35762.diff adds that, and an accompanying test.
I like the idea of also searching the post excerpt and have implemented this on a couple of sites myself. Perhaps even 4.5 material?