QueryParser throwing null pointer exception if input is invalid [LUCENE-2987]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
I was using org.apache.lucene.queryParser.QueryParser for parsing the input.
My input:
Input query string: "category: (4 or 6 or 8)"
Analyzer: StandardAnalyzer
QueryParser's parse() method is resulting in Null Pointer Exception.
If i give input query string as "category: (4 OR 6 OR 8)" which is uppercase 'OR', it works fine and i get the desired results.
I'm seeing the problem only with lower case 'or'
---
Migrated from [LUCENE-2987](https://issues.apache.org/jira/browse/LUCENE-2987) by Ramesh, updated Mar 30 2016
Attachments: [LUCENE-2987.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-2987/LUCENE-2987.patch)
Contributor guide
Research direction
Start by reproducing the failure with org.apache.lucene.queryParser.QueryParser.parse() using "category: (4 or 6 or 8)" and StandardAnalyzer, then compare it with the uppercase OR input. Done means the lowercase query no longer throws a NullPointerException and produces the expected results.
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
- Clearly specified
- Newbie friendliness
- 45/100