Opened 5 months ago
Closed 4 months ago
#7814 closed defect (bug) (fixed)
Photo Directory: Tags are not used in search results
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Photo Directory | Keywords: | has-patch |
Cc: |
Description
The search results should be including tags in the fields searched, but that doesn't appear to be working.
For example, searching for "afterglow" should return any of these photos, as they're all tagged "afterglow", but it returns an empty result.
Attachments (1)
Change History (9)
#2
@
4 months ago
@coffee2code The search customizations aren't used on production because it uses Jetpack Search (ElasticSearch), is that expected? Is there code somewhere controlling the ElasticSearch or sync process? I imagine that the tags are not synced(?), so that's why it's not returning anything for this query.
This also affects #7815.
#4
@
4 months ago
@ryelle The use of Jetpack Search on the site is not explicit (as in I didn't directly enable it or account for it). As such, there is no site-specific code to customize its behavior. I'm not familiar with Jetpack Search so offhand I'm not sure what needs to be done to it or why it doesn't pick up properly registered custom taxonomies.
But indeed, I've confirmed the searches you cited fail to return results on dotorg/sandbox even after applying your necessary patches, though directly executing the MySQL queries, or running the site locally, returns expected results.
#5
@
4 months ago
If it's not intended, and in fact is not working correctly, it should probably be disabled. It can be disabled from the UI but I wouldn't trust it to not re-enable, I've had some experiences like that. The search handling can be simply turned off with a filter:
add_filter( 'jetpack_search_should_handle_query', '__return_false' );
Which can be removed later if the sync & ElasticSearch queries are configured.
#7
@
4 months ago
@coffee2code I've committed that filter disabling ElasticSearch, because the new design makes these combined queries (#7815) easy to do. If that works, both tickets can be closed. If that should just be a temporary workaround, the tickets can stay open as tasks to make work with ElasticSearch. What do you think?
In my local testing, it seemed to be the change in [12543] which flipped the "LIKE" to "REGEXP", so the
tag_where_for_search
function wasn't inserting the where clause.7814.diff fixed the issue locally, but when I tried applying it to my sandbox it didn't have any effect, so I'm not sure if something else is going on, or if there's a caching layer I didn't catch.