Don't deactivate processing of index settings when validation is turned off.
@@ -24,19 +24,21 @@ public class TensorFieldProcessor extends Processor {
@Override
public void process(boolean validate, boolean documentsOnly) {
- if ( ! validate) return;
-
for (var field : search.allConcreteFields()) {
if ( field.getDataType() instanceof TensorDataType ) {
+ if (validate) {
validateIndexingScripsForTensorField(field);
validateAttributeSettingForTensorField(field);
- processIndexSettingsForTensorField(field);
+ }
+ processIndexSettingsForTensorField(field, validate);
}
else if (field.getDataType() instanceof CollectionDataType){
+ if (validate) {
validateDataTypeForCollectionField(field);
}
}
}
+ }
private void validateIndexingScripsForTensorField(SDField field) {
if (field.doesIndexing() && !isTensorTypeThatSupportsHnswIndex(field)) {
@@ -68,12 +70,12 @@ public class TensorFieldProcessor extends Processor {
}
}
- private void processIndexSettingsForTensorField(SDField field) {
+ private void processIndexSettingsForTensorField(SDField field, boolean validate) {
if (!field.doesIndexing()) {
return;
}
if (isTensorTypeThatSupportsHnswIndex(field)) {
- if (!field.doesAttributing()) {
+ if (validate && !field.doesAttributing()) {
fail(search, field, "A tensor that has an index must also be an attribute.");
}
var index = field.getIndex(field.getName());
