From 86598b9ce415228981ef9ae3da0e3b9baf10283b Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Wed, 19 Sep 2018 09:15:07 -0700 Subject: Remove dead code --- .../UnprocessingSearchBuilder.java | 44 ---------------------- .../yahoo/searchdefinition/derived/Deriver.java | 33 ---------------- config-model/src/test/examples/attributeindex.sd | 24 ------------ .../src/test/examples/attributeproperties1.sd | 21 ----------- .../src/test/examples/attributeproperties2.sd | 27 ------------- .../com/yahoo/searchdefinition/ArraysTestCase.java | 3 +- .../ReservedWordsAsFieldNamesTestCase.java | 2 +- .../searchdefinition/SearchImporterTestCase.java | 22 ++++++----- .../searchdefinition/StemmingSettingTestCase.java | 2 +- .../derived/DocumentDeriverTestCase.java | 29 +------------- .../derived/InheritanceTestCase.java | 14 ------- .../searchdefinition/derived/MailTestCase.java | 32 +--------------- .../derived/StreamingStructTestCase.java | 11 ------ .../processing/AttributeIndexTestCase.java | 34 ----------------- .../processing/AttributePropertiesTestCase.java | 40 -------------------- .../processing/BoldingTestCase.java | 4 +- .../processing/IntegerIndex2AttributeTestCase.java | 6 +-- .../SummaryFieldsMustHaveValidSourceTestCase.java | 21 ++++------- .../com/yahoo/vespa/config/ConfigVerification.java | 3 +- 19 files changed, 33 insertions(+), 339 deletions(-) delete mode 100644 config-model/src/main/java/com/yahoo/searchdefinition/UnprocessingSearchBuilder.java delete mode 100644 config-model/src/test/examples/attributeindex.sd delete mode 100644 config-model/src/test/examples/attributeproperties1.sd delete mode 100644 config-model/src/test/examples/attributeproperties2.sd delete mode 100644 config-model/src/test/java/com/yahoo/searchdefinition/processing/AttributeIndexTestCase.java delete mode 100644 config-model/src/test/java/com/yahoo/searchdefinition/processing/AttributePropertiesTestCase.java diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/UnprocessingSearchBuilder.java b/config-model/src/main/java/com/yahoo/searchdefinition/UnprocessingSearchBuilder.java deleted file mode 100644 index 6c12c6c94d1..00000000000 --- a/config-model/src/main/java/com/yahoo/searchdefinition/UnprocessingSearchBuilder.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.searchdefinition; - -import com.yahoo.search.query.profile.QueryProfileRegistry; -import com.yahoo.searchdefinition.parser.ParseException; -import com.yahoo.config.application.api.ApplicationPackage; -import com.yahoo.config.application.api.DeployLogger; -import com.yahoo.vespa.model.container.search.QueryProfiles; - -import java.io.IOException; - -/** - * A SearchBuilder that does not run the processing chain for searches - */ -public class UnprocessingSearchBuilder extends SearchBuilder { - - public UnprocessingSearchBuilder(ApplicationPackage app, - RankProfileRegistry rankProfileRegistry, - QueryProfileRegistry queryProfileRegistry) { - super(app, rankProfileRegistry, queryProfileRegistry); - } - - public UnprocessingSearchBuilder() { - super(); - } - - public UnprocessingSearchBuilder(RankProfileRegistry rankProfileRegistry, - QueryProfileRegistry queryProfileRegistry) { - super(rankProfileRegistry, queryProfileRegistry); - } - - @Override - public void process(Search search, DeployLogger deployLogger, QueryProfiles queryProfiles, boolean validate) { - // empty - } - - public static Search buildUnprocessedFromFile(String fileName) throws IOException, ParseException { - SearchBuilder builder = new UnprocessingSearchBuilder(); - builder.importFile(fileName); - builder.build(); - return builder.getSearch(); - } - -} diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/derived/Deriver.java b/config-model/src/main/java/com/yahoo/searchdefinition/derived/Deriver.java index e6b6c58cb38..133adb45dd9 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/derived/Deriver.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/derived/Deriver.java @@ -3,7 +3,6 @@ package com.yahoo.searchdefinition.derived; import com.yahoo.document.DocumenttypesConfig; import com.yahoo.document.config.DocumentmanagerConfig; import com.yahoo.searchdefinition.SearchBuilder; -import com.yahoo.searchdefinition.UnprocessingSearchBuilder; import com.yahoo.searchdefinition.parser.ParseException; import com.yahoo.vespa.configmodel.producers.DocumentManager; import com.yahoo.vespa.configmodel.producers.DocumentTypes; @@ -18,25 +17,6 @@ import java.util.List; */ public class Deriver { - /** - * Derives only document manager. - * - * - * @param sdFileNames The name of the search definition files to derive from. - * @param toDir The directory to write configuration to. - * @return The list of Search objects, possibly "unproper ones", from sd files containing only document - */ - public static SearchBuilder deriveDocuments(List sdFileNames, String toDir) { - SearchBuilder builder = getUnprocessingSearchBuilder(sdFileNames); - DocumentmanagerConfig.Builder documentManagerCfg = new DocumentManager().produce(builder.getModel(), new DocumentmanagerConfig.Builder()); - try { - DerivedConfiguration.exportDocuments(documentManagerCfg, toDir); - } catch (IOException e) { - throw new IllegalArgumentException(e); - } - return builder; - } - public static SearchBuilder getSearchBuilder(List sds) { SearchBuilder builder = new SearchBuilder(); try { @@ -50,19 +30,6 @@ public class Deriver { return builder; } - public static SearchBuilder getUnprocessingSearchBuilder(List sds) { - SearchBuilder builder = new UnprocessingSearchBuilder(); - try { - for (String s : sds) { - builder.importFile(s); - } - } catch (ParseException | IOException e) { - throw new IllegalArgumentException(e); - } - builder.build(); - return builder; - } - public static DocumentmanagerConfig.Builder getDocumentManagerConfig(String sd) { return getDocumentManagerConfig(Collections.singletonList(sd)); } diff --git a/config-model/src/test/examples/attributeindex.sd b/config-model/src/test/examples/attributeindex.sd deleted file mode 100644 index a35be556467..00000000000 --- a/config-model/src/test/examples/attributeindex.sd +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search attributeindex { - document attributeindex { - - field nosettings type string { - indexing: summary | attribute | index - } - - # Attribute and index have different names - field specifyname type string { - indexing: summary | attribute newname | index - } - - # # index-to: with same name as attribute - field specifyname2 type string { - indexing: summary | attribute newname2 | index - # index-to: newname2 - } - - field withstaticrankname type string { - indexing: summary | attribute | index | attribute someothername - } - } -} diff --git a/config-model/src/test/examples/attributeproperties1.sd b/config-model/src/test/examples/attributeproperties1.sd deleted file mode 100644 index 233e6656866..00000000000 --- a/config-model/src/test/examples/attributeproperties1.sd +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search bolding { - document test { - - # Setting attribute properties for a non-existent attribute should fail - field batchid type int { - indexing: summary | index - attribute { - prefetch - } - } - - # ... but this is OK - field anotherbatchid type int { - indexing: summary | index | attribute - attribute { - prefetch - } - } - } -} diff --git a/config-model/src/test/examples/attributeproperties2.sd b/config-model/src/test/examples/attributeproperties2.sd deleted file mode 100644 index 9c5e3e1a07f..00000000000 --- a/config-model/src/test/examples/attributeproperties2.sd +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search bolding { - document bolding { - - # This is how it usually should be - field anotherbatchid type int { - indexing: summary | index | attribute - attribute { - prefetch - } - attribute: huge - } - - # The attribute is created in the next field - field bar type int { - indexing: summary | index - attribute { - prefetch - } - } - - # Creates attribute for the previous field - field foo type int { - indexing: input bar | attribute bar - } - } -} diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/ArraysTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/ArraysTestCase.java index 76ea16e47aa..846166ae93c 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/ArraysTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/ArraysTestCase.java @@ -12,6 +12,7 @@ import java.io.IOException; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; + /** * tests importing of document containing array type fields * @@ -21,7 +22,7 @@ public class ArraysTestCase extends SearchDefinitionTestCase { @Test public void testArrayImporting() throws IOException, ParseException { - Search search = UnprocessingSearchBuilder.buildUnprocessedFromFile("src/test/examples/arrays.sd"); + Search search = SearchBuilder.buildFromFile("src/test/examples/arrays.sd"); SDField tags = (SDField)search.getDocument().getField("tags"); assertEquals(DataType.STRING, ((CollectionDataType)tags.getDataType()).getNestedType()); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/ReservedWordsAsFieldNamesTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/ReservedWordsAsFieldNamesTestCase.java index 376832c1649..5a5fc1cc312 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/ReservedWordsAsFieldNamesTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/ReservedWordsAsFieldNamesTestCase.java @@ -15,7 +15,7 @@ public class ReservedWordsAsFieldNamesTestCase extends SearchDefinitionTestCase @Test public void testIt() throws IOException, ParseException { - Search search = UnprocessingSearchBuilder.buildUnprocessedFromFile("src/test/examples/reserved_words_as_field_names.sd"); + Search search = SearchBuilder.buildFromFile("src/test/examples/reserved_words_as_field_names.sd"); assertNotNull(search.getDocument().getField("inline")); assertNotNull(search.getDocument().getField("constants")); assertNotNull(search.getDocument().getField("reference")); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/SearchImporterTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/SearchImporterTestCase.java index 82c03c02f61..127ed7a528b 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/SearchImporterTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/SearchImporterTestCase.java @@ -5,7 +5,11 @@ import com.yahoo.config.model.application.provider.BaseDeployLogger; import com.yahoo.document.DataType; import com.yahoo.document.Document; import com.yahoo.search.query.profile.QueryProfileRegistry; -import com.yahoo.searchdefinition.document.*; +import com.yahoo.searchdefinition.document.Attribute; +import com.yahoo.searchdefinition.document.RankType; +import com.yahoo.searchdefinition.document.SDDocumentType; +import com.yahoo.searchdefinition.document.SDField; +import com.yahoo.searchdefinition.document.Stemming; import com.yahoo.searchdefinition.parser.ParseException; import com.yahoo.searchdefinition.processing.MakeAliases; import com.yahoo.vespa.documentmodel.SummaryTransform; @@ -27,7 +31,7 @@ public class SearchImporterTestCase extends SearchDefinitionTestCase { @Test public void testSimpleImporting() throws IOException, ParseException { RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); - SearchBuilder sb = new UnprocessingSearchBuilder(rankProfileRegistry, new QueryProfileRegistry()); + SearchBuilder sb = new SearchBuilder(rankProfileRegistry, new QueryProfileRegistry()); sb.importFile("src/test/examples/simple.sd"); sb.build(); Search search = sb.getSearch(); @@ -36,7 +40,7 @@ public class SearchImporterTestCase extends SearchDefinitionTestCase { SDDocumentType document = search.getDocument(); assertEquals("simple", document.getName()); - assertEquals(12, document.getFieldCount()); + assertEquals(25, document.getFieldCount()); SDField field; Attribute attribute; @@ -46,7 +50,7 @@ public class SearchImporterTestCase extends SearchDefinitionTestCase { // First field field=(SDField) document.getField("title"); assertEquals(DataType.STRING,field.getDataType()); - assertEquals("{ summary | index; }", field.getIndexingScript().toString()); + assertEquals("{ input title | tokenize normalize stem:\"SHORTEST\" | summary title | index title; }", field.getIndexingScript().toString()); assertTrue(!search.getIndex("default").isPrefix()); assertTrue(search.getIndex("title").isPrefix()); Iterator titleAliases=search.getIndex("title").aliasIterator(); @@ -85,7 +89,7 @@ public class SearchImporterTestCase extends SearchDefinitionTestCase { // Fifth field field=(SDField) document.getField("popularity"); - assertEquals("{ attribute; }", + assertEquals("{ input popularity | attribute popularity; }", field.getIndexingScript().toString()); // Sixth field @@ -96,19 +100,19 @@ public class SearchImporterTestCase extends SearchDefinitionTestCase { // Seventh field field= search.getConcreteField("categories"); - assertEquals("{ input categories_src | lowercase | normalize | index; }", + assertEquals("{ input categories_src | lowercase | normalize | tokenize normalize stem:\"SHORTEST\" | index categories; }", field.getIndexingScript().toString()); assertTrue(!field.isHeader()); // Eight field field= search.getConcreteField("categoriesagain"); - assertEquals("{ input categoriesagain_src | lowercase | normalize | index; }", + assertEquals("{ input categoriesagain_src | lowercase | normalize | tokenize normalize stem:\"SHORTEST\" | index categoriesagain; }", field.getIndexingScript().toString()); assertTrue(field.isHeader()); // Ninth field field= search.getConcreteField("exactemento"); - assertEquals("{ input exactemento_src | lowercase | index | summary; }", + assertEquals("{ input exactemento_src | lowercase | tokenize normalize stem:\"SHORTEST\" | index exactemento | summary exactemento; }", field.getIndexingScript().toString()); // Tenth field @@ -153,7 +157,7 @@ public class SearchImporterTestCase extends SearchDefinitionTestCase { assertEquals("exact",exact.getName()); assertEquals(Stemming.NONE,exact.getStemming()); assertTrue(!exact.getNormalizing().doRemoveAccents()); - assertEquals("{ input title . \" \" . input category | summary | index; }", + assertEquals("{ input title . \" \" . input category | tokenize | summary exact | index exact; }", exact.getIndexingScript().toString()); assertEquals(RankType.IDENTITY, exact.getRankType()); } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/StemmingSettingTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/StemmingSettingTestCase.java index 5b95789bea4..defff99d51e 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/StemmingSettingTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/StemmingSettingTestCase.java @@ -20,7 +20,7 @@ public class StemmingSettingTestCase extends SearchDefinitionTestCase { @Test public void testStemmingSettings() throws IOException, ParseException { - Search search = UnprocessingSearchBuilder.buildUnprocessedFromFile("src/test/examples/stemmingsetting.sd"); + Search search = SearchBuilder.buildFromFile("src/test/examples/stemmingsetting.sd"); SDField artist = (SDField)search.getDocument().getField("artist"); assertEquals(Stemming.SHORTEST, artist.getStemming(search)); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/DocumentDeriverTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/DocumentDeriverTestCase.java index 8e0f77c941c..424fa8fd4a9 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/DocumentDeriverTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/DocumentDeriverTestCase.java @@ -16,35 +16,10 @@ import static org.junit.Assert.*; /** * Tests deriving of documentmanager * - * @author Mathias Moelster Lidal + * @author Mathias Moelster Lidal */ public class DocumentDeriverTestCase extends AbstractExportingTestCase { - @Test - public void testDocumentDeriving() { - String root = "src/test/derived/documentderiver/"; - - List files = new ArrayList<>(); - files.add(root + "newsarticle.sd"); - files.add(root + "newssummary.sd"); - files.add(root + "music.sd"); - files.add(root + "mail.sd"); - files.add(root + "compression_header.sd"); - files.add(root + "compression_both.sd"); - files.add(root + "compression_body.sd"); - - File toDir = new File("temp/documentderiver/"); - toDir.mkdir(); - - SearchBuilder builder = Deriver.deriveDocuments(files, toDir.getPath()); - try { - assertEqualFiles(root + "documentmanager.cfg", toDir.getPath() + "/documentmanager.cfg"); - } catch (IOException e) { - throw new RuntimeException("Exception while comparing files", e); - } - SDDocumentType doc = builder.getSearch("newsarticle").getDocument(); - assertNotNull(doc); - } @Test public void testStructTypesNotUsed() { String root = "src/test/derived/documentderiver/"; @@ -55,8 +30,6 @@ public class DocumentDeriverTestCase extends AbstractExportingTestCase { File toDir = new File("temp/structtypesnotused/"); toDir.mkdir(); - Deriver.deriveDocuments(files, toDir.getPath()); - DocumentTypeManager dtm = new DocumentTypeManager(); int numBuiltInTypes = dtm.getDataTypes().size(); dtm.configure("file:" + toDir.getPath() + "/documentmanager.cfg"); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/InheritanceTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/InheritanceTestCase.java index 2833e0ef004..f37a39d6f93 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/InheritanceTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/InheritanceTestCase.java @@ -158,18 +158,4 @@ public class InheritanceTestCase extends AbstractExportingTestCase { assertEquals(new Index("prefixed", true), childSearch.getIndex("prefixed")); } - @Test - public void testFailTypesMismatch() throws IOException, ParseException { - String root = "src/test/derived/inheritancebadtypes/"; - List files = new LinkedList<>(); - files.add(root + "parent.sd"); - files.add(root + "child.sd"); - File toDir = tmpDir.newFolder("to"); - try { - Deriver.deriveDocuments(files, toDir.getPath()); - fail("Import of child SD with type mismatch worked."); - } catch (RuntimeException e) { - assertTrue(e.getMessage().matches(".*already contains field 'a'.*")); - } - } } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/MailTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/MailTestCase.java index 8cf1846ed04..187e766c315 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/MailTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/MailTestCase.java @@ -1,25 +1,13 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.searchdefinition.derived; -import com.yahoo.config.ConfigInstance; -import com.yahoo.document.config.DocumentmanagerConfig; import com.yahoo.searchdefinition.SearchBuilder; -import com.yahoo.searchdefinition.UnprocessingSearchBuilder; import com.yahoo.searchdefinition.parser.ParseException; -import com.yahoo.vespa.model.VespaModel; -import com.yahoo.vespa.model.test.utils.VespaModelCreatorWithFilePkg; import org.junit.Test; -import org.xml.sax.SAXException; - -import java.io.File; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import static org.junit.Assert.assertEquals; /** - * Tests VDS+streaming configuration deriving + * Tests streaming configuration deriving * * @author bratseth */ @@ -33,22 +21,4 @@ public class MailTestCase extends AbstractExportingTestCase { assertCorrectDeriving(sb, dir); } - @Test - public void testMailDocumentsonlyDeriving() { - String root = "src/test/derived/mail/"; - File toDir = new File("temp/documentderiver/"); - if (!toDir.exists()) { - toDir.mkdir(); - } - List files = new ArrayList<>(); - files.add(root + "mail.sd"); - Deriver.deriveDocuments(files, toDir.getPath()); - try { - assertEqualFiles(root + "onlydoc/documentmanager.cfg", - toDir.getPath() + "/documentmanager.cfg"); - } catch (IOException e) { - throw new RuntimeException("Exception while comparing files", e); - } - } - } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/StreamingStructTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/StreamingStructTestCase.java index 1691d463fad..1be9ee3f465 100755 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/StreamingStructTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/StreamingStructTestCase.java @@ -22,18 +22,7 @@ public class StreamingStructTestCase extends AbstractExportingTestCase { @Test public void testStreamingStructExplicitDefaultSummaryClass() throws IOException, ParseException { - // Tests an issue for mail in Vespa 4.1; specific overrides of default summary class assertCorrectDeriving("streamingstructdefault"); } - @Test - public void testStreamingStructDocumentsonlyDeriving() throws IOException { - String root = "src/test/derived/streamingstruct/"; - String temp = "temp/documentderiver/"; - new File(temp).mkdir(); - Deriver.deriveDocuments(Arrays.asList(root + "streamingstruct.sd"), temp); - assertEqualFiles(root + "/onlydoc/documentmanager.cfg", - temp + "/documentmanager.cfg"); - } - } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/AttributeIndexTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/AttributeIndexTestCase.java deleted file mode 100644 index 29ab2d9e8e8..00000000000 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/AttributeIndexTestCase.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.searchdefinition.processing; - -import com.yahoo.searchdefinition.Search; -import com.yahoo.searchdefinition.SearchDefinitionTestCase; -import com.yahoo.searchdefinition.UnprocessingSearchBuilder; -import com.yahoo.searchdefinition.parser.ParseException; -import org.junit.Test; - -import java.io.IOException; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -/** - * Test AttributeIndex processor. - * - * @author hmusum - */ -public class AttributeIndexTestCase extends SearchDefinitionTestCase { - @Test - public void testAttributeIndex() throws IOException, ParseException { - Search search = UnprocessingSearchBuilder.buildUnprocessedFromFile("src/test/examples/attributeindex.sd"); - - assertTrue(search.getConcreteField("nosettings").getAttributes().get("nosettings") != null); - - assertTrue(search.getConcreteField("specifyname").getAttributes().get("newname") != null); - - assertTrue(search.getConcreteField("specifyname2").getAttributes().get("newname2") != null); - - assertTrue(search.getConcreteField("withstaticrankname").getAttributes().get("withstaticrankname") != null); - - assertTrue(search.getConcreteField("withstaticrankname").getAttributes().get("someothername") != null); - } -} diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/AttributePropertiesTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/AttributePropertiesTestCase.java deleted file mode 100644 index 3a0fedfd550..00000000000 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/AttributePropertiesTestCase.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.searchdefinition.processing; - -import com.yahoo.config.model.application.provider.BaseDeployLogger; -import com.yahoo.searchdefinition.RankProfileRegistry; -import com.yahoo.searchdefinition.Search; -import com.yahoo.searchdefinition.SearchDefinitionTestCase; -import com.yahoo.searchdefinition.UnprocessingSearchBuilder; -import com.yahoo.searchdefinition.parser.ParseException; -import com.yahoo.vespa.model.container.search.QueryProfiles; -import org.junit.Test; - -import java.io.IOException; - -import static org.junit.Assert.fail; -/** - * Test AttributeProperties processor. - * - * @author hmusum - */ -public class AttributePropertiesTestCase extends SearchDefinitionTestCase { - - @Test - public void testInvalidAttributeProperties() throws IOException, ParseException { - try { - Search search = UnprocessingSearchBuilder.buildUnprocessedFromFile("src/test/examples/attributeproperties1.sd"); - new AttributeProperties(search, new BaseDeployLogger(), new RankProfileRegistry(), new QueryProfiles()).process(true, false); - fail("attribute property should not be set"); - } catch (RuntimeException e) { - // empty - } - } - - @Test - public void testValidAttributeProperties() throws IOException, ParseException { - Search search = UnprocessingSearchBuilder.buildUnprocessedFromFile("src/test/examples/attributeproperties2.sd"); - new AttributeProperties(search, new BaseDeployLogger(), new RankProfileRegistry(), new QueryProfiles()).process(true, false); - } - -} diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/BoldingTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/BoldingTestCase.java index 1ab8b054cb7..ac3ba1d98d9 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/BoldingTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/BoldingTestCase.java @@ -4,8 +4,8 @@ package com.yahoo.searchdefinition.processing; import com.yahoo.config.model.application.provider.BaseDeployLogger; import com.yahoo.searchdefinition.RankProfileRegistry; import com.yahoo.searchdefinition.Search; +import com.yahoo.searchdefinition.SearchBuilder; import com.yahoo.searchdefinition.SearchDefinitionTestCase; -import com.yahoo.searchdefinition.UnprocessingSearchBuilder; import com.yahoo.searchdefinition.parser.ParseException; import com.yahoo.vespa.model.container.search.QueryProfiles; import org.junit.Test; @@ -23,7 +23,7 @@ public class BoldingTestCase extends SearchDefinitionTestCase { @Test public void testBoldingNonString() throws IOException, ParseException { try { - Search search = UnprocessingSearchBuilder.buildUnprocessedFromFile("src/test/processing/boldnonstring.sd"); + Search search = SearchBuilder.buildFromFile("src/test/processing/boldnonstring.sd"); new Bolding(search, new BaseDeployLogger(), new RankProfileRegistry(), new QueryProfiles()).process(true, false); fail(); } catch (IllegalArgumentException e) { diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/IntegerIndex2AttributeTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/IntegerIndex2AttributeTestCase.java index 29bba224f46..a8ba762b32b 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/IntegerIndex2AttributeTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/IntegerIndex2AttributeTestCase.java @@ -4,8 +4,8 @@ package com.yahoo.searchdefinition.processing; import com.yahoo.config.model.application.provider.BaseDeployLogger; import com.yahoo.searchdefinition.RankProfileRegistry; import com.yahoo.searchdefinition.Search; +import com.yahoo.searchdefinition.SearchBuilder; import com.yahoo.searchdefinition.SearchDefinitionTestCase; -import com.yahoo.searchdefinition.UnprocessingSearchBuilder; import com.yahoo.searchdefinition.document.SDField; import com.yahoo.searchdefinition.parser.ParseException; import com.yahoo.vespa.model.container.search.QueryProfiles; @@ -15,6 +15,7 @@ import java.io.IOException; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; + /** * @author baldersheim */ @@ -22,8 +23,7 @@ public class IntegerIndex2AttributeTestCase extends SearchDefinitionTestCase { @Test public void testIntegerIndex2Attribute() throws IOException, ParseException { - Search search = UnprocessingSearchBuilder.buildUnprocessedFromFile("src/test/examples/integerindex2attribute.sd"); - search.process(); + Search search = SearchBuilder.buildFromFile("src/test/examples/integerindex2attribute.sd"); new IntegerIndex2Attribute(search, new BaseDeployLogger(), new RankProfileRegistry(), new QueryProfiles()).process(true, false); SDField f; diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/SummaryFieldsMustHaveValidSourceTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/SummaryFieldsMustHaveValidSourceTestCase.java index d0c1bf8b0ca..dbcfc8c202d 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/SummaryFieldsMustHaveValidSourceTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/SummaryFieldsMustHaveValidSourceTestCase.java @@ -2,8 +2,11 @@ package com.yahoo.searchdefinition.processing; import com.yahoo.config.model.application.provider.BaseDeployLogger; -import com.yahoo.searchdefinition.*; +import com.yahoo.searchdefinition.RankProfileRegistry; +import com.yahoo.searchdefinition.Search; +import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.SearchDefinitionTestCase; import com.yahoo.searchdefinition.parser.ParseException; import com.yahoo.vespa.model.container.search.QueryProfiles; import org.junit.Test; @@ -11,17 +14,14 @@ import org.junit.Test; import java.io.IOException; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; public class SummaryFieldsMustHaveValidSourceTestCase extends SearchDefinitionTestCase { @Test public void requireThatInvalidSourceIsCaught() throws IOException, ParseException { - Search search = UnprocessingSearchBuilder.buildUnprocessedFromFile("src/test/examples/invalidsummarysource.sd"); - search.process(); try { - new SummaryFieldsMustHaveValidSource(search, new BaseDeployLogger(), new RankProfileRegistry(), new QueryProfiles()).process(true, false); + SearchBuilder.buildFromFile("src/test/examples/invalidsummarysource.sd"); fail("This should throw and never get here"); } catch (IllegalArgumentException e) { assertEquals("For search 'invalidsummarysource', summary class 'baz', summary field 'cox': there is no valid source 'nonexistingfield'.", e.getMessage()); @@ -30,10 +30,8 @@ public class SummaryFieldsMustHaveValidSourceTestCase extends SearchDefinitionTe @Test public void requireThatInvalidImplicitSourceIsCaught() throws IOException, ParseException { - Search search = UnprocessingSearchBuilder.buildUnprocessedFromFile("src/test/examples/invalidimplicitsummarysource.sd"); - search.process(); try { - new SummaryFieldsMustHaveValidSource(search, new BaseDeployLogger(), new RankProfileRegistry(), new QueryProfiles()).process(true, false); + SearchBuilder.buildFromFile("src/test/examples/invalidimplicitsummarysource.sd"); fail("This should throw and never get here"); } catch (IllegalArgumentException e) { assertEquals("For search 'invalidsummarysource', summary class 'baz', summary field 'cox': there is no valid source 'cox'.", e.getMessage()); @@ -42,10 +40,8 @@ public class SummaryFieldsMustHaveValidSourceTestCase extends SearchDefinitionTe @Test public void requireThatInvalidSelfReferingSingleSource() throws IOException, ParseException { - Search search = UnprocessingSearchBuilder.buildUnprocessedFromFile("src/test/examples/invalidselfreferringsummary.sd"); - search.process(); try { - new SummaryFieldsMustHaveValidSource(search, new BaseDeployLogger(), new RankProfileRegistry(), new QueryProfiles()).process(true, false); + SearchBuilder.buildFromFile("src/test/examples/invalidselfreferringsummary.sd"); fail("This should throw and never get here"); } catch (IllegalArgumentException e) { assertEquals("For search 'invalidselfreferringsummary', summary class 'withid', summary field 'w': there is no valid source 'w'.", e.getMessage()); @@ -54,8 +50,7 @@ public class SummaryFieldsMustHaveValidSourceTestCase extends SearchDefinitionTe @Test public void requireThatDocumentIdIsAllowedToPass() throws IOException, ParseException { - Search search = UnprocessingSearchBuilder.buildUnprocessedFromFile("src/test/examples/documentidinsummary.sd"); - search.process(); + Search search = SearchBuilder.buildFromFile("src/test/examples/documentidinsummary.sd"); BaseDeployLogger deployLogger = new BaseDeployLogger(); RankProfileRegistry rankProfileRegistry = new RankProfileRegistry(); new SummaryFieldsMustHaveValidSource(search, deployLogger, rankProfileRegistry, new QueryProfiles()).process(true, false); diff --git a/config/src/main/java/com/yahoo/vespa/config/ConfigVerification.java b/config/src/main/java/com/yahoo/vespa/config/ConfigVerification.java index bd6f5fe99d2..a020c8c8c55 100644 --- a/config/src/main/java/com/yahoo/vespa/config/ConfigVerification.java +++ b/config/src/main/java/com/yahoo/vespa/config/ConfigVerification.java @@ -17,8 +17,7 @@ import java.util.*; /** * Tool to verify that configs across multiple config servers are the same. * - * @author lulf - * @since 5.12 + * @author Ulf Lilleengen */ public class ConfigVerification { private final static int port = 19071; -- cgit v1.2.3 From 49dd0d863af3d5109a709430d5c5944c7974bc79 Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Wed, 19 Sep 2018 09:23:04 -0700 Subject: Rename class --- .../yahoo/searchdefinition/DocumentOnlySearch.java | 26 ++++++++++++++++++ .../com/yahoo/searchdefinition/UnproperSearch.java | 31 ---------------------- .../vespa/model/search/IndexedSearchCluster.java | 4 +-- config-model/src/main/javacc/SDParser.jj | 4 +-- .../yahoo/config/model/ApplicationDeployTest.java | 4 +-- 5 files changed, 32 insertions(+), 37 deletions(-) create mode 100644 config-model/src/main/java/com/yahoo/searchdefinition/DocumentOnlySearch.java delete mode 100644 config-model/src/main/java/com/yahoo/searchdefinition/UnproperSearch.java diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/DocumentOnlySearch.java b/config-model/src/main/java/com/yahoo/searchdefinition/DocumentOnlySearch.java new file mode 100644 index 00000000000..5940f908be8 --- /dev/null +++ b/config-model/src/main/java/com/yahoo/searchdefinition/DocumentOnlySearch.java @@ -0,0 +1,26 @@ +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.searchdefinition; + +import com.yahoo.searchdefinition.document.SDDocumentType; + +/** + * A search that was derived from an sd file containing no search element(s), only + * document specifications, so the name of this is decided by parsing and adding the document instance. + * + * @author vegardh + */ +public class DocumentOnlySearch extends Search { + + public DocumentOnlySearch() { + // empty + } + + @Override + public void addDocument(SDDocumentType docType) { + if (getName() == null) { + setName(docType.getName()); + } + super.addDocument(docType); + } + +} diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/UnproperSearch.java b/config-model/src/main/java/com/yahoo/searchdefinition/UnproperSearch.java deleted file mode 100644 index 71d3db6616b..00000000000 --- a/config-model/src/main/java/com/yahoo/searchdefinition/UnproperSearch.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.searchdefinition; - -import com.yahoo.searchdefinition.document.SDDocumentType; - -/** - * A search that was derived from an sd file containing no search element(s), only - * document specifications. - * - * @author vegardh - * - */ - // Award for best class name goes to ... -public class UnproperSearch extends Search { - // This class exists because the parser accepts SD files without search { ... , and - // there are unit tests using it too, BUT there are many nullpointer bugs if you try to - // deploy such a file. Using this class to try to catch those. - // TODO: Throw away this when we properly support doc-only SD files. - - public UnproperSearch() { - // empty - } - - @Override - public void addDocument(SDDocumentType docType) { - if (getName() == null) { - setName(docType.getName()); - } - super.addDocument(docType); - } -} diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/IndexedSearchCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/search/IndexedSearchCluster.java index c7762f09851..c46a662b682 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/search/IndexedSearchCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/search/IndexedSearchCluster.java @@ -9,7 +9,7 @@ import com.yahoo.vespa.config.search.RankProfilesConfig; import com.yahoo.config.model.producer.AbstractConfigProducer; import com.yahoo.prelude.fastsearch.DocumentdbInfoConfig; import com.yahoo.search.config.IndexInfoConfig; -import com.yahoo.searchdefinition.UnproperSearch; +import com.yahoo.searchdefinition.DocumentOnlySearch; import com.yahoo.searchdefinition.derived.DerivedConfiguration; import com.yahoo.vespa.configdefinition.IlscriptsConfig; import com.yahoo.vespa.model.HostResource; @@ -286,7 +286,7 @@ public class IndexedSearchCluster extends SearchCluster List globalSearches) { for (SearchDefinitionSpec spec : localSearches) { com.yahoo.searchdefinition.Search search = spec.getSearchDefinition().getSearch(); - if ( ! (search instanceof UnproperSearch)) { + if ( ! (search instanceof DocumentOnlySearch)) { DocumentDatabase db = new DocumentDatabase(this, search.getName(), new DerivedConfiguration(search, diff --git a/config-model/src/main/javacc/SDParser.jj b/config-model/src/main/javacc/SDParser.jj index 813d1d47533..c702651b005 100644 --- a/config-model/src/main/javacc/SDParser.jj +++ b/config-model/src/main/javacc/SDParser.jj @@ -40,7 +40,7 @@ import com.yahoo.searchdefinition.RankProfileRegistry; import com.yahoo.searchdefinition.RankProfile.MatchPhaseSettings; import com.yahoo.searchdefinition.RankProfile.DiversitySettings; import com.yahoo.searchdefinition.Search; -import com.yahoo.searchdefinition.UnproperSearch; +import com.yahoo.searchdefinition.DocumentOnlySearch; import com.yahoo.searchdefinition.UnrankedRankProfile; import com.yahoo.searchdefinition.fieldoperation.*; import com.yahoo.searchlib.rankingexpression.FeatureList; @@ -457,7 +457,7 @@ Object rootSearchItem(Search search) : { } */ Search rootDocument(String dir) : { - Search search = new UnproperSearch(); + Search search = new DocumentOnlySearch(); } { ( (rootDocumentItem(search) ()*)* ) diff --git a/config-model/src/test/java/com/yahoo/config/model/ApplicationDeployTest.java b/config-model/src/test/java/com/yahoo/config/model/ApplicationDeployTest.java index 8331ada2271..528393e4135 100644 --- a/config-model/src/test/java/com/yahoo/config/model/ApplicationDeployTest.java +++ b/config-model/src/test/java/com/yahoo/config/model/ApplicationDeployTest.java @@ -14,7 +14,7 @@ import com.yahoo.document.DataType; import com.yahoo.document.config.DocumentmanagerConfig; import com.yahoo.io.IOUtils; import com.yahoo.searchdefinition.Search; -import com.yahoo.searchdefinition.UnproperSearch; +import com.yahoo.searchdefinition.DocumentOnlySearch; import com.yahoo.vespa.config.ConfigDefinition; import com.yahoo.vespa.config.ConfigDefinitionKey; import com.yahoo.vespa.model.VespaModel; @@ -72,7 +72,7 @@ public class ApplicationDeployTest { case "sock": break; case "product": - assertTrue(s instanceof UnproperSearch); + assertTrue(s instanceof DocumentOnlySearch); assertEquals(s.getDocument().getField("title").getDataType(), DataType.STRING); break; default: -- cgit v1.2.3 From 8db2f31a7012f313bfb6ae33ced85bc01702b2b8 Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Wed, 19 Sep 2018 14:30:44 -0700 Subject: Remove test of dead code --- .../derived/DocumentDeriverTestCase.java | 87 ---------------------- .../di/componentgraph/core/ComponentNode.java | 1 + 2 files changed, 1 insertion(+), 87 deletions(-) delete mode 100644 config-model/src/test/java/com/yahoo/searchdefinition/derived/DocumentDeriverTestCase.java diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/DocumentDeriverTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/DocumentDeriverTestCase.java deleted file mode 100644 index 424fa8fd4a9..00000000000 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/DocumentDeriverTestCase.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.searchdefinition.derived; - -import com.yahoo.document.*; -import com.yahoo.searchdefinition.SearchBuilder; -import com.yahoo.searchdefinition.document.SDDocumentType; -import org.junit.Test; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import static org.junit.Assert.*; - -/** - * Tests deriving of documentmanager - * - * @author Mathias Moelster Lidal - */ -public class DocumentDeriverTestCase extends AbstractExportingTestCase { - - @Test - public void testStructTypesNotUsed() { - String root = "src/test/derived/documentderiver/"; - - List files = new ArrayList<>(); - files.add(root + "sombrero.sd"); - - File toDir = new File("temp/structtypesnotused/"); - toDir.mkdir(); - - DocumentTypeManager dtm = new DocumentTypeManager(); - int numBuiltInTypes = dtm.getDataTypes().size(); - dtm.configure("file:" + toDir.getPath() + "/documentmanager.cfg"); - - DocumentType webDocType = dtm.getDocumentType("webdoc"); - assertNotNull(webDocType); - - assertEquals(1, webDocType.fieldSet().size()); - Field html = webDocType.getField("html"); - assertNotNull(html); - assertEquals(DataType.STRING, html.getDataType()); - - assertEquals(numBuiltInTypes + 8, dtm.getDataTypes().size()); - - { - StructDataType keyvalue = (StructDataType) dtm.getDataType("keyvalue"); - assertNotNull(keyvalue); - assertEquals(2, keyvalue.getFields().size()); - Field key = keyvalue.getField("key"); - assertNotNull(key); - assertEquals(DataType.STRING, key.getDataType()); - Field value = keyvalue.getField("value"); - assertNotNull(value); - assertEquals(DataType.STRING, value.getDataType()); - } - { - StructDataType tagvalue = (StructDataType) dtm.getDataType("tagvalue"); - assertNotNull(tagvalue); - assertEquals(2, tagvalue.getFields().size()); - Field name = tagvalue.getField("name"); - assertNotNull(name); - assertEquals(DataType.STRING, name.getDataType()); - Field attributes = tagvalue.getField("attributes"); - assertNotNull(attributes); - assertTrue(attributes.getDataType() instanceof ArrayDataType); - assertEquals(dtm.getDataType("keyvalue"), ((ArrayDataType) attributes.getDataType()).getNestedType()); - } - { - StructDataType wordform = (StructDataType) dtm.getDataType("wordform"); - assertNotNull(wordform); - assertEquals(3, wordform.getFields().size()); - Field kind = wordform.getField("kind"); - assertNotNull(kind); - assertEquals(DataType.INT, kind.getDataType()); - Field form = wordform.getField("form"); - assertNotNull(form); - assertEquals(DataType.STRING, form.getDataType()); - Field weight = wordform.getField("weight"); - assertNotNull(weight); - assertEquals(DataType.FLOAT, weight.getDataType()); - } - - } - -} diff --git a/container-di/src/main/java/com/yahoo/container/di/componentgraph/core/ComponentNode.java b/container-di/src/main/java/com/yahoo/container/di/componentgraph/core/ComponentNode.java index 27298ce6c82..fbc03a38682 100644 --- a/container-di/src/main/java/com/yahoo/container/di/componentgraph/core/ComponentNode.java +++ b/container-di/src/main/java/com/yahoo/container/di/componentgraph/core/ComponentNode.java @@ -36,6 +36,7 @@ import static com.yahoo.container.di.componentgraph.core.Keys.createKey; * @author ollivir */ public class ComponentNode extends Node { + private static final Logger log = Logger.getLogger(ComponentNode.class.getName()); private final Class clazz; -- cgit v1.2.3 From 25bc6859a15bef89593cb094debf4851ac27f5f7 Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Wed, 19 Sep 2018 14:33:42 -0700 Subject: Remove orphan test files --- .../derived/documentderiver/compression_body.sd | 20 -- .../derived/documentderiver/compression_both.sd | 26 -- .../derived/documentderiver/compression_header.sd | 20 -- .../derived/documentderiver/documentmanager.cfg | 394 --------------------- .../src/test/derived/documentderiver/mail.sd | 112 ------ .../src/test/derived/documentderiver/music.sd | 44 --- .../test/derived/documentderiver/newsarticle.sd | 126 ------- .../test/derived/documentderiver/newssummary.sd | 165 --------- .../src/test/derived/documentderiver/sombrero.sd | 36 -- .../src/test/derived/documentderiver/vsmfields.cfg | 390 -------------------- .../test/derived/documentderiver/vsmsummary.cfg | 4 - .../src/test/derived/inheritancebadtypes/child.sd | 8 - .../src/test/derived/inheritancebadtypes/parent.sd | 8 - 13 files changed, 1353 deletions(-) delete mode 100644 config-model/src/test/derived/documentderiver/compression_body.sd delete mode 100644 config-model/src/test/derived/documentderiver/compression_both.sd delete mode 100644 config-model/src/test/derived/documentderiver/compression_header.sd delete mode 100644 config-model/src/test/derived/documentderiver/documentmanager.cfg delete mode 100644 config-model/src/test/derived/documentderiver/mail.sd delete mode 100644 config-model/src/test/derived/documentderiver/music.sd delete mode 100644 config-model/src/test/derived/documentderiver/newsarticle.sd delete mode 100644 config-model/src/test/derived/documentderiver/newssummary.sd delete mode 100644 config-model/src/test/derived/documentderiver/sombrero.sd delete mode 100644 config-model/src/test/derived/documentderiver/vsmfields.cfg delete mode 100644 config-model/src/test/derived/documentderiver/vsmsummary.cfg delete mode 100644 config-model/src/test/derived/inheritancebadtypes/child.sd delete mode 100644 config-model/src/test/derived/inheritancebadtypes/parent.sd diff --git a/config-model/src/test/derived/documentderiver/compression_body.sd b/config-model/src/test/derived/documentderiver/compression_body.sd deleted file mode 100644 index cd114b24017..00000000000 --- a/config-model/src/test/derived/documentderiver/compression_body.sd +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search compressed_body { - - document compressed_body { - body { - compression { - level:6 - } - } - - field from type string { - } - - field content type string { - body - } - } - -} - diff --git a/config-model/src/test/derived/documentderiver/compression_both.sd b/config-model/src/test/derived/documentderiver/compression_both.sd deleted file mode 100644 index 577aef702d3..00000000000 --- a/config-model/src/test/derived/documentderiver/compression_both.sd +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search compressed_both { - - document compressed_both { - compression { - threshold:90 - level:9 - } - - header { - compression { - threshold:50 - level:6 - } - } - - field from type string { - } - - field content type string { - body - } - } - -} - diff --git a/config-model/src/test/derived/documentderiver/compression_header.sd b/config-model/src/test/derived/documentderiver/compression_header.sd deleted file mode 100644 index 6ff951b34cb..00000000000 --- a/config-model/src/test/derived/documentderiver/compression_header.sd +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search compressed_header { - - document compressed_header { - header { - compression { - level:9 - } - } - - field from type string { - } - - field content type string { - body - } - } - -} - diff --git a/config-model/src/test/derived/documentderiver/documentmanager.cfg b/config-model/src/test/derived/documentderiver/documentmanager.cfg deleted file mode 100644 index 2ab99b75aef..00000000000 --- a/config-model/src/test/derived/documentderiver/documentmanager.cfg +++ /dev/null @@ -1,394 +0,0 @@ -enablecompression false -datatype[].id 1381038251 -datatype[].structtype[].name "position" -datatype[].structtype[].version 0 -datatype[].structtype[].compresstype NONE -datatype[].structtype[].compresslevel 0 -datatype[].structtype[].compressthreshold 95 -datatype[].structtype[].compressminsize 800 -datatype[].structtype[].field[].name "x" -datatype[].structtype[].field[].datatype 0 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "y" -datatype[].structtype[].field[].datatype 0 -datatype[].structtype[].field[].detailedtype "" -datatype[].id -843666531 -datatype[].structtype[].name "compressed_body.header" -datatype[].structtype[].version 0 -datatype[].structtype[].compresstype NONE -datatype[].structtype[].compresslevel 0 -datatype[].structtype[].compressthreshold 95 -datatype[].structtype[].compressminsize 800 -datatype[].structtype[].field[].name "from" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].id 1704844530 -datatype[].structtype[].name "compressed_body.body" -datatype[].structtype[].version 0 -datatype[].structtype[].compresstype LZ4 -datatype[].structtype[].compresslevel 6 -datatype[].structtype[].compressthreshold 95 -datatype[].structtype[].compressminsize 0 -datatype[].structtype[].field[].name "content" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].id 1417245026 -datatype[].documenttype[].name "compressed_body" -datatype[].documenttype[].version 0 -datatype[].documenttype[].inherits[].name "document" -datatype[].documenttype[].inherits[].version 0 -datatype[].documenttype[].headerstruct -843666531 -datatype[].documenttype[].bodystruct 1704844530 -datatype[].id -484354914 -datatype[].structtype[].name "compressed_both.header" -datatype[].structtype[].version 0 -datatype[].structtype[].compresstype LZ4 -datatype[].structtype[].compresslevel 6 -datatype[].structtype[].compressthreshold 50 -datatype[].structtype[].compressminsize 0 -datatype[].structtype[].field[].name "from" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].id -1007627725 -datatype[].structtype[].name "compressed_both.body" -datatype[].structtype[].version 0 -datatype[].structtype[].compresstype LZ4 -datatype[].structtype[].compresslevel 9 -datatype[].structtype[].compressthreshold 90 -datatype[].structtype[].compressminsize 0 -datatype[].structtype[].field[].name "content" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].id 1417705345 -datatype[].documenttype[].name "compressed_both" -datatype[].documenttype[].version 0 -datatype[].documenttype[].inherits[].name "document" -datatype[].documenttype[].inherits[].version 0 -datatype[].documenttype[].headerstruct -484354914 -datatype[].documenttype[].bodystruct -1007627725 -datatype[].id -940182894 -datatype[].structtype[].name "compressed_header.header" -datatype[].structtype[].version 0 -datatype[].structtype[].compresstype LZ4 -datatype[].structtype[].compresslevel 9 -datatype[].structtype[].compressthreshold 95 -datatype[].structtype[].compressminsize 0 -datatype[].structtype[].field[].name "from" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].id -579052249 -datatype[].structtype[].name "compressed_header.body" -datatype[].structtype[].version 0 -datatype[].structtype[].compresstype NONE -datatype[].structtype[].compresslevel 0 -datatype[].structtype[].compressthreshold 95 -datatype[].structtype[].compressminsize 800 -datatype[].structtype[].field[].name "content" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].id 1946084365 -datatype[].documenttype[].name "compressed_header" -datatype[].documenttype[].version 0 -datatype[].documenttype[].inherits[].name "document" -datatype[].documenttype[].inherits[].version 0 -datatype[].documenttype[].headerstruct -940182894 -datatype[].documenttype[].bodystruct -579052249 -datatype[].id -88808602 -datatype[].structtype[].name "mail.header" -datatype[].structtype[].version 0 -datatype[].structtype[].compresstype NONE -datatype[].structtype[].compresslevel 0 -datatype[].structtype[].compressthreshold 95 -datatype[].structtype[].compressminsize 800 -datatype[].structtype[].field[].name "URI" -datatype[].structtype[].field[].datatype 10 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "mailid" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "date" -datatype[].structtype[].field[].datatype 0 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "from" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "replyto" -datatype[].structtype[].field[].datatype 3 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "to" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "cc" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "bcc" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "subject" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].id -1244861287 -datatype[].arraytype[].datatype 3 -datatype[].id -953584901 -datatype[].structtype[].name "mail.body" -datatype[].structtype[].version 0 -datatype[].structtype[].compresstype NONE -datatype[].structtype[].compresslevel 0 -datatype[].structtype[].compressthreshold 95 -datatype[].structtype[].compressminsize 800 -datatype[].structtype[].field[].name "mailbody" -datatype[].structtype[].field[].datatype 3 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "attachmentcount" -datatype[].structtype[].field[].datatype 0 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "attachmentnames" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "attachmenttypes" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "attachmentlanguages" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "attachmentcontent" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "attachments" -datatype[].structtype[].field[].datatype -1244861287 -datatype[].structtype[].field[].detailedtype "" -datatype[].id -1081574983 -datatype[].documenttype[].name "mail" -datatype[].documenttype[].version 0 -datatype[].documenttype[].inherits[].name "document" -datatype[].documenttype[].inherits[].version 0 -datatype[].documenttype[].headerstruct -88808602 -datatype[].documenttype[].bodystruct -953584901 -datatype[].id -1486737430 -datatype[].arraytype[].datatype 2 -datatype[].id 519906144 -datatype[].weightedsettype[].datatype 0 -datatype[].weightedsettype[].createifnonexistant false -datatype[].weightedsettype[].removeifzero false -datatype[].id 363959257 -datatype[].weightedsettype[].datatype 0 -datatype[].weightedsettype[].createifnonexistant true -datatype[].weightedsettype[].removeifzero true -datatype[].id -1910204744 -datatype[].structtype[].name "music.header" -datatype[].structtype[].version 0 -datatype[].structtype[].compresstype NONE -datatype[].structtype[].compresslevel 0 -datatype[].structtype[].compressthreshold 95 -datatype[].structtype[].compressminsize 800 -datatype[].structtype[].field[].name "url" -datatype[].structtype[].field[].datatype 10 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "title" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "artist" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "year" -datatype[].structtype[].field[].datatype 0 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "description" -datatype[].structtype[].field[].datatype 3 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "tracks" -datatype[].structtype[].field[].datatype -1486737430 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "popularity" -datatype[].structtype[].field[].datatype 519906144 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "popularity2" -datatype[].structtype[].field[].datatype 363959257 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "popularity3" -datatype[].structtype[].field[].datatype 363959257 -datatype[].structtype[].field[].detailedtype "" -datatype[].id 993120973 -datatype[].structtype[].name "music.body" -datatype[].structtype[].version 0 -datatype[].structtype[].compresstype NONE -datatype[].structtype[].compresslevel 0 -datatype[].structtype[].compressthreshold 95 -datatype[].structtype[].compressminsize 800 -datatype[].id 1412693671 -datatype[].documenttype[].name "music" -datatype[].documenttype[].version 0 -datatype[].documenttype[].inherits[].name "document" -datatype[].documenttype[].inherits[].version 0 -datatype[].documenttype[].headerstruct -1910204744 -datatype[].documenttype[].bodystruct 993120973 -datatype[].id 2006483754 -datatype[].structtype[].name "newssummary.header" -datatype[].structtype[].version 0 -datatype[].structtype[].compresstype NONE -datatype[].structtype[].compresslevel 0 -datatype[].structtype[].compressthreshold 95 -datatype[].structtype[].compressminsize 800 -datatype[].structtype[].field[].name "title" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "abstract" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "sourcename" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "providername" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "thumburl" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "thumbwidth" -datatype[].structtype[].field[].datatype 0 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "thumbheight" -datatype[].structtype[].field[].datatype 0 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "language" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "crawldocid" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "url" -datatype[].structtype[].field[].datatype 10 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "sourceurl" -datatype[].structtype[].field[].datatype 10 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "categories" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "pubdate" -datatype[].structtype[].field[].datatype 4 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "expdate" -datatype[].structtype[].field[].datatype 4 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "fingerprint" -datatype[].structtype[].field[].datatype 0 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "debug" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "attributes" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "searchcluster" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "eustaticrank" -datatype[].structtype[].field[].datatype 0 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "usstaticrank" -datatype[].structtype[].field[].datatype 0 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "asiastaticrank" -datatype[].structtype[].field[].datatype 0 -datatype[].structtype[].field[].detailedtype "" -datatype[].id -2059783233 -datatype[].structtype[].name "newssummary.body" -datatype[].structtype[].version 0 -datatype[].structtype[].compresstype NONE -datatype[].structtype[].compresslevel 0 -datatype[].structtype[].compressthreshold 95 -datatype[].structtype[].compressminsize 800 -datatype[].id -756330891 -datatype[].documenttype[].name "newssummary" -datatype[].documenttype[].version 0 -datatype[].documenttype[].inherits[].name "document" -datatype[].documenttype[].inherits[].version 0 -datatype[].documenttype[].headerstruct 2006483754 -datatype[].documenttype[].bodystruct -2059783233 -datatype[].id 2098419674 -datatype[].structtype[].name "newsarticle.header" -datatype[].structtype[].version 0 -datatype[].structtype[].compresstype NONE -datatype[].structtype[].compresslevel 0 -datatype[].structtype[].compressthreshold 95 -datatype[].structtype[].compressminsize 800 -datatype[].structtype[].field[].name "dynabstract" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "othersourcenames" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "author" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "otherlanguages" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "charset" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "mimetype" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "referrerurl" -datatype[].structtype[].field[].datatype 10 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "sourcelocation" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "sourcecountry" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "sourcelocale" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "sourcecontinent" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "articlecountry" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "articlelocale" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "articlecontinent" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "sourcerank" -datatype[].structtype[].field[].datatype 0 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "crawldate" -datatype[].structtype[].field[].datatype 4 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "indexdate" -datatype[].structtype[].field[].datatype 4 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "procdate" -datatype[].structtype[].field[].datatype 4 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "sourceid" -datatype[].structtype[].field[].datatype 0 -datatype[].structtype[].field[].detailedtype "" -datatype[].structtype[].field[].name "sourcefeedid" -datatype[].structtype[].field[].datatype 0 -datatype[].structtype[].field[].detailedtype "" -datatype[].id 197293167 -datatype[].structtype[].name "newsarticle.body" -datatype[].structtype[].version 0 -datatype[].structtype[].compresstype NONE -datatype[].structtype[].compresslevel 0 -datatype[].structtype[].compressthreshold 95 -datatype[].structtype[].compressminsize 800 -datatype[].structtype[].field[].name "body" -datatype[].structtype[].field[].datatype 2 -datatype[].structtype[].field[].detailedtype "" -datatype[].id -1710661691 -datatype[].documenttype[].name "newsarticle" -datatype[].documenttype[].version 0 -datatype[].documenttype[].inherits[].name "document" -datatype[].documenttype[].inherits[].version 0 -datatype[].documenttype[].inherits[].name "newssummary" -datatype[].documenttype[].inherits[].version 0 -datatype[].documenttype[].headerstruct 2098419674 -datatype[].documenttype[].bodystruct 197293167 diff --git a/config-model/src/test/derived/documentderiver/mail.sd b/config-model/src/test/derived/documentderiver/mail.sd deleted file mode 100644 index 87bf8bada45..00000000000 --- a/config-model/src/test/derived/documentderiver/mail.sd +++ /dev/null @@ -1,112 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search mail { - - stemming: none - - document mail { - - field URI type uri { - indexing: summary - summary-to: default, mailid - } - - field mailid type string { - indexing: summary | index - match: prefix - summary-to: default, mailid - } - - field date type int { - indexing: summary | attribute | index - match: prefix - } - - field from type string { - indexing: summary | index - # index-to: from, sender, address, header, default, all - match: prefix - } - - field replyto type raw { - indexing: summary | index - # index-to: replyto - match: prefix - } - - field to type string { - indexing: summary | index - # index-to: to, recipient, address, header, default, all - match: prefix - } - - field cc type string { - indexing: index - # index-to: cc, recipient, address, header, default, all - match: prefix - } - - field bcc type string { - indexing: index - # index-to: bcc - match: prefix - } - - field subject type string { - indexing: summary | index - # index-to: subject, header, default, all - match: prefix - } - - field mailbody type raw { - indexing: summary | index - # index-to: mailbody, default, all - match: substring - body - } - - field attachmentcount type int { - indexing: summary | index - body - } - - field attachmentnames type string { - indexing: index - # index-to: attachmentname, all - body - } - - field attachmenttypes type string { - indexing: index - # index-to: attachmenttype, all - body - } - - field attachmentlanguages type string { - indexing: index - match: prefix - body - } - - field attachmentcontent type string { - indexing: summary | index - # index-to: attachment, all - match: prefix - body - } - - field attachments type raw[] { - body - } - - } - - document-summary default { - summary snippet type string { - dynamic - source: body, attachmentcontent - } - - } - -} - diff --git a/config-model/src/test/derived/documentderiver/music.sd b/config-model/src/test/derived/documentderiver/music.sd deleted file mode 100644 index a412d510861..00000000000 --- a/config-model/src/test/derived/documentderiver/music.sd +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search music { - - document music { - - # Link to album main page - field url type uri { } - - # Title of album - field title type string { } - - # Album artist - field artist type string { } - - # Album production year - field year type int { } - - # Album description - about the album - field description type raw { } - - # Names of the album tracks - field tracks type array { } - - # How many have given this album the grade 0/1/2/3 - field popularity type weightedset { } - - # How many have given this album the grade 0/1/2/3 - field popularity2 type weightedset { - weightedset: create-if-nonexistent - weightedset: remove-if-zero - } - - # How many have given this album the grade 0/1/2/3 - field popularity3 type weightedset { - weightedset { - create-if-nonexistent - remove-if-zero - } - } - - } - -} - diff --git a/config-model/src/test/derived/documentderiver/newsarticle.sd b/config-model/src/test/derived/documentderiver/newsarticle.sd deleted file mode 100644 index d31c309726e..00000000000 --- a/config-model/src/test/derived/documentderiver/newsarticle.sd +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search newsarticle { - - document newsarticle inherits newssummary { - - field dynabstract type string { - indexing: summary - } - - field body type string { - body - indexing: summary | index - # index-to: body, default - stemming: none - } - - field othersourcenames type string { - indexing: summary | index - # index-to: othersourcenames, source - stemming: none - } - - field author type string { - indexing: summary | index - stemming: none - } - - field otherlanguages type string { - indexing: summary | index - # index-to: languages - stemming: none - } - - field charset type string { - indexing: summary - stemming: none - } - - field mimetype type string { - indexing: summary - stemming: none - } - - field referrerurl type uri { - indexing: summary | lowercase | tokenize | index - stemming: none - } - - field sourcelocation type string { - indexing: summary | index - stemming: none - alias: location - } - - field sourcecountry type string { - indexing: summary | index - stemming: none - # index-to: sourcecountry, sourcelocation - } - - field sourcelocale type string { - indexing: summary | index - stemming: none - # index-to: sourcelocale, sourcelocation - } - - field sourcecontinent type string { - indexing: summary | index - stemming: none - # index-to: sourcecontinent, sourcelocation - } - - field articlecountry type string { - indexing: summary | index - stemming: none - } - - field articlelocale type string { - indexing: summary | index - stemming: none - } - - field articlecontinent type string { - indexing: summary | index - stemming: none - } - - field sourcerank type int { - indexing: summary | index | set_var tmpsourcerank - } - - field crawldate type long { - indexing: summary | index - } - - field indexdate type long { - indexing: now | summary | index - } - - field procdate type long { - indexing: summary | index - } - - field sourceid type int { - indexing: summary | index - } - - field sourcefeedid type int { - indexing: summary | index - } - - } - - rank-profile date { - } - - rank-profile usrank inherits default { - } - - rank-profile eurank inherits default { - } - - rank-profile asiarank inherits default { - } - -} diff --git a/config-model/src/test/derived/documentderiver/newssummary.sd b/config-model/src/test/derived/documentderiver/newssummary.sd deleted file mode 100644 index c0fcf8c2d85..00000000000 --- a/config-model/src/test/derived/documentderiver/newssummary.sd +++ /dev/null @@ -1,165 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search newssummary { - - document newssummary { - - field title type string { - indexing: summary | index - # index-to: title, titleabstract, default - stemming: none - alias: headline - } - - field abstract type string { - indexing: summary | index - # index-to: abstract, titleabstract, default - stemming: none - } - - field sourcename type string { - indexing: summary | index - # index-to: sourcename, source - stemming: none - } - - field providername type string { - indexing: summary | index - # index-to: providername, source - stemming: none - alias: provider - } - - field thumburl type string { - indexing: summary | lowercase | tokenize | index - stemming: none - } - - field thumbwidth type int { - indexing: summary | index - } - - field thumbheight type int { - indexing: summary | index - } - - field language type string { - indexing: summary | index - # index-to: language, languages - stemming: none - } - - field crawldocid type string { - indexing: summary - stemming: none - } - - field url type uri { - indexing: summary | lowercase | tokenize | index - stemming: none - } - - field sourceurl type uri { - indexing: summary | lowercase | tokenize | index - stemming: none - } - - field categories type string { - indexing: summary | index - stemming: none - alias: category - alias: cat - } - - field pubdate type long { - indexing: summary | index | attribute pubdate | set_var tmppubdate - alias: date - } - - field expdate type long { - indexing: summary | index - } - - field fingerprint type int { - indexing: summary | index - } - - field debug type string { - indexing { - - # Initialize variables used for superduper ranking - 0 | set_var superduperus | set_var superdupereu | set_var superduperasia; - - input debug | lowercase | summary | normalize | tokenize | index; - input debug | lowercase | split ";" | for_each { - # Loop through each token in debug string - switch { - case "superduperus": 10 | set_var superduperus; - case "superdupereu": 10 | set_var superdupereu; - case "superduperasia": 10 | set_var superduperasia; - } - }; - } - indexing-rewrite: none - stemming: none - } - - field attributes type string { - indexing { - - # Initialize variables used for superduper ranking - 1 | set_var superdupermod; - - input attributes | lowercase | summary | normalize | tokenize | index; - input attributes | lowercase | split ";" | for_each { - # Loop through each token in attributes string - switch { - - # De-rank PR articles using the following rules: - # 1. Set editedstaticrank to '1' - # 2. Subtract 2.5 hours (9000 seconds) from timestamp used in ranking - # 3. No superduper rank - case "typepr": 1 | set_var tmpsourcerank | get_var tmppubdate - 9000 | set_var tmppubdate | 0 | set_var superdupermod; - } - }; - } - indexing-rewrite: none - stemming: none - } - - field searchcluster type string { - indexing: summary - stemming: none - } - - field eustaticrank type int { - indexing { - get_var tmpsourcerank * 4000 + get_var superdupereu * get_var superdupermod * 1000 + get_var tmppubdate * 0.5 | summary | index | attribute eustaticrank; - } - } - - field usstaticrank type int { - indexing { - get_var tmpsourcerank * 4000 + get_var superduperus * get_var superdupermod * 1000 + get_var tmppubdate * 0.5 | summary | index | attribute usstaticrank; - } - } - - field asiastaticrank type int { - indexing { - get_var tmpsourcerank * 4000 + get_var superduperasia * get_var superdupermod * 1000 + get_var tmppubdate * 0.5 | summary | index | attribute asiastaticrank; - } - } - } - - rank-profile date { - } - - rank-profile usrank inherits default { - } - - rank-profile eurank inherits default { - } - - rank-profile asiarank inherits default { - } - -} diff --git a/config-model/src/test/derived/documentderiver/sombrero.sd b/config-model/src/test/derived/documentderiver/sombrero.sd deleted file mode 100644 index 00bd80bc42a..00000000000 --- a/config-model/src/test/derived/documentderiver/sombrero.sd +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search webdoc { - document webdoc { - # - # a simple key-value pair - # - struct keyvalue { - field key type string {} - field value type string {} - } - - # - # tags have a name and an array of attributes - # - struct tagvalue { - field name type string {} - # todo: this should be a map of attributes, not an array - field attributes type array {} - } - - # - # wordforms are (kind, form, weight) triplets - # todo: "kind" should be an enum; check how enums are used. - # - struct wordform { - field kind type int {} - field form type string {} - field weight type float {} - } - - # - # web documents have zero or more HTML source strings - # - field html type string {} - } -} diff --git a/config-model/src/test/derived/documentderiver/vsmfields.cfg b/config-model/src/test/derived/documentderiver/vsmfields.cfg deleted file mode 100644 index cd8bc659398..00000000000 --- a/config-model/src/test/derived/documentderiver/vsmfields.cfg +++ /dev/null @@ -1,390 +0,0 @@ -fieldspec[].name sddocname -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "exact" -fieldspec[].name title -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name abstract -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name sourcename -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name providername -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name thumburl -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name thumbwidth -fieldspec[].searchmethod INT32 -fieldspec[].arg1 "" -fieldspec[].name thumbheight -fieldspec[].searchmethod INT32 -fieldspec[].arg1 "" -fieldspec[].name language -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name crawldocid -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name url -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name sourceurl -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name categories -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name pubdate -fieldspec[].searchmethod INT64 -fieldspec[].arg1 "" -fieldspec[].name expdate -fieldspec[].searchmethod INT64 -fieldspec[].arg1 "" -fieldspec[].name fingerprint -fieldspec[].searchmethod INT32 -fieldspec[].arg1 "" -fieldspec[].name debug -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name attributes -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name searchcluster -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name eustaticrank -fieldspec[].searchmethod INT32 -fieldspec[].arg1 "" -fieldspec[].name usstaticrank -fieldspec[].searchmethod INT32 -fieldspec[].arg1 "" -fieldspec[].name asiastaticrank -fieldspec[].searchmethod INT32 -fieldspec[].arg1 "" -fieldspec[].name dynabstract -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name body -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name othersourcenames -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name author -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name otherlanguages -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name charset -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name mimetype -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name referrerurl -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name sourcelocation -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name sourcecountry -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name sourcelocale -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name sourcecontinent -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name articlecountry -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name articlelocale -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name articlecontinent -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name sourcerank -fieldspec[].searchmethod INT32 -fieldspec[].arg1 "" -fieldspec[].name crawldate -fieldspec[].searchmethod INT64 -fieldspec[].arg1 "" -fieldspec[].name indexdate -fieldspec[].searchmethod INT64 -fieldspec[].arg1 "" -fieldspec[].name procdate -fieldspec[].searchmethod INT64 -fieldspec[].arg1 "" -fieldspec[].name sourceid -fieldspec[].searchmethod INT32 -fieldspec[].arg1 "" -fieldspec[].name sourcefeedid -fieldspec[].searchmethod INT32 -fieldspec[].arg1 "" -fieldspec[].name URI -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name mailid -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "prefix" -fieldspec[].name date -fieldspec[].searchmethod INT32 -fieldspec[].arg1 "" -fieldspec[].name from -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "prefix" -fieldspec[].name replyto -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "prefix" -fieldspec[].name to -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "prefix" -fieldspec[].name cc -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "prefix" -fieldspec[].name bcc -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "prefix" -fieldspec[].name subject -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "prefix" -fieldspec[].name mailbody -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "substring" -fieldspec[].name attachmentcount -fieldspec[].searchmethod INT32 -fieldspec[].arg1 "" -fieldspec[].name attachmentnames -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name attachmenttypes -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "" -fieldspec[].name attachmentlanguages -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "prefix" -fieldspec[].name attachmentcontent -fieldspec[].searchmethod AUTOUTF8 -fieldspec[].arg1 "prefix" -documenttype[].name newssummary -documenttype[].index[].name sddocname -documenttype[].index[].field[].name sddocname -documenttype[].index[].name title -documenttype[].index[].field[].name title -documenttype[].index[].name titleabstract -documenttype[].index[].field[].name title -documenttype[].index[].field[].name abstract -documenttype[].index[].name default -documenttype[].index[].field[].name title -documenttype[].index[].field[].name abstract -documenttype[].index[].name abstract -documenttype[].index[].field[].name abstract -documenttype[].index[].name sourcename -documenttype[].index[].field[].name sourcename -documenttype[].index[].name source -documenttype[].index[].field[].name sourcename -documenttype[].index[].field[].name providername -documenttype[].index[].name providername -documenttype[].index[].field[].name providername -documenttype[].index[].name thumburl -documenttype[].index[].field[].name thumburl -documenttype[].index[].name thumbwidth -documenttype[].index[].field[].name thumbwidth -documenttype[].index[].name thumbheight -documenttype[].index[].field[].name thumbheight -documenttype[].index[].name language -documenttype[].index[].field[].name language -documenttype[].index[].name languages -documenttype[].index[].field[].name language -documenttype[].index[].name url -documenttype[].index[].field[].name url -documenttype[].index[].name sourceurl -documenttype[].index[].field[].name sourceurl -documenttype[].index[].name categories -documenttype[].index[].field[].name categories -documenttype[].index[].name pubdate -documenttype[].index[].field[].name pubdate -documenttype[].index[].name expdate -documenttype[].index[].field[].name expdate -documenttype[].index[].name fingerprint -documenttype[].index[].field[].name fingerprint -documenttype[].index[].name debug -documenttype[].index[].field[].name debug -documenttype[].index[].name attributes -documenttype[].index[].field[].name attributes -documenttype[].index[].name eustaticrank -documenttype[].index[].field[].name eustaticrank -documenttype[].index[].name usstaticrank -documenttype[].index[].field[].name usstaticrank -documenttype[].index[].name asiastaticrank -documenttype[].index[].field[].name asiastaticrank -documenttype[].name newsarticle -documenttype[].index[].name sddocname -documenttype[].index[].field[].name sddocname -documenttype[].index[].name title -documenttype[].index[].field[].name title -documenttype[].index[].name titleabstract -documenttype[].index[].field[].name title -documenttype[].index[].field[].name abstract -documenttype[].index[].name default -documenttype[].index[].field[].name title -documenttype[].index[].field[].name abstract -documenttype[].index[].field[].name body -documenttype[].index[].name abstract -documenttype[].index[].field[].name abstract -documenttype[].index[].name sourcename -documenttype[].index[].field[].name sourcename -documenttype[].index[].name source -documenttype[].index[].field[].name sourcename -documenttype[].index[].field[].name providername -documenttype[].index[].field[].name othersourcenames -documenttype[].index[].name providername -documenttype[].index[].field[].name providername -documenttype[].index[].name thumburl -documenttype[].index[].field[].name thumburl -documenttype[].index[].name thumbwidth -documenttype[].index[].field[].name thumbwidth -documenttype[].index[].name thumbheight -documenttype[].index[].field[].name thumbheight -documenttype[].index[].name language -documenttype[].index[].field[].name language -documenttype[].index[].name languages -documenttype[].index[].field[].name language -documenttype[].index[].field[].name otherlanguages -documenttype[].index[].name url -documenttype[].index[].field[].name url -documenttype[].index[].name sourceurl -documenttype[].index[].field[].name sourceurl -documenttype[].index[].name categories -documenttype[].index[].field[].name categories -documenttype[].index[].name pubdate -documenttype[].index[].field[].name pubdate -documenttype[].index[].name expdate -documenttype[].index[].field[].name expdate -documenttype[].index[].name fingerprint -documenttype[].index[].field[].name fingerprint -documenttype[].index[].name debug -documenttype[].index[].field[].name debug -documenttype[].index[].name attributes -documenttype[].index[].field[].name attributes -documenttype[].index[].name eustaticrank -documenttype[].index[].field[].name eustaticrank -documenttype[].index[].name usstaticrank -documenttype[].index[].field[].name usstaticrank -documenttype[].index[].name asiastaticrank -documenttype[].index[].field[].name asiastaticrank -documenttype[].index[].name body -documenttype[].index[].field[].name body -documenttype[].index[].name othersourcenames -documenttype[].index[].field[].name othersourcenames -documenttype[].index[].name author -documenttype[].index[].field[].name author -documenttype[].index[].name referrerurl -documenttype[].index[].field[].name referrerurl -documenttype[].index[].name sourcelocation -documenttype[].index[].field[].name sourcelocation -documenttype[].index[].field[].name sourcecountry -documenttype[].index[].field[].name sourcelocale -documenttype[].index[].field[].name sourcecontinent -documenttype[].index[].name sourcecountry -documenttype[].index[].field[].name sourcecountry -documenttype[].index[].name sourcelocale -documenttype[].index[].field[].name sourcelocale -documenttype[].index[].name sourcecontinent -documenttype[].index[].field[].name sourcecontinent -documenttype[].index[].name articlecountry -documenttype[].index[].field[].name articlecountry -documenttype[].index[].name articlelocale -documenttype[].index[].field[].name articlelocale -documenttype[].index[].name articlecontinent -documenttype[].index[].field[].name articlecontinent -documenttype[].index[].name sourcerank -documenttype[].index[].field[].name sourcerank -documenttype[].index[].name crawldate -documenttype[].index[].field[].name crawldate -documenttype[].index[].name indexdate -documenttype[].index[].field[].name indexdate -documenttype[].index[].name procdate -documenttype[].index[].field[].name procdate -documenttype[].index[].name sourceid -documenttype[].index[].field[].name sourceid -documenttype[].index[].name sourcefeedid -documenttype[].index[].field[].name sourcefeedid -documenttype[].name music -documenttype[].index[].name sddocname -documenttype[].index[].field[].name sddocname -documenttype[].name mail -documenttype[].index[].name sddocname -documenttype[].index[].field[].name sddocname -documenttype[].index[].name mailid -documenttype[].index[].field[].name mailid -documenttype[].index[].name date -documenttype[].index[].field[].name date -documenttype[].index[].name from -documenttype[].index[].field[].name from -documenttype[].index[].name sender -documenttype[].index[].field[].name from -documenttype[].index[].name address -documenttype[].index[].field[].name from -documenttype[].index[].field[].name to -documenttype[].index[].field[].name cc -documenttype[].index[].name header -documenttype[].index[].field[].name from -documenttype[].index[].field[].name to -documenttype[].index[].field[].name cc -documenttype[].index[].field[].name subject -documenttype[].index[].name default -documenttype[].index[].field[].name from -documenttype[].index[].field[].name to -documenttype[].index[].field[].name cc -documenttype[].index[].field[].name subject -documenttype[].index[].field[].name mailbody -documenttype[].index[].name all -documenttype[].index[].field[].name from -documenttype[].index[].field[].name to -documenttype[].index[].field[].name cc -documenttype[].index[].field[].name subject -documenttype[].index[].field[].name mailbody -documenttype[].index[].field[].name attachmentnames -documenttype[].index[].field[].name attachmenttypes -documenttype[].index[].field[].name attachmentcontent -documenttype[].index[].name replyto -documenttype[].index[].field[].name replyto -documenttype[].index[].name to -documenttype[].index[].field[].name to -documenttype[].index[].name recipient -documenttype[].index[].field[].name to -documenttype[].index[].field[].name cc -documenttype[].index[].name cc -documenttype[].index[].field[].name cc -documenttype[].index[].name bcc -documenttype[].index[].field[].name bcc -documenttype[].index[].name subject -documenttype[].index[].field[].name subject -documenttype[].index[].name mailbody -documenttype[].index[].field[].name mailbody -documenttype[].index[].name attachmentcount -documenttype[].index[].field[].name attachmentcount -documenttype[].index[].name attachmentname -documenttype[].index[].field[].name attachmentnames -documenttype[].index[].name attachmenttype -documenttype[].index[].field[].name attachmenttypes -documenttype[].index[].name attachmentlanguages -documenttype[].index[].field[].name attachmentlanguages -documenttype[].index[].name attachment -documenttype[].index[].field[].name attachmentcontent -documenttype[].name compressed_header -documenttype[].index[].name sddocname -documenttype[].index[].field[].name sddocname -documenttype[].name compressed_both -documenttype[].index[].name sddocname -documenttype[].index[].field[].name sddocname -documenttype[].name compressed_body -documenttype[].index[].name sddocname -documenttype[].index[].field[].name sddocname diff --git a/config-model/src/test/derived/documentderiver/vsmsummary.cfg b/config-model/src/test/derived/documentderiver/vsmsummary.cfg deleted file mode 100644 index 03513244430..00000000000 --- a/config-model/src/test/derived/documentderiver/vsmsummary.cfg +++ /dev/null @@ -1,4 +0,0 @@ -fieldmap[].summary snippet -fieldmap[].document[].field body -fieldmap[].document[].field attachmentcontent -fieldmap[].command FLATTENJUNIPER diff --git a/config-model/src/test/derived/inheritancebadtypes/child.sd b/config-model/src/test/derived/inheritancebadtypes/child.sd deleted file mode 100644 index 3a204e95154..00000000000 --- a/config-model/src/test/derived/inheritancebadtypes/child.sd +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search child { -document child inherits parent { - field a type int { - indexing: index - } -} -} diff --git a/config-model/src/test/derived/inheritancebadtypes/parent.sd b/config-model/src/test/derived/inheritancebadtypes/parent.sd deleted file mode 100644 index 4fec1b4179f..00000000000 --- a/config-model/src/test/derived/inheritancebadtypes/parent.sd +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search parent { -document parent { - field a type string { - indexing: index - } -} -} -- cgit v1.2.3