Skip to content

Add support for nested fields #87

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

marangonico
Copy link

Updated facets, filters, and aggregations to handle nested fields, enabling more flexible query structures. Adjusted logic to check for "nested" definitions and construct queries accordingly, ensuring compatibility with both standard and nested data structures.

This PR improves the handling of nested fields.

Let's take category as an example.
The following snippet shows how to add a facet for the category id.
A new dictionary key "nested" is needed with the "path" to be used.


OSCAR_ELASTICSEARCH_FACETS = [
    {
        "name": "categories.id",
        "label": "Category",
        "type": "term",
        "nested": {
            "path": "categories",
        }
}

Updated facets, filters, and aggregations to handle nested fields, enabling more flexible query structures. Adjusted logic to check for "nested" definitions and construct queries accordingly, ensuring compatibility with both standard and nested data structures.
Limita la versione di Elasticsearch supportata a <9 per garantire la compatibilità con le librerie esistenti. Questa modifica previene potenziali problemi con breaking changes nelle versioni future.
Corregge la sintassi del requisito per "elasticsearch" utilizzando una virgola anziché un punto e virgola. Garantisce compatibilità con le versioni future mantenendo l'intervallo specificato.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant