apache / apache/lucene

New meaning of equal sign in StandardQueryParser [LUCENE-5664]

Open
#6,726 2 comments 0 reactions 0 assignees View on GitHub
affects-version:4.5 affects-version:4.8 legacy-jira-priority:Major module:queryparser type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

The StandardSyntaxParser.jj has (undocumented?) support for the <, <=, > and => operators that generate a TermRangeQueryNode. The equal operator, however, behaves just like the colon and produces a regular Term node instead of a TermRangeQueryNode.

I've been using the attached patch in a project where we had to be able to query the exact value of a field and I'm hoping there is interest to apply it upstream.

(Note that the colon operator works just as before, producing TermQuery or PhraseQuery nodes.)

---
Migrated from [LUCENE-5664](https://issues.apache.org/jira/browse/LUCENE-5664) by Martin Blom, updated Oct 10 2018
Attachments: [LUCENE-5664.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-5664/LUCENE-5664.patch)

Contributor guide

Open the contributing guide

Research direction

Start with StandardSyntaxParser.jj and compare the existing handling of <, <=, >, and => operators with the attached LUCENE-5664.patch. Verify that the equal operator produces a TermRangeQueryNode for exact-value queries while the colon operator continues producing Term or PhraseQuery nodes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.