ercsonusharma commented on code in PR #4645:
URL: https://github.com/apache/solr/pull/4645#discussion_r3630778417
##########
solr/core/src/java/org/apache/solr/schema/numericrange/AbstractNumericRangeField.java:
##########
@@ -134,13 +141,20 @@ protected Pattern getSingleBoundPattern() {
@Override
protected boolean enableDocValuesByDefault() {
- return false; // Range fields do not support docValues
+ // DocValues are supported for both single and multiValued range fields,
but are opt-in: they
+ // add an extra (binary) docValues field, and range docValues only help
queries that combine
+ // the range clause with a more selective clause, so we don't enable them
by default.
+ return false;
}
@Override
protected void init(IndexSchema schema, Map<String, String> args) {
super.init(schema, args);
+ // Force useDocValuesAsStored off; it otherwise defaults on for schema,
which
+ // would make fl=* responses fail on a docValues-enabled range field.
+ properties &= ~USE_DOCVALUES_AS_STORED;
Review Comment:
As the range field's docValues are an opaque packed BINARY blob , not the
external "[min TO max]" form, they can't stand in for the stored value:
useDocValuesAsStored would make fl=* return that raw blob. So, I have now added
the parameter to make it false by default and throw an exception if set
explicitly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]