FoundatioFx / Foundatio.Parsers

A lucene style query parser that is extensible and allows modifying the query.
https://www.nuget.org/packages/Foundatio.Parsers.LuceneQueries/
Apache License 2.0
66 stars 19 forks source link

Lucene searches starting with a wildcard are identified as valid queries #73

Closed BrianFreemanAtlanta closed 2 years ago

BrianFreemanAtlanta commented 2 years ago

Per Lucene specs 2.9.4.

You cannot use a * or ? symbol as the first character of a search.

When I parse a search *hello or ?hello and validate the query they both come back as "valid" queries.

ejsmith commented 2 years ago

Elasticsearch has an option allow_leading_wildcard that allows using leading wildcards. So I can't make it fail parsing on this syntax. Would need to add a query validation option to check for this case.

ejsmith commented 2 years ago

Added an AllowLeadingWildcards option in the validator. Thanks @BrianFreemanAtlanta!