-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with searching nested fields with arrays of objects #1208
Comments
Thanks so much for a detailed issue! You're correct, nested search attributes are not supported. I "deprioritised" it as developers can override the ES query.query via The facet search is a bug and one thing I didn't think about when developing nested fields. I will fix that soon. Also happy for PRs for nested field search_attributes too! |
Thanks for the speedy reply. Could you give me an example of how to use |
Something like this. Searchkit ships with a default "QueryHandler" but you can override via
|
the facet query bug is fixed now in latest version :) |
The problem
Attempting to search nested fields with arrays of objects causes no search results to be returned. A similar situation also occurs when enabling
searchable
on aRefinementList
and searching for text, but here an error occurs.Search issue
The data looks like this:
With mapping of:
The combination of packages we're using is:
With Node 16.
The simplified configuration for the search field is:
search_attributes: ["Author_100.firstName"]
After enabling debug mode and running the query directly, I can see it gets no results because the query doesn't include the
nested
property, as per the ES docs. I appreciate this is likely a feature request rather than a bug, to be able to define a search term as nested, so the necessary modifications to the query can be made.Facet issue
You do have support for nested facets, where we define the following config for
facet_attributes
:The facet works as expected for selection &
showMore
functionality, but when enablingsearchable
and attempting a search, an error occurs:When running debug and inspecting the query manually, the query does work, but Searchkit can't seem to parse the result.
Here's a snippet of the result:
My guess is it's struggling to parse the
Author_100.
including the fullstop at the end.The text was updated successfully, but these errors were encountered: