Skip to content

[Elasticsearch] Optimize the final query #220

@dkarlovi

Description

@dkarlovi
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? no

Currently, the final query generated for Elasticsearch is directly derived from the search condition. This can lead to verbose queries, for example for search condition name: foo you get:

{
    "query": {
        "bool": {
            "must": [
                {
                    "terms": {
                        "name": [
                            "foo"
                        ]
                    }
                }
            ]
        }
    }
}

Can be at least reduced to:

{
    "query": {
        "terms": {
            "name": [
                "foo"
            ]
        }
    }
}

We can also detect if we have exact or fuzzy matches and use filtered query (more examples of possible optimizations are linked).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions