Searching for content items by taxonomy term display text #17217
Unanswered
rjpowers10
asked this question in
Q&A
Replies: 1 comment
-
The alternative would be to keep the index documents separate and somehow alter the query to look for both the book content item directly and then also by way of the author's display text. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Say I have
Is there a way I can execute a search for "John Smith" and return all books that are pointing at that term?
My analysis so far:
The searching / indexing in OC works well when the thing you're searching by is coming directly from the content item. It gets a little weird with taxonomies since you essentially need a "join" to find what you're looking for. If I search for "John Smith" I don't want to return the term content item as the result, I want to return the books using that term.
I could address this by including the term's display text in the index document for the book. But I'm concerned that if the display text of the term changes, I also need to go to all the books using that term and also update the index documents for them. That almost seems possible, except that term content items are special in that they aren't actually proper content items, they are embedded inside the taxonomy content item. So I can detect when any term on the taxonomy changes, but I don't know which term changed. So either I have to try and figure out which term changed or just trigger index updates for all the content items pointing to that taxonomy, even if those terms haven't changed.
Oh, and if a term is deleted, I need to somehow detect this and update the linked book to remove the display text from the index document.
At this point I'm just wondering if anyone has run into something like this before. Conceptually, it seems reasonable that searching for "John Smith" returns all books authored by John Smith, but given the way indexing / taxonomies work in OC it's actually kind of tricky.
Beta Was this translation helpful? Give feedback.
All reactions