IllegalArgumentException in QueryParserBase.parse() [LUCENE-6703]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
I have encountered a very special case where parsing a certain String with the `MultiFieldQueryParser` causes an `IllegalArgumentException` thrown in the constructor of `org.apache.lucene.util.automaton.RegExp`. I would have expected a `ParseException` instead (as stated in the API doc).
```Java
QueryParser parser = new MultiFieldQueryParser(...);
parser.parse("/x)/");
```
The "evil" search string is **`/x)/`**.
---
Migrated from [LUCENE-6703](https://issues.apache.org/jira/browse/LUCENE-6703) by Oliver Becker
Contributor guide
Research direction
Start by reproducing the issue with MultiFieldQueryParser.parse("/x)/") and trace where the IllegalArgumentException from org.apache.lucene.util.automaton.RegExp escapes the parser. Compare this behavior with the API's ParseException contract; done means the malformed query produces the documented exception instead.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100