apache / apache/lucene

fish*~ parses to PrefixQuery - should be a parse exception [LUCENE-375]

Open
#1,453 2 comments 0 reactions 0 assignees View on GitHub
affects-version:1.4 legacy-jira-priority:Minor module:core/queryparser type:bug
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

QueryParser parses "fish\*\" into a "fish\*" PrefixQuery and silently drops the \. This really should be a
parse exception.

---
Migrated from [LUCENE-375](https://issues.apache.org/jira/browse/LUCENE-375) by Erik Hatcher (@erikhatcher), updated Nov 30 2013
Environment:
```
Operating System: other
Platform: Other
```

Linked issues:
- #2898

Contributor guide

Open the contributing guide

Research direction

Start by locating Lucene's QueryParser implementation and its parser tests, then reproduce the `fish*` input described in the issue. Trace why the malformed suffix becomes a PrefixQuery instead of an error. Done means the input raises a parse exception and the existing valid wildcard and prefix cases remain covered.

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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.