Search resource implementation #5127
Replies: 8 comments
-
What I'd do in your case would be to implement a custom Search filter (extends the Abstractfilter). Then you declare the filter on each resource you want to filter. I'm not sure that you'd need a custom data provider though! |
Beta Was this translation helpful? Give feedback.
-
No, that wouldn't work as what's being asked for is a search resource that aggregates other resources. |
Beta Was this translation helpful? Give feedback.
-
I think a major blocker for this kind of use case is the lack of support for blank nodes: https://json-ld.org/spec/latest/json-ld/#identifying-blank-nodes |
Beta Was this translation helpful? Give feedback.
-
You're right @teohhanhui. What I said was inspired by this stackoverflow post answer. |
Beta Was this translation helpful? Give feedback.
-
Yes, I think that's a good pattern. We should aim to support it. |
Beta Was this translation helpful? Give feedback.
-
Okay I misunderstood the question then :D. |
Beta Was this translation helpful? Give feedback.
-
Then it's not possible to do this for the moment? |
Beta Was this translation helpful? Give feedback.
-
@carlespibernat I don't think it's impossible, but it's harder. |
Beta Was this translation helpful? Give feedback.
-
Hello!
I want to create a searcher in my project which searches and gives results of different resources.
I suppose that the most "RESTful" way to do that is to create a search resource, so what I have done is create my own
Search
entity. Then i have created aSearchItemDataProvider
that will get the filters from the request and will find the results and return them.The problem that I have now is that api platform requires that my resource has a specific id for each search, so I get an error.
Is this the properly way to implement this? And if it is how can I solve my issue with the id?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions