apache / apache/lucene

QueryParser treatment of unescaped internal operators [LUCENE-2916]

Open
#3,990 3 comments 0 reactions 0 assignees View on GitHub
legacy-jira-label:newdev 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

myfield:foo-bar and myfield:foo+bar are treated as myfield:"foo-bar" and myfield:"foo+bar"
but myfield:foo!bar is treated as myfield:foo -defaultfield:bar

Somewhat related, temp:70 works fine, but temp:-10 throws an exception. Many people hit this and figure out how to work around it relatively quickly, but just fixing the grammar to accept it might be better?

---
Migrated from [LUCENE-2916](https://issues.apache.org/jira/browse/LUCENE-2916) by Yonik Seeley (@yonik), updated May 18 2016
Attachments: [LUCENE-2916-unescaped-negative.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-2916/LUCENE-2916-unescaped-negative.patch)

Contributor guide

Open the contributing guide

Research direction

Start in the QueryParser grammar and review the attached LUCENE-2916-unescaped-negative.patch. Reproduce the foo-bar, foo+bar, foo!bar, and temp:-10 cases, then verify that unescaped internal operators and negative values parse consistently without changing the intended field semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.