Skip to content

Don't use prefix queries/filters #740

Closed
@clintongormley

Description

@clintongormley

To show files by dir/ the query currently uses a prefix filter - a lot of these queries show up in the slow log

Better way to do that would be to use a path hierarchy tokenizer on that field http://www.elasticsearch.org/guide/reference/index-modules/analysis/pathhierarchy-tokenizer.html and then use the match_phrase query to search eg t/foo/bar (match_phrase to make sure they're in the right order)

You probably need something at the beginning of the path, so that you can anchor the search at the beginning as well

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions