[
https://issues.apache.org/jira/browse/SOLR-14859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17194945#comment-17194945
]
Munendra S N commented on SOLR-14859:
-------------------------------------
[~gerlowskija]
I was able to reproduce the problem using the script
This
[code|https://github.com/apache/lucene-solr/blob/485d5fb41a39ab08ae9dca6bdba579aa78e69e2b/solr/core/src/java/org/apache/solr/schema/FieldType.java#L946],
introduced in SOLR-11746 actually check if omitnorms is enabled or disabled.
Only if disabled and non-PointField, it uses NormsFieldExistsQuery. So, based
on this flow {{omitNorms}} is false by default for DateRangeField
I verified this using the Admin UI and luke API. The SchemaField(used in the
above) properties says that OmitNorms is not set to true but
{{IndexableFieldType}} says OmitNorms is set to true. So, the actual data
indexed has omitNorms=true because of
[this|https://github.com/apache/lucene-solr/blob/master/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java#L191-L197].
Looks like SOLR-11746 exposed this mismatch between SchemaField properties and
IndexableFieldType properties.
{code:java}
{
"type": "date_range_type",
"schema": "I-S-U------F------",
"index": "ITS-------OF------",
"docs": 1
}
{code}
> [* TO *] queries on DateRange fields miss results
> -------------------------------------------------
>
> Key: SOLR-14859
> URL: https://issues.apache.org/jira/browse/SOLR-14859
> Project: Solr
> Issue Type: Improvement
> Security Level: Public(Default Security Level. Issues are Public)
> Components: query parsers
> Affects Versions: 8.5
> Reporter: Jason Gerlowski
> Priority: Major
> Attachments: query-debug.png, reproduce.sh, schema.png
>
>
> "exists" queries ({{[* TO *]}}) on DateRange fields return 0 results
> regardless of docs in the index with values in that field.
> The issue appears to be that the query is converted into a
> {{NormsFieldExistsQuery}}, even though DateRangeField uses omitNorms=true by
> default. Probably introduced by SOLR-11746's changes to these optimizable
> range queries.
> I've attached a script to reproduce the issue (tested on Solr 8.6.2) and
> screenshots showing showing schema and query-parsing info for the
> reproduction.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]