nick-boss-tech commented on code in PR #5361:
URL: https://github.com/apache/solr/pull/5361#discussion_r4677477300
##########
solr/core/src/java/org/apache/solr/schema/PrimitiveFieldType.java:
##########
@@ -38,6 +38,10 @@ protected void init(IndexSchema schema, Map<String, String>
args) {
protected void checkSupportsDocValues() { // primitive types support
DocValues
}
+ @Override
+ protected void checkSupportsDocValuesSkipList() { // primitive types support
DocValues skip lists
Review Comment:
🤖 *AI text below* 🤖
`AbstractNumericRangeField` inherits this capability, as do `IntRangeField`,
`LongRangeField`, `FloatRangeField`, and `DoubleRangeField`. Their writers use
binary DocValues and do not create a skip index. A schema can therefore accept
`docValuesSkipList=true` for these fields without getting the requested index.
Could these field types reject the option, with a schema test for the
unsupported configuration?
##########
solr/solr-ref-guide/modules/indexing-guide/pages/docvalues.adoc:
##########
@@ -65,6 +65,26 @@ Enabling a field for docValues only requires adding
`docValues="true"` to the fi
[IMPORTANT]
If you have already indexed data into your Solr index, you will need to
completely reindex your content after changing your field definitions in the
schema in order to successfully use docValues.
+[[docvalues-skip-lists]]
+=== DocValues Skip Lists
+
+Lucene can optionally write a skip index on top of DocValues
(`docValuesSkipList="true"`).
+With a skip index, DocValues range queries can approach points/BKD throughput
when field values are correlated with document order -- for example when
documents are inserted in value order, or when the index is sorted on that
field -- without keeping a separate points tree on disk.
+
+This is opt-in and requires `docValues="true"`.
+It is supported for field types that use Lucene `NUMERIC`, `SORTED_NUMERIC`,
`SORTED`, or `SORTED_SET` DocValues (the same types listed under <<Enabling
DocValues>> that use those encodings).
Review Comment:
🤖 *AI text below* 🤖
The linked list includes `LatLonPointSpatialField`, which uses
`SORTED_NUMERIC` DocValues. That type does not override the new skip-list
capability check, so a field with `docValuesSkipList=true` is rejected during
schema validation.
Is this field type intended to support the option? If not, could the guide
exclude it and a schema test cover the rejection?
##########
solr/core/src/java/org/apache/solr/schema/FieldType.java:
##########
@@ -329,6 +332,34 @@ protected IndexableField createField(String name, String
val, IndexableFieldType
return new Field(name, val, type);
}
+ protected IndexableField createSortedDocValuesField(
+ String fieldName, BytesRef value, boolean hasDocValuesSkipList) {
+ return hasDocValuesSkipList
+ ? SortedDocValuesField.indexedField(fieldName, value)
+ : new SortedDocValuesField(fieldName, value);
+ }
+
+ protected IndexableField createSortedSetDocValuesField(
+ String fieldName, BytesRef value, boolean hasDocValuesSkipList) {
+ return hasDocValuesSkipList
+ ? SortedSetDocValuesField.indexedField(fieldName, value)
+ : new SortedSetDocValuesField(fieldName, value);
+ }
+
+ protected IndexableField createNumericDocValuesField(
+ String fieldName, long value, boolean hasDocValuesSkipList) {
+ return hasDocValuesSkipList
+ ? NumericDocValuesField.indexedField(fieldName, value)
Review Comment:
🤖 *AI text below* 🤖
An atomic update can fail when a single-valued numeric field uses this skip
index. `AtomicUpdateDocumentMerger` still selects the in-place update path, but
Lucene rejects DocValues updates on a field with a skip index.
A focused Linux test at this PR head reproduced the failure with an atomic
`inc` on an existing document. The update failed with an
`IllegalArgumentException`. The same update on a field without a skip index
succeeded.
Could the in-place eligibility check exclude fields with skip indexes so
these updates use the full update path? A regression test for the update and
its resulting value would help protect the behavior.
--
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]