Closed (fixed)
Project:
Search API
Version:
7.x-1.x-dev
Component:
Views integration
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 Apr 2011 at 14:12 UTC
Updated:
2 Nov 2018 at 12:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
drunken monkeyReminder: When doing this, maybe include #1141488: Allow multiple values for contextual filters.
Comment #2
Shadlington commentedThere are many argument handlers missing too.
I'm not sure if this is something that will be handled by other changes you're making on the views side of things so I thought I would mention it. I'll also happily raise a separate issue if you wish.
Personally the ones I would most like to have are the missing term arguments (I was hoping to use them to replace my term pages with Search API). They are:
"Content: Has taxonomy term ID
Display content if it has the selected taxonomy terms.
Content: Has taxonomy term ID (with depth)
Display content if it has the selected taxonomy terms, or children of the selected terms. Due to additional complexity, this has fewer options than the versions without depth.
Content: Has taxonomy term ID depth modifier
Allows the "depth" for Taxonomy: Term ID (with depth) to be modified via an additional contextual filter value."
EDIT: Actually, after giving it more thought I don't think I should be trying to use terms arguments for this purpose. Still, I think the point still stands.
Comment #3
drunken monkeySo this allows you to filter on a taxonomy term that may be in any field on the entity? And the version with depth also searches the parents or, equivalently, also matches on children of the given term?
I guess this wouldn't be too hard to implement.
Still, in principle, I'll only add those handlers that are needed, as I can't just add all of them (or all that can possibly be added) without months of work. Views is a humongous thing that has grown over years, I can't really mirror all DB functionality there for the Search API.
Comment #4
Shadlington commentedOh yes I realise that. There are loads of them - I just wanted to see where you stood on adding missing ones as you've said you don't really use them yourself.
You've pretty much got it right on how those arguments are used. You can set a depth (can be positive, 0 or negative for children, just the term or parents, respectively) or pass it a depth via the depth modifier argument.
That said, the depth modifier is probably less widely used as the static setting on the term with depth argument is normally all that is required.
Comment #5
zambrey commentedHi, filtering by taxonomy (with depth) would be a nice feature.
I'm just wondering if this could somehow be done by defining relationships in views.
Then automatically we have all fields defined by node and can do additional filtering on them.
I'm not familiar with all internal views stuff so just shooting.
Comment #6
drunken monkeyNo, I don't think it's possible this way, as the internal query is of an entirely different sort. But maybe #1172970: provide a unified way to retrieve result entities will help there.
Comment #7
dmiric commentedYeah I also had the same idea to use search api and solr for showing taxonomy pages. Managed to do everything so far and now I got to the same problem no depth support.
Does anyone have an idea how to do this ? Even if it would be a messy solution just to get it working for now.
How about if I would use multiple selection and then select both parent and child. Would that work with the way solr is made now?
Comment #8
drunken monkeyI'm probably gonna create a data alteration which would add all parent terms of a taxonomy term to the index soon (cf. #1213698: Add a data alteration for indexing complete hierarchies). Then, you could just use a normal contextual filter on this new field to accomplish this.
I could also add an optional depth restriction there – only the third contextual filter, "Has taxonomy term ID depth modifier", wouldn't be possible to do this way.
Comment #9
dmiric commentedThat would solve my use case.
Ty.
Comment #10
blackice2999 commentedHi,
any news on this ?
best regards
Comment #11
andrewbelcher commentedWould also be good to include #1407844: Allow exclude for contextual filters when working on the argument handlers.
Comment #12
bigsyke commentedI am also stuck here, and need some sort of depth modifier.
Comment #13
kayelle commentedAlso looking for this. Thanks!
Comment #14
marcoka commentedi am not sure if it helps until this is done but what i did is add an aggregated field and add all vocabulary ids, then i used that field as contextual filter for taxonomy. result is that every single taxonomy link triggers a "search api page/result"
Comment #15
chirhotec commentedAny progress on this?
I could really use the "Content: Has taxonomy term ID" contextual filter to override my taxonomy pages to be search results table
Comment #16
orakili commentedFor a "Content: Has taxonomy term ID"-like contextual filter, please have a look at #1696434: Search API views argument handler for all indexed taxonomy term fields..
Comment #17
bigsyke commentedAside from taxonomy, a way to hook into the location:proximity filter argument is highly needed. The actual Search API location module looks dead, and the Location argument would allow our websites to keep up with the big boys.
Comment #18
maico de jongI managed to set up my taxonomy pages using search api & taxonomy term id with depth:
In the argument, specify the following php validation criteria:
Don't forget to check 'allow multiple values'!
Comment #19
harryascent commentedThank MDJ Webdiensten, its worked for me.
Comment #20
drunken monkeyOK, then it seems this is fixed?
Also check out the tutorial in the handbook – and please add your own findings there!
Comment #22
Enemy commented#18 worked for me
And what about the redefinition of the title?