apache / apache/lucene

FloatDocValues does not return true for 0 >< 1 values [LUCENE-4800]

Open
#5,865 6 comments 0 reactions 0 assignees View on GitHub
affects-version:6.0 legacy-jira-fix-version:6.0 legacy-jira-priority:Major module:core/search type:bug
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

The following function query should always yield 1 if the document's field matchers the query:

```Java
if(query({!lucene df=FIELD v=$q},0),1,0)
```

This is, however, not true if due to low IDF the score end up below 1 but, obviously, above 0. The if() statement does not recognize a number between zero and one as positive and therefore TRUE.

---
Migrated from [LUCENE-4800](https://issues.apache.org/jira/browse/LUCENE-4800) by Markus Jelsma, updated May 09 2016
Environment:
```
5.0-SNAPSHOT 1427825:1444730M - markus - 2013-02-11 11:39:54
```

Attachments: [LUCENE-4800-trunk.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-4800/LUCENE-4800-trunk.patch)

Contributor guide

Open the contributing guide

Research direction

Start by locating the FloatDocValues implementation and the function-query evaluation path described in the issue. Reproduce the query with a score between zero and one, then verify that a matching document is treated as true and add or update coverage for that case.

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.