diff options
author | Arne Juul <arnej@yahoo-inc.com> | 2018-11-22 15:13:19 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahoo-inc.com> | 2018-11-22 15:13:24 +0000 |
commit | 439f4d13240ee420a9270625406035ffa28a5ba7 (patch) | |
tree | b01e1c339d707f3685af2cf87f71c1aea4ad5554 /config-model | |
parent | ed2c61d8ef29e9dba50457449a5ab00a1d714d3d (diff) |
exclude "extra" fields from [document] field-set
Diffstat (limited to 'config-model')
6 files changed, 11 insertions, 22 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/processing/BuiltInFieldSets.java b/config-model/src/main/java/com/yahoo/searchdefinition/processing/BuiltInFieldSets.java index a0c4c8adb2d..df189389348 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/processing/BuiltInFieldSets.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/processing/BuiltInFieldSets.java @@ -40,6 +40,9 @@ public class BuiltInFieldSets extends Processor { private void addDocumentFieldSet() { for (Field docField : search.getDocument().fieldSet()) { + if (docField instanceof SDField && ((SDField) docField).isExtraField()) { + continue; // skip + } search.fieldSets().addBuiltInFieldSetItem(DOC_FIELDSET_NAME, docField.getName()); } } diff --git a/config-model/src/test/derived/inheritance/documentmanager.cfg b/config-model/src/test/derived/inheritance/documentmanager.cfg index 754144c0af9..47f697c80f7 100644 --- a/config-model/src/test/derived/inheritance/documentmanager.cfg +++ b/config-model/src/test/derived/inheritance/documentmanager.cfg @@ -79,8 +79,6 @@ datatype[].documenttype[].bodystruct -1989003153 datatype[].documenttype[].fieldsets{[document]}.fields[] "onlygrandparent" datatype[].documenttype[].fieldsets{[document]}.fields[] "onlymother" datatype[].documenttype[].fieldsets{[document]}.fields[] "overridden" -datatype[].documenttype[].fieldsets{[document]}.fields[] "rankfeatures" -datatype[].documenttype[].fieldsets{[document]}.fields[] "summaryfeatures" datatype[].id 2126589281 datatype[].structtype[].name "father.header" datatype[].structtype[].version 0 @@ -113,8 +111,6 @@ datatype[].documenttype[].bodystruct -1742340170 datatype[].documenttype[].fieldsets{[document]}.fields[] "onlyfather" datatype[].documenttype[].fieldsets{[document]}.fields[] "onlygrandparent" datatype[].documenttype[].fieldsets{[document]}.fields[] "overridden" -datatype[].documenttype[].fieldsets{[document]}.fields[] "rankfeatures" -datatype[].documenttype[].fieldsets{[document]}.fields[] "summaryfeatures" datatype[].id 81425825 datatype[].structtype[].name "child.header" datatype[].structtype[].version 0 @@ -151,5 +147,3 @@ datatype[].documenttype[].fieldsets{[document]}.fields[] "onlyfather" datatype[].documenttype[].fieldsets{[document]}.fields[] "onlygrandparent" datatype[].documenttype[].fieldsets{[document]}.fields[] "onlymother" datatype[].documenttype[].fieldsets{[document]}.fields[] "overridden" -datatype[].documenttype[].fieldsets{[document]}.fields[] "rankfeatures" -datatype[].documenttype[].fieldsets{[document]}.fields[] "summaryfeatures" diff --git a/config-model/src/test/derived/inheritfromgrandparent/documentmanager.cfg b/config-model/src/test/derived/inheritfromgrandparent/documentmanager.cfg index 97babb77bd1..8d5bc57ef31 100644 --- a/config-model/src/test/derived/inheritfromgrandparent/documentmanager.cfg +++ b/config-model/src/test/derived/inheritfromgrandparent/documentmanager.cfg @@ -72,8 +72,6 @@ datatype[].documenttype[].inherits[].name "document" datatype[].documenttype[].inherits[].version 0 datatype[].documenttype[].headerstruct 836075987 datatype[].documenttype[].bodystruct -389494616 -datatype[].documenttype[].fieldsets{[document]}.fields[] "rankfeatures" -datatype[].documenttype[].fieldsets{[document]}.fields[] "summaryfeatures" datatype[].id 81425825 datatype[].structtype[].name "child.header" datatype[].structtype[].version 0 @@ -101,5 +99,3 @@ datatype[].documenttype[].inherits[].version 0 datatype[].documenttype[].headerstruct 81425825 datatype[].documenttype[].bodystruct -126593034 datatype[].documenttype[].fieldsets{[document]}.fields[] "child_field" -datatype[].documenttype[].fieldsets{[document]}.fields[] "rankfeatures" -datatype[].documenttype[].fieldsets{[document]}.fields[] "summaryfeatures" diff --git a/config-model/src/test/derived/inheritfromparent/documentmanager.cfg b/config-model/src/test/derived/inheritfromparent/documentmanager.cfg index 6f99d9de53b..154b6524c33 100644 --- a/config-model/src/test/derived/inheritfromparent/documentmanager.cfg +++ b/config-model/src/test/derived/inheritfromparent/documentmanager.cfg @@ -55,7 +55,7 @@ datatype[].documenttype[].inherits[].name "document" datatype[].documenttype[].inherits[].version 0 datatype[].documenttype[].headerstruct 836075987 datatype[].documenttype[].bodystruct -389494616 -datatype[].documenttype[].fieldsets{[document]}.fields[] "weight_src" +datatype[].documenttype[].fieldsets{[]}.fields[] "weight_src" datatype[].id 81425825 datatype[].structtype[].name "child.header" datatype[].structtype[].version 0 @@ -82,8 +82,5 @@ datatype[].documenttype[].inherits[].name "parent" datatype[].documenttype[].inherits[].version 0 datatype[].documenttype[].headerstruct 81425825 datatype[].documenttype[].bodystruct -126593034 -datatype[].documenttype[].fieldsets{[document]}.fields[] "child_field" -datatype[].documenttype[].fieldsets{[document]}.fields[] "rankfeatures" -datatype[].documenttype[].fieldsets{[document]}.fields[] "summaryfeatures" -datatype[].documenttype[].fieldsets{[document]}.fields[] "weight" -datatype[].documenttype[].fieldsets{[document]}.fields[] "weight_src" +datatype[].documenttype[].fieldsets{[]}.fields[] "child_field" +datatype[].documenttype[].fieldsets{[]}.fields[] "weight_src" diff --git a/config-model/src/test/derived/inheritfromparent/documenttypes.cfg b/config-model/src/test/derived/inheritfromparent/documenttypes.cfg index d8493eefe95..70c4bc4297c 100644 --- a/config-model/src/test/derived/inheritfromparent/documenttypes.cfg +++ b/config-model/src/test/derived/inheritfromparent/documenttypes.cfg @@ -75,7 +75,7 @@ documenttype[].datatype[].sstruct.compression.type NONE documenttype[].datatype[].sstruct.compression.level 0 documenttype[].datatype[].sstruct.compression.threshold 95 documenttype[].datatype[].sstruct.compression.minsize 200 -documenttype[].fieldsets{[document]}.fields[] "weight_src" +documenttype[].fieldsets{[]}.fields[] "weight_src" documenttype[].id 746267614 documenttype[].name "child" documenttype[].version 0 @@ -118,8 +118,5 @@ documenttype[].datatype[].sstruct.compression.type NONE documenttype[].datatype[].sstruct.compression.level 0 documenttype[].datatype[].sstruct.compression.threshold 95 documenttype[].datatype[].sstruct.compression.minsize 200 -documenttype[].fieldsets{[document]}.fields[] "child_field" -documenttype[].fieldsets{[document]}.fields[] "rankfeatures" -documenttype[].fieldsets{[document]}.fields[] "summaryfeatures" -documenttype[].fieldsets{[document]}.fields[] "weight" -documenttype[].fieldsets{[document]}.fields[] "weight_src" +documenttype[].fieldsets{[]}.fields[] "child_field" +documenttype[].fieldsets{[]}.fields[] "weight_src" diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/SearchDefinitionTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/SearchDefinitionTestCase.java index fa4280d2236..21c7362f793 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/SearchDefinitionTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/SearchDefinitionTestCase.java @@ -32,6 +32,8 @@ public abstract class SearchDefinitionTestCase { writer.newLine(); writer.flush(); writer.close(); + System.err.println(e.getMessage() + " [not equal files: >>>"+expectedFile+"<<< and >>>"+cfgFile+"<<< in assertConfigFiles]"); + return; } throw new AssertionError(e.getMessage() + " [not equal files: >>>"+expectedFile+"<<< and >>>"+cfgFile+"<<< in assertConfigFiles]", e); } |