[
https://issues.apache.org/jira/browse/SOLR-18019?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18043726#comment-18043726
]
Houston Putman commented on SOLR-18019:
---------------------------------------
bq. If i were to try to "break" your impl (so that it did NOT find NaN by
modifying your overridden getSpecializedExistenceQuery to use
FloatPoint.newRangeQuery(field.getName(), Float.NEGATIVE_INFINITY,
Float.POSTIVE_INFINITY) would that test fail?
Yes, {{TestSolrQueryParser.testDocsWithNaNInField()}}. This will fail if you
change {{FloatPoint.newRangeQuery(field.getName(), Float.NEGATIVE_INFINITY,
Float.NaN)}} to {{FloatPoint.newRangeQuery(field.getName(),
Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY)}} in my PR.
bq. do we already have a test that indexes some doc X w/o any float values, and
another doc Y with an explicit NaN value, and then runs an "exists" query that
should find Y but not X ?
Yes, same test as above: {{TestSolrQueryParser.testDocsWithNaNInField()}}
bq. Particularly since the docs for FloatPoint.newRangeQuery indicate that
using Float.POSTIVE_INFINITY as an upper limit is already equivalent to an
"open ended" range query – making me concerned that (at a lucene encoded points
level) even an open ended range query still won't find NaN ... so why would a
bounded range query (with a bound "greater" then "open ended") find that value?
Ultimately I think their phrasing is "half-open range", which IMO would not
include NaN. NaN is only really useful in existence queries which they don't
seem to be taking any stance on. Even their rewrite() method won't rewrite a
-Infinity TO Infinity query to a MatchAllDocsQuery if there is a NaN value,
seeing as they actively check the bounds of values for the docValues (which NaN
will not be in).
> FloatPointField and DoublePointField can have improved non-DocValue existence
> queries
> -------------------------------------------------------------------------------------
>
> Key: SOLR-18019
> URL: https://issues.apache.org/jira/browse/SOLR-18019
> Project: Solr
> Issue Type: Improvement
> Reporter: Houston Putman
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Currently all double or float fields (trie and point) use (field:[* TO *] OR
> field:NaN) to represent non-DocValue existence queries. However since NaN is
> numerically sorted after +Infinity, we can use this to our advantage and
> just issue a field:[-Infinity TO NaN] range query for point fields.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]