apache / apache/lucene

QueryParsers do not support negative boosts [LUCENE-4378]

Open
#5,444 17 comments 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Major type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

Negative query boosts have been supported at the "Query" object level for a long time (resulting in negative scores for matching documents), but evidently we never updated the QueryParsers to know about this - attempting to specify a negative boost in the query string results in a parse error.

we should probably add this to the parser grammer(s)

---
Migrated from [LUCENE-4378](https://issues.apache.org/jira/browse/LUCENE-4378) by Chris M. Hostetter (@hossman), 1 vote, updated Dec 02 2014
Attachments: [LUCENE-4378-test.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-4378/LUCENE-4378-test.patch)
Linked issues:
- [SOLR-3278](https://issues.apache.org/jira/browse/SOLR-3278)

Contributor guide

Open the contributing guide

Research direction

Start by examining the QueryParsers and their query-string grammar definitions to trace how boosts are parsed. Review the attached LUCENE-4378-test.patch for the expected regression coverage, then verify that query strings with negative boosts parse successfully and produce the intended negative scores.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.