Skip to content

Encode function for TermsInclude regexes. #8302

Closed
@lanwin

Description

@lanwin

Is your feature request related to a problem? Please describe.
We have a list of TermsInclude (currently on V7) and we want to get all terms that start with our word (so basically word+.*). The problem is that these words can contain regex chars like . are ? and we need to encode them correctly. From what I can see there is no method to do that.

Describe the solution you'd like
I think there should be a method to encode regex chars correctly the use inside ElasticSearch.

Describe alternatives you've considered
We are currently ding this Regex.Escape(word).Replace("\"", "\\\"") but since dotnet Regex and ElasticSearch regexes are not identical, this can not be an 100% match.

Additional context
Add any other context or screenshots about the feature request here.

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