Skip to content
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

Standardise wildcard matching #11334

Closed
clintongormley opened this issue May 25, 2015 · 6 comments
Closed

Standardise wildcard matching #11334

clintongormley opened this issue May 25, 2015 · 6 comments

Comments

@clintongormley
Copy link

With the new path_filter parameter (#10980) we support wildcards with * matching a single "segment" of the path and ** matching multiple segments.

Currently we use slightly different simple wildcards in a number of other places, such as when looking up field names. Index wildcards also support a leading - to exclude matches.

I'd like to propose that we standardise the syntax across all APIs that use wildcard matching, as follows:

  • * matches zero or more characters up to but not including a period .
  • ** matches all zero or more characters including a period
  • multiple patterns can be separated by a comma ,
  • any pattern can be preceded by a + to include matches (the default if not specified) or a - to exclude matches
  • it should be possible to escape any of these characters: *, +, -, ,, \ with a preceding \

Relates to #11294

@nik9000
Copy link
Member

nik9000 commented May 25, 2015

Highlighting has an issue about excluding fields from * that this applies to. I don't have the number handy.

@clintongormley
Copy link
Author

thanks @nik9000 - it is #9881

@abibell
Copy link

abibell commented May 26, 2015

If we used Regex would that prevent us from hand crafting the parsing? How much of performance hit is that going to be? We could execute regex only when we detect the presence of regex.

@clintongormley
Copy link
Author

You'd have to have some marker to indicate that it is a regex, otherwise foo* would be ambiguous. The obvious marker would be to wrap the pattern in /, but not all users of wildcard matching could support regexes. For instance the streaming path filtering is highly optimised because it only considers segments. If we were to change that to regexes it would have a big performance overhead.

@clintongormley
Copy link
Author

Discussing this some more: changing the index pattern matching would be problematic, eg you'd have to escape the . in .marvel etc. Probably not worth making this change everywhere.

@clintongormley
Copy link
Author

Won't fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants