Closed (fixed)
Project:
Search API
Version:
8.x-1.x-dev
Component:
Views integration
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
14 Jan 2016 at 09:55 UTC
Updated:
14 Mar 2016 at 12:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
drunken monkeyThere is already a filter plugin for taxonomy term fields,
SearchApiTerm. However, I just checked and it seems that that doesn't get correctly added as the plugin used for those fields, so that's just a bug. Apart from that, this functionality should already be there.Comment #3
stborchertI found this issue while searching for a solution for a very strange error I got adding a term name as an exposed filter to a search view (btw.: its better to use the term Id as filter but that didn't work either).
Don't know if the patch is a complete solution but adding this made the filter work.
Comment #4
borisson_@stBorchert: Would it be difficult to add a regression test for this issue? I'd love to see a red test for this so it's easier to understand what exactly is wrong.
Comment #5
stborchertHm I'm not sure about this, but I think, we need to create an entitytype like paragraphs without a canonical link and try to index this. I'm not at home at the moment and will have a look onto it on monday.
Comment #6
drunken monkeyThat seems like #2596385: No link template 'canonical' found for the 'paragraph' entity type, not this issue?
For this issue, we should just add a term reference field to a content type, index it and then see whether our Views data contains the correct filter plugin (
search_api_term) for that field. (And, maybe, while we're at it, also test whether the plugin works as expected. But that's a different issue, in the end.)Anyways, your fix doesn't seem correct to me. If there really is a problem, it seems like either
_search_api_views_get_handlers()doesn't compute the right$typesfor that field (it should containentity:taxonomy_termfirst), or_search_api_views_handler_mapping()for some reason doesn't contain a mapping for that type (which would be strange, but could of course still be the case – it's a bug, after all, which already means something is going wrong).Your code more looks like it would add that filter plugin also for properties of taxonomy terms, if I'm reading the code correctly – which wouldn't be what we want.
Are you maybe trying to place a filter on something like
field_tags:name– i.e., not the reference itself, but the reference name? Then that's supposed to use the normal handler for strings, not for taxonomy term references, that's "works as designed" – index and filter on the reference itself to get the term-specific handler.Comment #7
stborchertOh, looks like I've mixed up two issues in my answer.
And yes, we indexed the name-attribute of the term. I will try to use the reference and test if this works.
Comment #8
drunken monkeyAny news on that? Is it fixed?
Comment #9
stborchertUsing the term directly in the index did the trick for filters. Unfortunately term fields are not added as arguments.
Comment #10
drunken monkeyYes, I think argument handlers aren't done yet, sorry.
However, it seems this issue here is resolved then?
Comment #11
stborchertFor me, its resolved. I am working right now on the argument handler and try to find an easy solution :)
Comment #12
drunken monkey