diff options
171 files changed, 592 insertions, 377 deletions
diff --git a/application/pom.xml b/application/pom.xml index f1856e8c85c..c70efab05aa 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -114,6 +114,7 @@ <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> + <scope>test</scope> </dependency> <dependency> <groupId>org.apache.commons</groupId> diff --git a/cloud-tenant-base-dependencies-enforcer/pom.xml b/cloud-tenant-base-dependencies-enforcer/pom.xml index da7dce45e4d..394c357d7fb 100644 --- a/cloud-tenant-base-dependencies-enforcer/pom.xml +++ b/cloud-tenant-base-dependencies-enforcer/pom.xml @@ -48,7 +48,7 @@ <hk2.version>2.5.0-b32</hk2.version> <hk2.osgi-resource-locator.version>1.0.1</hk2.osgi-resource-locator.version> - <jackson2.version>2.12.6</jackson2.version> + <jackson2.version>2.13.3</jackson2.version> <jackson-databind.version>${jackson2.version}</jackson-databind.version> <javassist.version>3.20.0-GA</javassist.version> <javax.annotation-api.version>1.2</javax.annotation-api.version> @@ -247,8 +247,6 @@ <include>org.apache.httpcomponents.client5:httpclient5:${httpclient5.version}:jar:test</include> <include>org.apache.httpcomponents.core5:httpcore5:${httpclient5.version}:jar:test</include> <include>org.apache.httpcomponents.core5:httpcore5-h2:${httpclient5.version}:jar:test</include> - <include>org.apache.httpcomponents:httpclient:4.5.13:jar:test</include> - <include>org.apache.httpcomponents:httpcore:4.4.13:jar:test</include> <include>org.apache.opennlp:opennlp-tools:1.9.3:jar:test</include> <include>org.apiguardian:apiguardian-api:1.1.0:jar:test</include> <include>org.codehaus.woodstox:stax2-api:3.1.4:jar:test</include> diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java index 951317b68f3..dd0d74aa1e8 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java @@ -432,8 +432,14 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> { protected void addAccessLogs(DeployState deployState, ApplicationContainerCluster cluster, Element spec) { List<Element> accessLogElements = getAccessLogElements(spec); - for (Element accessLog : accessLogElements) { - AccessLogBuilder.buildIfNotDisabled(deployState, cluster, accessLog).ifPresent(cluster::addComponent); + if (cluster.isHostedVespa() && !accessLogElements.isEmpty()) { + accessLogElements.clear(); + log.logApplicationPackage( + Level.WARNING, "Applications are not allowed to override the 'accesslog' element"); + } else { + for (Element accessLog : accessLogElements) { + AccessLogBuilder.buildIfNotDisabled(deployState, cluster, accessLog).ifPresent(cluster::addComponent); + } } if (accessLogElements.isEmpty() && deployState.getAccessLoggingEnabledByDefault()) diff --git a/config-model/src/test/derived/advanced/advanced.sd b/config-model/src/test/derived/advanced/advanced.sd index 928e74160b9..69ea3a529b4 100644 --- a/config-model/src/test/derived/advanced/advanced.sd +++ b/config-model/src/test/derived/advanced/advanced.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search advanced { +schema advanced { document advanced { field debug_src type string { } field attributes_src type string { } diff --git a/config-model/src/test/derived/annotationsimplicitstruct/annotationsimplicitstruct.sd b/config-model/src/test/derived/annotationsimplicitstruct/annotationsimplicitstruct.sd index 5ac7ac38a90..fd407a68ea3 100755 --- a/config-model/src/test/derived/annotationsimplicitstruct/annotationsimplicitstruct.sd +++ b/config-model/src/test/derived/annotationsimplicitstruct/annotationsimplicitstruct.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search annotationsimplicitstruct { +schema annotationsimplicitstruct { document annotationsimplicitstruct { diff --git a/config-model/src/test/derived/annotationsinheritance/annotationsinheritance.sd b/config-model/src/test/derived/annotationsinheritance/annotationsinheritance.sd index a0f1787228d..256fb98ae8a 100755 --- a/config-model/src/test/derived/annotationsinheritance/annotationsinheritance.sd +++ b/config-model/src/test/derived/annotationsinheritance/annotationsinheritance.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search annotationsinheritance { +schema annotationsinheritance { document annotationsinheritance { diff --git a/config-model/src/test/derived/annotationsinheritance2/annotationsinheritance2.sd b/config-model/src/test/derived/annotationsinheritance2/annotationsinheritance2.sd index 2abb84d9b9f..f6f30bf6aad 100755 --- a/config-model/src/test/derived/annotationsinheritance2/annotationsinheritance2.sd +++ b/config-model/src/test/derived/annotationsinheritance2/annotationsinheritance2.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search annotationsinheritance2 { +schema annotationsinheritance2 { document annotationsinheritance2 { diff --git a/config-model/src/test/derived/annotationsoutsideofdocument/annotationsoutsideofdocument.sd b/config-model/src/test/derived/annotationsoutsideofdocument/annotationsoutsideofdocument.sd index 017b574fb89..6be5d3401ce 100644 --- a/config-model/src/test/derived/annotationsoutsideofdocument/annotationsoutsideofdocument.sd +++ b/config-model/src/test/derived/annotationsoutsideofdocument/annotationsoutsideofdocument.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search annotationsoutsideofdocument { +schema annotationsoutsideofdocument { # (will fail) diff --git a/config-model/src/test/derived/annotationspolymorphy/annotationspolymorphy.sd b/config-model/src/test/derived/annotationspolymorphy/annotationspolymorphy.sd index b02cf5a88ea..52e17cc19b5 100644 --- a/config-model/src/test/derived/annotationspolymorphy/annotationspolymorphy.sd +++ b/config-model/src/test/derived/annotationspolymorphy/annotationspolymorphy.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search annotationspolymorphy { +schema annotationspolymorphy { document annotationspolymorphy { diff --git a/config-model/src/test/derived/annotationsreference/annotationsreference.sd b/config-model/src/test/derived/annotationsreference/annotationsreference.sd index a0e2af3c6f5..eb1923494ac 100755 --- a/config-model/src/test/derived/annotationsreference/annotationsreference.sd +++ b/config-model/src/test/derived/annotationsreference/annotationsreference.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search annotationsreference { +schema annotationsreference { document annotationsreference { diff --git a/config-model/src/test/derived/annotationsreference2/annotationsreference2.sd b/config-model/src/test/derived/annotationsreference2/annotationsreference2.sd index 6f00d6aa6ee..f91e25a2563 100644 --- a/config-model/src/test/derived/annotationsreference2/annotationsreference2.sd +++ b/config-model/src/test/derived/annotationsreference2/annotationsreference2.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search annotationreference2 { +schema annotationreference2 { document annotationreference2 { annotation foo { } annotation bar { diff --git a/config-model/src/test/derived/annotationssimple/annotationssimple.sd b/config-model/src/test/derived/annotationssimple/annotationssimple.sd index 8ace7165cba..1282dee9f12 100755 --- a/config-model/src/test/derived/annotationssimple/annotationssimple.sd +++ b/config-model/src/test/derived/annotationssimple/annotationssimple.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search annotationssimple { +schema annotationssimple { document annotationssimple { annotation banana { } diff --git a/config-model/src/test/derived/annotationsstruct/annotationsstruct.sd b/config-model/src/test/derived/annotationsstruct/annotationsstruct.sd index ae9bd896af7..64b13dc434e 100644 --- a/config-model/src/test/derived/annotationsstruct/annotationsstruct.sd +++ b/config-model/src/test/derived/annotationsstruct/annotationsstruct.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search annotationsstruct { +schema annotationsstruct { document annotationsstruct { struct my_struct { field my_structfield type string { } diff --git a/config-model/src/test/derived/annotationsstructarray/annotationsstructarray.sd b/config-model/src/test/derived/annotationsstructarray/annotationsstructarray.sd index 44d77caf0d5..e153951a2c1 100644 --- a/config-model/src/test/derived/annotationsstructarray/annotationsstructarray.sd +++ b/config-model/src/test/derived/annotationsstructarray/annotationsstructarray.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search annotationsstructarray { +schema annotationsstructarray { document annotationsstructarray { struct my_struct { field my_structfield type string { } diff --git a/config-model/src/test/derived/array_of_struct_attribute/test.sd b/config-model/src/test/derived/array_of_struct_attribute/test.sd index 2846c3be13d..2f7c7755ca5 100644 --- a/config-model/src/test/derived/array_of_struct_attribute/test.sd +++ b/config-model/src/test/derived/array_of_struct_attribute/test.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search test { +schema test { document test { struct elem { field name type string {} diff --git a/config-model/src/test/derived/arrays/arrays.sd b/config-model/src/test/derived/arrays/arrays.sd index 43aa9c24888..1a6c4b07fc2 100644 --- a/config-model/src/test/derived/arrays/arrays.sd +++ b/config-model/src/test/derived/arrays/arrays.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search arrays { +schema arrays { document arrays { diff --git a/config-model/src/test/derived/attributeprefetch/attributeprefetch.sd b/config-model/src/test/derived/attributeprefetch/attributeprefetch.sd index 296a1fd828d..a0746ea7dcb 100644 --- a/config-model/src/test/derived/attributeprefetch/attributeprefetch.sd +++ b/config-model/src/test/derived/attributeprefetch/attributeprefetch.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search prefetch { +schema prefetch { document prefetch { field singlebyte type byte { indexing: attribute diff --git a/config-model/src/test/derived/attributerank/attributerank.sd b/config-model/src/test/derived/attributerank/attributerank.sd index 4989e1795cd..6d6ee4e8bb1 100644 --- a/config-model/src/test/derived/attributerank/attributerank.sd +++ b/config-model/src/test/derived/attributerank/attributerank.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search attributerank { +schema attributerank { document attributerank { diff --git a/config-model/src/test/derived/attributes/attributes.sd b/config-model/src/test/derived/attributes/attributes.sd index df647c833f4..2827afc2d42 100644 --- a/config-model/src/test/derived/attributes/attributes.sd +++ b/config-model/src/test/derived/attributes/attributes.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search attributes { +schema attributes { document attributes { diff --git a/config-model/src/test/derived/combinedattributeandindexsearch/combinedattributeandindexsearch.sd b/config-model/src/test/derived/combinedattributeandindexsearch/combinedattributeandindexsearch.sd index 8e28c3b6311..c9a76b27101 100644 --- a/config-model/src/test/derived/combinedattributeandindexsearch/combinedattributeandindexsearch.sd +++ b/config-model/src/test/derived/combinedattributeandindexsearch/combinedattributeandindexsearch.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search combinedattributeandindexsearch { +schema combinedattributeandindexsearch { document combinedattributeandindexsearch { diff --git a/config-model/src/test/derived/complex/complex.sd b/config-model/src/test/derived/complex/complex.sd index 844d09a529d..3dcea95ed72 100644 --- a/config-model/src/test/derived/complex/complex.sd +++ b/config-model/src/test/derived/complex/complex.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search complex { +schema complex { document complex { diff --git a/config-model/src/test/derived/declstruct/bar.sd b/config-model/src/test/derived/declstruct/bar.sd index 7f7d06d5af7..9a415c1a12c 100644 --- a/config-model/src/test/derived/declstruct/bar.sd +++ b/config-model/src/test/derived/declstruct/bar.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search bar { +schema bar { document bar inherits common { struct mystructinbar { field f2 type string { } diff --git a/config-model/src/test/derived/declstruct/foo.sd b/config-model/src/test/derived/declstruct/foo.sd index 6470671f437..56ea6ac4f0d 100644 --- a/config-model/src/test/derived/declstruct/foo.sd +++ b/config-model/src/test/derived/declstruct/foo.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search foo { +schema foo { document foo inherits common { struct mystructinfoo { field f1 type string { } diff --git a/config-model/src/test/derived/declstruct/foobar.sd b/config-model/src/test/derived/declstruct/foobar.sd index cc05444249b..bddd19e4cde 100644 --- a/config-model/src/test/derived/declstruct/foobar.sd +++ b/config-model/src/test/derived/declstruct/foobar.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search foobar { +schema foobar { document foobar inherits foo, bar { struct mystructinfoobar { field f3 type string { } diff --git a/config-model/src/test/derived/deriver/child.sd b/config-model/src/test/derived/deriver/child.sd index 5e63a54f690..b829cd9a81d 100644 --- a/config-model/src/test/derived/deriver/child.sd +++ b/config-model/src/test/derived/deriver/child.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search child { +schema child { document child inherits parent { diff --git a/config-model/src/test/derived/deriver/grandparent.sd b/config-model/src/test/derived/deriver/grandparent.sd index f1105bf3f43..2cf540a6f1e 100644 --- a/config-model/src/test/derived/deriver/grandparent.sd +++ b/config-model/src/test/derived/deriver/grandparent.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search grandparent { +schema grandparent { document grandparent { diff --git a/config-model/src/test/derived/deriver/parent.sd b/config-model/src/test/derived/deriver/parent.sd index 6cf930513e4..9379301601c 100644 --- a/config-model/src/test/derived/deriver/parent.sd +++ b/config-model/src/test/derived/deriver/parent.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search parent { +schema parent { document parent inherits grandparent { diff --git a/config-model/src/test/derived/duplicate_struct/foo.sd b/config-model/src/test/derived/duplicate_struct/foo.sd index 8447b0440cb..4eda86f70bd 100644 --- a/config-model/src/test/derived/duplicate_struct/foo.sd +++ b/config-model/src/test/derived/duplicate_struct/foo.sd @@ -1,6 +1,6 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search foo { +schema foo { document foo { field timestamp type long { indexing: summary | attribute diff --git a/config-model/src/test/derived/duplicate_struct/foobar.sd b/config-model/src/test/derived/duplicate_struct/foobar.sd index 7ef4fb5dbe1..feb06852072 100644 --- a/config-model/src/test/derived/duplicate_struct/foobar.sd +++ b/config-model/src/test/derived/duplicate_struct/foobar.sd @@ -1,6 +1,6 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search foobar { +schema foobar { document foobar inherits foo { field title type string { indexing: summary | index diff --git a/config-model/src/test/derived/emptychild/child.sd b/config-model/src/test/derived/emptychild/child.sd index 814899363d7..718a8561ab8 100644 --- a/config-model/src/test/derived/emptychild/child.sd +++ b/config-model/src/test/derived/emptychild/child.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search child { +schema child { document child inherits parent { } } diff --git a/config-model/src/test/derived/emptychild/parent.sd b/config-model/src/test/derived/emptychild/parent.sd index 8c1754f54c9..f304a8f7633 100644 --- a/config-model/src/test/derived/emptychild/parent.sd +++ b/config-model/src/test/derived/emptychild/parent.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search parent { +schema parent { document parent { field a1 type string { indexing: attribute | summary diff --git a/config-model/src/test/derived/emptydefault/emptydefault.sd b/config-model/src/test/derived/emptydefault/emptydefault.sd index 5f317fe2b7f..9d32069d473 100644 --- a/config-model/src/test/derived/emptydefault/emptydefault.sd +++ b/config-model/src/test/derived/emptydefault/emptydefault.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search emptydefault { +schema emptydefault { document emptydefault { diff --git a/config-model/src/test/derived/exactmatch/exactmatch.sd b/config-model/src/test/derived/exactmatch/exactmatch.sd index e6e002d5449..ceeb48ad252 100644 --- a/config-model/src/test/derived/exactmatch/exactmatch.sd +++ b/config-model/src/test/derived/exactmatch/exactmatch.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search exactmatch { +schema exactmatch { document exactmatch { diff --git a/config-model/src/test/derived/fieldset/test.sd b/config-model/src/test/derived/fieldset/test.sd index a3244751551..6bdc5e73cce 100644 --- a/config-model/src/test/derived/fieldset/test.sd +++ b/config-model/src/test/derived/fieldset/test.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search test { +schema test { document test { diff --git a/config-model/src/test/derived/flickr/flickrphotos.sd b/config-model/src/test/derived/flickr/flickrphotos.sd index a7680067a53..8d021fe1c9b 100755 --- a/config-model/src/test/derived/flickr/flickrphotos.sd +++ b/config-model/src/test/derived/flickr/flickrphotos.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search flickrphotos{ +schema flickrphotos{ #Document summary to use for attribute-prefetching with many hits diff --git a/config-model/src/test/derived/function_arguments/test.sd b/config-model/src/test/derived/function_arguments/test.sd index a502c25adb0..8e54d07dee7 100644 --- a/config-model/src/test/derived/function_arguments/test.sd +++ b/config-model/src/test/derived/function_arguments/test.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search args { +schema args { document args { field f1 type float { diff --git a/config-model/src/test/derived/function_arguments_with_expressions/test.sd b/config-model/src/test/derived/function_arguments_with_expressions/test.sd index a4d3d5bfdae..14aeebca641 100644 --- a/config-model/src/test/derived/function_arguments_with_expressions/test.sd +++ b/config-model/src/test/derived/function_arguments_with_expressions/test.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search test { +schema test { document test { field i1 type int { diff --git a/config-model/src/test/derived/gemini2/gemini.sd b/config-model/src/test/derived/gemini2/gemini.sd index 0dc413a0957..366823df04f 100644 --- a/config-model/src/test/derived/gemini2/gemini.sd +++ b/config-model/src/test/derived/gemini2/gemini.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search gemini { +schema gemini { document gemini { field right type string { diff --git a/config-model/src/test/derived/hnsw_index/test.sd b/config-model/src/test/derived/hnsw_index/test.sd index a56b2fa2fcc..066c66df298 100644 --- a/config-model/src/test/derived/hnsw_index/test.sd +++ b/config-model/src/test/derived/hnsw_index/test.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search test { +schema test { document test { field t1 type tensor(x[128]) { indexing: attribute | index diff --git a/config-model/src/test/derived/id/id.sd b/config-model/src/test/derived/id/id.sd index bab549218f2..44c29cf1104 100644 --- a/config-model/src/test/derived/id/id.sd +++ b/config-model/src/test/derived/id/id.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search id { +schema id { document id { diff --git a/config-model/src/test/derived/imported_position_field/child.sd b/config-model/src/test/derived/imported_position_field/child.sd index 908eb417807..d1769c6c7a5 100644 --- a/config-model/src/test/derived/imported_position_field/child.sd +++ b/config-model/src/test/derived/imported_position_field/child.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search child { +schema child { document child { field parent_ref type reference<parent> { indexing: attribute | summary diff --git a/config-model/src/test/derived/imported_position_field/parent.sd b/config-model/src/test/derived/imported_position_field/parent.sd index 5f1710cb176..a50092e6ed9 100644 --- a/config-model/src/test/derived/imported_position_field/parent.sd +++ b/config-model/src/test/derived/imported_position_field/parent.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search parent { +schema parent { document parent { field pos type position { indexing: attribute | summary diff --git a/config-model/src/test/derived/imported_position_field_summary/child.sd b/config-model/src/test/derived/imported_position_field_summary/child.sd index 45a8001b055..52272f91862 100644 --- a/config-model/src/test/derived/imported_position_field_summary/child.sd +++ b/config-model/src/test/derived/imported_position_field_summary/child.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search child { +schema child { document child { field parent_ref type reference<parent> { indexing: attribute | summary diff --git a/config-model/src/test/derived/imported_position_field_summary/parent.sd b/config-model/src/test/derived/imported_position_field_summary/parent.sd index 5f1710cb176..a50092e6ed9 100644 --- a/config-model/src/test/derived/imported_position_field_summary/parent.sd +++ b/config-model/src/test/derived/imported_position_field_summary/parent.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search parent { +schema parent { document parent { field pos type position { indexing: attribute | summary diff --git a/config-model/src/test/derived/imported_struct_fields/child.sd b/config-model/src/test/derived/imported_struct_fields/child.sd index b6b2bb4b444..c83eac6aa83 100644 --- a/config-model/src/test/derived/imported_struct_fields/child.sd +++ b/config-model/src/test/derived/imported_struct_fields/child.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search child { +schema child { document child { field parent_ref type reference<parent> { indexing: attribute | summary diff --git a/config-model/src/test/derived/imported_struct_fields/parent.sd b/config-model/src/test/derived/imported_struct_fields/parent.sd index 5e3f248b748..1faabfc1a0e 100644 --- a/config-model/src/test/derived/imported_struct_fields/parent.sd +++ b/config-model/src/test/derived/imported_struct_fields/parent.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search parent { +schema parent { document parent { struct elem { field name type string {} diff --git a/config-model/src/test/derived/importedfields/child.sd b/config-model/src/test/derived/importedfields/child.sd index dc512471022..627e494b385 100644 --- a/config-model/src/test/derived/importedfields/child.sd +++ b/config-model/src/test/derived/importedfields/child.sd @@ -1,9 +1,15 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search child { +schema child { document child { - field a_ref type reference<parent_a> { indexing: attribute } - field b_ref type reference<parent_b> { indexing: attribute } - field b_ref_with_summary type reference<parent_b> { indexing: attribute | summary } + field a_ref type reference<parent_a> { + indexing: attribute + } + field b_ref type reference<parent_b> { + indexing: attribute + } + field b_ref_with_summary type reference<parent_b> { + indexing: attribute | summary + } } import field a_ref.int_field as my_int_field {} import field b_ref.string_field as my_string_field {} diff --git a/config-model/src/test/derived/importedfields/grandparent.sd b/config-model/src/test/derived/importedfields/grandparent.sd index 7ec4c5f911b..b6902018547 100644 --- a/config-model/src/test/derived/importedfields/grandparent.sd +++ b/config-model/src/test/derived/importedfields/grandparent.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search grandparent { +schema grandparent { document grandparent { field int_field type int { indexing: attribute diff --git a/config-model/src/test/derived/importedfields/parent_a.sd b/config-model/src/test/derived/importedfields/parent_a.sd index 85055606539..c3ff0dd249e 100644 --- a/config-model/src/test/derived/importedfields/parent_a.sd +++ b/config-model/src/test/derived/importedfields/parent_a.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search parent_a { +schema parent_a { document parent_a { field grandparent_ref type reference<grandparent> { indexing: attribute diff --git a/config-model/src/test/derived/importedfields/parent_b.sd b/config-model/src/test/derived/importedfields/parent_b.sd index f5ed8c5ffae..b8662070da3 100644 --- a/config-model/src/test/derived/importedfields/parent_b.sd +++ b/config-model/src/test/derived/importedfields/parent_b.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search parent_b { +schema parent_b { document parent_b { field string_field type string { indexing: attribute diff --git a/config-model/src/test/derived/indexinfo_fieldsets/indexinfo_fieldsets.sd b/config-model/src/test/derived/indexinfo_fieldsets/indexinfo_fieldsets.sd index 885def07950..58b37f7fdd3 100644 --- a/config-model/src/test/derived/indexinfo_fieldsets/indexinfo_fieldsets.sd +++ b/config-model/src/test/derived/indexinfo_fieldsets/indexinfo_fieldsets.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search indexinfo_fieldsets { +schema indexinfo_fieldsets { document indexinfo_fieldsets { diff --git a/config-model/src/test/derived/indexinfo_lowercase/indexinfo_lowercase.sd b/config-model/src/test/derived/indexinfo_lowercase/indexinfo_lowercase.sd index c4de1fa1a91..b42672c21aa 100644 --- a/config-model/src/test/derived/indexinfo_lowercase/indexinfo_lowercase.sd +++ b/config-model/src/test/derived/indexinfo_lowercase/indexinfo_lowercase.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search indexinfo_lowercase { +schema indexinfo_lowercase { document indexinfo_lowercase { field lc_attribute_src type string { diff --git a/config-model/src/test/derived/indexschema/indexschema.sd b/config-model/src/test/derived/indexschema/indexschema.sd index 2e6b5ae2933..47dd8aa79be 100644 --- a/config-model/src/test/derived/indexschema/indexschema.sd +++ b/config-model/src/test/derived/indexschema/indexschema.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search indexschema { +schema indexschema { field searchfield1 type string {} field searchfield2 type int {} diff --git a/config-model/src/test/derived/indexswitches/indexswitches.sd b/config-model/src/test/derived/indexswitches/indexswitches.sd index 8ed161f11f7..34d1d159417 100644 --- a/config-model/src/test/derived/indexswitches/indexswitches.sd +++ b/config-model/src/test/derived/indexswitches/indexswitches.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search indexswitches { +schema indexswitches { document indexswitches { diff --git a/config-model/src/test/derived/inheritance/child.sd b/config-model/src/test/derived/inheritance/child.sd index 76876d68374..315c77b1b60 100644 --- a/config-model/src/test/derived/inheritance/child.sd +++ b/config-model/src/test/derived/inheritance/child.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search child { +schema child { document child inherits father, mother { diff --git a/config-model/src/test/derived/inheritdiamond/child.sd b/config-model/src/test/derived/inheritdiamond/child.sd index ba3c6fdd744..8fa64ad745d 100644 --- a/config-model/src/test/derived/inheritdiamond/child.sd +++ b/config-model/src/test/derived/inheritdiamond/child.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search child { +schema child { document child inherits mother, father { struct child_struct { field child_field type string { } diff --git a/config-model/src/test/derived/inheritdiamond/father.sd b/config-model/src/test/derived/inheritdiamond/father.sd index df628f9e4ef..361dbc3253a 100644 --- a/config-model/src/test/derived/inheritdiamond/father.sd +++ b/config-model/src/test/derived/inheritdiamond/father.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search father { +schema father { document father inherits grandparent { struct father_struct { field father_field type string { } diff --git a/config-model/src/test/derived/inheritdiamond/grandparent.sd b/config-model/src/test/derived/inheritdiamond/grandparent.sd index 6b19dd129ef..0ad69f52cfe 100644 --- a/config-model/src/test/derived/inheritdiamond/grandparent.sd +++ b/config-model/src/test/derived/inheritdiamond/grandparent.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search grandparent { +schema grandparent { document grandparent { struct grandparent_struct { field grandparent_field type string { } diff --git a/config-model/src/test/derived/inheritdiamond/mother.sd b/config-model/src/test/derived/inheritdiamond/mother.sd index e7b6b6143e6..0f4b5ca9d3b 100644 --- a/config-model/src/test/derived/inheritdiamond/mother.sd +++ b/config-model/src/test/derived/inheritdiamond/mother.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search mother { +schema mother { document mother inherits grandparent { struct mother_struct { field mother_field type string { } diff --git a/config-model/src/test/derived/inheritfromgrandparent/child.sd b/config-model/src/test/derived/inheritfromgrandparent/child.sd index 8678cbad3e1..b6859e84442 100644 --- a/config-model/src/test/derived/inheritfromgrandparent/child.sd +++ b/config-model/src/test/derived/inheritfromgrandparent/child.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search child { +schema child { document child inherits parent { field child_field type grandparent_struct { } } diff --git a/config-model/src/test/derived/inheritfromgrandparent/grandparent.sd b/config-model/src/test/derived/inheritfromgrandparent/grandparent.sd index 6b19dd129ef..0ad69f52cfe 100644 --- a/config-model/src/test/derived/inheritfromgrandparent/grandparent.sd +++ b/config-model/src/test/derived/inheritfromgrandparent/grandparent.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search grandparent { +schema grandparent { document grandparent { struct grandparent_struct { field grandparent_field type string { } diff --git a/config-model/src/test/derived/inheritfromgrandparent/parent.sd b/config-model/src/test/derived/inheritfromgrandparent/parent.sd index 6857f786efe..963e44799d9 100644 --- a/config-model/src/test/derived/inheritfromgrandparent/parent.sd +++ b/config-model/src/test/derived/inheritfromgrandparent/parent.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search parent { +schema parent { document parent inherits grandparent { } diff --git a/config-model/src/test/derived/inheritfromnull/inheritfromnull.sd b/config-model/src/test/derived/inheritfromnull/inheritfromnull.sd index 769a0c74aa2..549284e79b6 100644 --- a/config-model/src/test/derived/inheritfromnull/inheritfromnull.sd +++ b/config-model/src/test/derived/inheritfromnull/inheritfromnull.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search inheritfromnull { +schema inheritfromnull { document inheritfromnull inherits foo { } } diff --git a/config-model/src/test/derived/inheritfromparent/child.sd b/config-model/src/test/derived/inheritfromparent/child.sd index ea577d620b7..055f998b8f0 100644 --- a/config-model/src/test/derived/inheritfromparent/child.sd +++ b/config-model/src/test/derived/inheritfromparent/child.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search child { +schema child { document child inherits parent { field child_field type parent_struct { } } diff --git a/config-model/src/test/derived/inheritfromparent/parent.sd b/config-model/src/test/derived/inheritfromparent/parent.sd index 502da7efcaf..ceda280ec30 100644 --- a/config-model/src/test/derived/inheritfromparent/parent.sd +++ b/config-model/src/test/derived/inheritfromparent/parent.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search parent { +schema parent { document parent { struct parent_struct { field parent_field type string { } diff --git a/config-model/src/test/derived/inheritstruct/child.sd b/config-model/src/test/derived/inheritstruct/child.sd index fcc3cececc3..00cc09e9d2f 100644 --- a/config-model/src/test/derived/inheritstruct/child.sd +++ b/config-model/src/test/derived/inheritstruct/child.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search child { +schema child { document child inherits parent { struct other_struct inherits my_struct { field my_int type int {} diff --git a/config-model/src/test/derived/inheritstruct/parent.sd b/config-model/src/test/derived/inheritstruct/parent.sd index c5bf71a8479..2ea8ad0ce7c 100644 --- a/config-model/src/test/derived/inheritstruct/parent.sd +++ b/config-model/src/test/derived/inheritstruct/parent.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search parent { +schema parent { document parent { struct my_struct { field my_str type string { } diff --git a/config-model/src/test/derived/integerattributetostringindex/integerattributetostringindex.sd b/config-model/src/test/derived/integerattributetostringindex/integerattributetostringindex.sd index a394b0d0094..7678093c28c 100644 --- a/config-model/src/test/derived/integerattributetostringindex/integerattributetostringindex.sd +++ b/config-model/src/test/derived/integerattributetostringindex/integerattributetostringindex.sd @@ -1,25 +1,21 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search integerattributetostringindex { +schema integerattributetostringindex { document integerattributetostringindex { field attinx type int { indexing: summary | attribute | index - # index-to: attinx,default } field artist type string { indexing: summary | attribute -# index-to: artist, default } field title type string { indexing: summary | index -# index-to: title, default } field year type int { indexing: summary | attribute -# index-to:default attribute : fast-search } diff --git a/config-model/src/test/derived/mail/mail.sd b/config-model/src/test/derived/mail/mail.sd index 73108fa280e..848b67e1b1f 100644 --- a/config-model/src/test/derived/mail/mail.sd +++ b/config-model/src/test/derived/mail/mail.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search mail { +schema mail { stemming: none diff --git a/config-model/src/test/derived/map_attribute/test.sd b/config-model/src/test/derived/map_attribute/test.sd index 63fa3ba691f..5ba429a5f47 100644 --- a/config-model/src/test/derived/map_attribute/test.sd +++ b/config-model/src/test/derived/map_attribute/test.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search test { +schema test { document test { field str_map type map<string, string> { indexing: summary diff --git a/config-model/src/test/derived/map_of_struct_attribute/test.sd b/config-model/src/test/derived/map_of_struct_attribute/test.sd index ed81610467e..7806d49392e 100644 --- a/config-model/src/test/derived/map_of_struct_attribute/test.sd +++ b/config-model/src/test/derived/map_of_struct_attribute/test.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search test { +schema test { document test { struct elem { field name type string {} diff --git a/config-model/src/test/derived/matchsettings_map_after/test.sd b/config-model/src/test/derived/matchsettings_map_after/test.sd index 2f6372628c9..fe575e81c69 100644 --- a/config-model/src/test/derived/matchsettings_map_after/test.sd +++ b/config-model/src/test/derived/matchsettings_map_after/test.sd @@ -1,7 +1,7 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search test { +schema test { document test { field mse4 type map<string,elem> { diff --git a/config-model/src/test/derived/matchsettings_map_def/test.sd b/config-model/src/test/derived/matchsettings_map_def/test.sd index 7f2517c80fc..1a48cce0f45 100644 --- a/config-model/src/test/derived/matchsettings_map_def/test.sd +++ b/config-model/src/test/derived/matchsettings_map_def/test.sd @@ -1,7 +1,7 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search test { +schema test { document test { struct elem { diff --git a/config-model/src/test/derived/matchsettings_map_in_struct/test.sd b/config-model/src/test/derived/matchsettings_map_in_struct/test.sd index 6e1b87362cc..f11bb397fbc 100644 --- a/config-model/src/test/derived/matchsettings_map_in_struct/test.sd +++ b/config-model/src/test/derived/matchsettings_map_in_struct/test.sd @@ -1,7 +1,7 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search test { +schema test { document test { struct elem { diff --git a/config-model/src/test/derived/matchsettings_map_wfs/test.sd b/config-model/src/test/derived/matchsettings_map_wfs/test.sd index 12c0c395282..7747378376c 100644 --- a/config-model/src/test/derived/matchsettings_map_wfs/test.sd +++ b/config-model/src/test/derived/matchsettings_map_wfs/test.sd @@ -1,7 +1,7 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search test { +schema test { document test { struct elem { diff --git a/config-model/src/test/derived/matchsettings_map_wss/test.sd b/config-model/src/test/derived/matchsettings_map_wss/test.sd index 58162ea93fc..f27d7d7a915 100644 --- a/config-model/src/test/derived/matchsettings_map_wss/test.sd +++ b/config-model/src/test/derived/matchsettings_map_wss/test.sd @@ -1,7 +1,7 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search test { +schema test { document test { struct elem { diff --git a/config-model/src/test/derived/matchsettings_simple_def/test.sd b/config-model/src/test/derived/matchsettings_simple_def/test.sd index 8d5a1733a44..c1f9cbd4282 100644 --- a/config-model/src/test/derived/matchsettings_simple_def/test.sd +++ b/config-model/src/test/derived/matchsettings_simple_def/test.sd @@ -1,7 +1,6 @@ - # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search test { +schema test { document test { struct elem { diff --git a/config-model/src/test/derived/matchsettings_simple_wfs/test.sd b/config-model/src/test/derived/matchsettings_simple_wfs/test.sd index 9c709d8167e..5428b006f49 100644 --- a/config-model/src/test/derived/matchsettings_simple_wfs/test.sd +++ b/config-model/src/test/derived/matchsettings_simple_wfs/test.sd @@ -1,7 +1,6 @@ - # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search test { +schema test { document test { struct elem { diff --git a/config-model/src/test/derived/matchsettings_simple_wss/test.sd b/config-model/src/test/derived/matchsettings_simple_wss/test.sd index 451d9ad06d8..e91d36e24ad 100644 --- a/config-model/src/test/derived/matchsettings_simple_wss/test.sd +++ b/config-model/src/test/derived/matchsettings_simple_wss/test.sd @@ -1,7 +1,6 @@ - # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search test { +schema test { document test { struct elem { diff --git a/config-model/src/test/derived/matchsettings_simple_wss_wfs/test.sd b/config-model/src/test/derived/matchsettings_simple_wss_wfs/test.sd index f3967e6ad80..cf7d793b47c 100644 --- a/config-model/src/test/derived/matchsettings_simple_wss_wfs/test.sd +++ b/config-model/src/test/derived/matchsettings_simple_wss_wfs/test.sd @@ -1,7 +1,6 @@ - # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search test { +schema test { document test { struct elem { diff --git a/config-model/src/test/derived/mlr/mlr.sd b/config-model/src/test/derived/mlr/mlr.sd index 66fa24a8417..c0ad502a35c 100644 --- a/config-model/src/test/derived/mlr/mlr.sd +++ b/config-model/src/test/derived/mlr/mlr.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search mlr { +schema mlr { document mlr { diff --git a/config-model/src/test/derived/multi_struct/ad.sd b/config-model/src/test/derived/multi_struct/ad.sd index a14cd6dc023..ee389e510b4 100644 --- a/config-model/src/test/derived/multi_struct/ad.sd +++ b/config-model/src/test/derived/multi_struct/ad.sd @@ -1,4 +1,4 @@ -search ad { +schema ad { document ad { field e type string { indexing: attribute | summary diff --git a/config-model/src/test/derived/multi_struct/product.sd b/config-model/src/test/derived/multi_struct/product.sd index cba611cd794..d1c63614917 100644 --- a/config-model/src/test/derived/multi_struct/product.sd +++ b/config-model/src/test/derived/multi_struct/product.sd @@ -1,4 +1,4 @@ -search product { +schema product { document product { struct mystruct { field zero type string {} diff --git a/config-model/src/test/derived/multi_struct/shop.sd b/config-model/src/test/derived/multi_struct/shop.sd index b5c06cc493f..7b96bbed471 100644 --- a/config-model/src/test/derived/multi_struct/shop.sd +++ b/config-model/src/test/derived/multi_struct/shop.sd @@ -1,4 +1,4 @@ -search shop { +schema shop { document shop { struct mystruct { field one type string {} diff --git a/config-model/src/test/derived/multi_struct/user.sd b/config-model/src/test/derived/multi_struct/user.sd index ec23e9f88ea..798171f062f 100644 --- a/config-model/src/test/derived/multi_struct/user.sd +++ b/config-model/src/test/derived/multi_struct/user.sd @@ -1,4 +1,4 @@ -search user { +schema user { document user { field a type string { indexing: summary diff --git a/config-model/src/test/derived/multiplesummaries/multiplesummaries.sd b/config-model/src/test/derived/multiplesummaries/multiplesummaries.sd index ae0e2fe92bc..51259802a3a 100644 --- a/config-model/src/test/derived/multiplesummaries/multiplesummaries.sd +++ b/config-model/src/test/derived/multiplesummaries/multiplesummaries.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search multiplesummaries { +schema multiplesummaries { document multiplesummaries { diff --git a/config-model/src/test/derived/music/music.sd b/config-model/src/test/derived/music/music.sd index 87479804f84..919e324c4bc 100644 --- a/config-model/src/test/derived/music/music.sd +++ b/config-model/src/test/derived/music/music.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search music { +schema music { document music { diff --git a/config-model/src/test/derived/music3/music3.sd b/config-model/src/test/derived/music3/music3.sd index aac756d29b0..7123c45bac2 100644 --- a/config-model/src/test/derived/music3/music3.sd +++ b/config-model/src/test/derived/music3/music3.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search music3 { +schema music3 { document music3 { diff --git a/config-model/src/test/derived/namecollision/collision.sd b/config-model/src/test/derived/namecollision/collision.sd index 56c1be2aada..509a1464090 100644 --- a/config-model/src/test/derived/namecollision/collision.sd +++ b/config-model/src/test/derived/namecollision/collision.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search collision { +schema collision { document collision { diff --git a/config-model/src/test/derived/namecollision/collisionstruct.sd b/config-model/src/test/derived/namecollision/collisionstruct.sd index 5a9d1fe2f11..2416e592513 100644 --- a/config-model/src/test/derived/namecollision/collisionstruct.sd +++ b/config-model/src/test/derived/namecollision/collisionstruct.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search collisionstruct { +schema collisionstruct { document collisionstruct { diff --git a/config-model/src/test/derived/nearestneighbor/test.sd b/config-model/src/test/derived/nearestneighbor/test.sd index 58790d283ee..9c47f89bfd9 100644 --- a/config-model/src/test/derived/nearestneighbor/test.sd +++ b/config-model/src/test/derived/nearestneighbor/test.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search test { +schema test { document test { field id type int { indexing: attribute | summary diff --git a/config-model/src/test/derived/neuralnet/neuralnet.sd b/config-model/src/test/derived/neuralnet/neuralnet.sd index b67081e71a7..54f6cefc6f4 100644 --- a/config-model/src/test/derived/neuralnet/neuralnet.sd +++ b/config-model/src/test/derived/neuralnet/neuralnet.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search neuralnet { +schema neuralnet { document neuralnet { diff --git a/config-model/src/test/derived/neuralnet_noqueryprofile/neuralnet.sd b/config-model/src/test/derived/neuralnet_noqueryprofile/neuralnet.sd index d06ca2677a1..073813d2198 100644 --- a/config-model/src/test/derived/neuralnet_noqueryprofile/neuralnet.sd +++ b/config-model/src/test/derived/neuralnet_noqueryprofile/neuralnet.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search neuralnet { +schema neuralnet { document neuralnet { diff --git a/config-model/src/test/derived/newrank/newrank.sd b/config-model/src/test/derived/newrank/newrank.sd index 8990f1b4163..345d01bffb5 100644 --- a/config-model/src/test/derived/newrank/newrank.sd +++ b/config-model/src/test/derived/newrank/newrank.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search newrank{ +schema newrank{ document newrank{ field bgndata type string { diff --git a/config-model/src/test/derived/nuwa/newsindex.sd b/config-model/src/test/derived/nuwa/newsindex.sd index 4d81df85000..9fe3c125b97 100644 --- a/config-model/src/test/derived/nuwa/newsindex.sd +++ b/config-model/src/test/derived/nuwa/newsindex.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search newsindex { +schema newsindex { document newsindex { diff --git a/config-model/src/test/derived/orderilscripts/orderilscripts.sd b/config-model/src/test/derived/orderilscripts/orderilscripts.sd index dd4598efd0b..02c1dd667b0 100755 --- a/config-model/src/test/derived/orderilscripts/orderilscripts.sd +++ b/config-model/src/test/derived/orderilscripts/orderilscripts.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search orderilscripts { +schema orderilscripts { document orderilscripts { field foo type string { diff --git a/config-model/src/test/derived/position_array/position_array.sd b/config-model/src/test/derived/position_array/position_array.sd index af76106859c..cafdc15b9d2 100644 --- a/config-model/src/test/derived/position_array/position_array.sd +++ b/config-model/src/test/derived/position_array/position_array.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search position_array { +schema position_array { document position_array { field pos type array<position> { indexing: attribute diff --git a/config-model/src/test/derived/position_attribute/position_attribute.sd b/config-model/src/test/derived/position_attribute/position_attribute.sd index a524143376f..b55ac26b399 100644 --- a/config-model/src/test/derived/position_attribute/position_attribute.sd +++ b/config-model/src/test/derived/position_attribute/position_attribute.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search position_attribute { +schema position_attribute { document position_attribute { field pos type position { indexing: attribute diff --git a/config-model/src/test/derived/position_extra/position_extra.sd b/config-model/src/test/derived/position_extra/position_extra.sd index a7cc8ef8cc4..d850113b723 100644 --- a/config-model/src/test/derived/position_extra/position_extra.sd +++ b/config-model/src/test/derived/position_extra/position_extra.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search position_extra { +schema position_extra { document position_extra { field pos_str type string { diff --git a/config-model/src/test/derived/position_nosummary/position_nosummary.sd b/config-model/src/test/derived/position_nosummary/position_nosummary.sd index d20e7a412dc..5aa40d98811 100644 --- a/config-model/src/test/derived/position_nosummary/position_nosummary.sd +++ b/config-model/src/test/derived/position_nosummary/position_nosummary.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search position_nosummary { +schema position_nosummary { document position_nosummary { field pos type position { indexing: attribute diff --git a/config-model/src/test/derived/position_summary/position_summary.sd b/config-model/src/test/derived/position_summary/position_summary.sd index 59b930bc9e4..f30e3d92c6a 100644 --- a/config-model/src/test/derived/position_summary/position_summary.sd +++ b/config-model/src/test/derived/position_summary/position_summary.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search position_summary { +schema position_summary { document position_summary { field pos type position { indexing: attribute | summary diff --git a/config-model/src/test/derived/predicate_attribute/predicate_attribute.sd b/config-model/src/test/derived/predicate_attribute/predicate_attribute.sd index f03d9d6b294..76482870719 100644 --- a/config-model/src/test/derived/predicate_attribute/predicate_attribute.sd +++ b/config-model/src/test/derived/predicate_attribute/predicate_attribute.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search predicate_type { +schema predicate_type { document predicate_type { field some_predicate_field type predicate { indexing: attribute | summary diff --git a/config-model/src/test/derived/prefixexactattribute/prefixexactattribute.sd b/config-model/src/test/derived/prefixexactattribute/prefixexactattribute.sd index 03a8d05f1ad..119ec88c33c 100644 --- a/config-model/src/test/derived/prefixexactattribute/prefixexactattribute.sd +++ b/config-model/src/test/derived/prefixexactattribute/prefixexactattribute.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search prefixexactattribute { +schema prefixexactattribute { document prefixexactattribute { diff --git a/config-model/src/test/derived/rankingexpression/rankexpression.sd b/config-model/src/test/derived/rankingexpression/rankexpression.sd index 25d657eaf0b..a5e7f07f6ac 100644 --- a/config-model/src/test/derived/rankingexpression/rankexpression.sd +++ b/config-model/src/test/derived/rankingexpression/rankexpression.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search rankexpression { +schema rankexpression { document rankexpression { diff --git a/config-model/src/test/derived/rankprofiles/rankprofiles.sd b/config-model/src/test/derived/rankprofiles/rankprofiles.sd index 4b0a7702d6c..9966e304b78 100644 --- a/config-model/src/test/derived/rankprofiles/rankprofiles.sd +++ b/config-model/src/test/derived/rankprofiles/rankprofiles.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search rankprofiles { +schema rankprofiles { document rankprofiles { diff --git a/config-model/src/test/derived/rankproperties/rankproperties.sd b/config-model/src/test/derived/rankproperties/rankproperties.sd index db259f1daec..a2eb987d4ff 100644 --- a/config-model/src/test/derived/rankproperties/rankproperties.sd +++ b/config-model/src/test/derived/rankproperties/rankproperties.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search rankproperties { +schema rankproperties { document rankproperties { diff --git a/config-model/src/test/derived/ranktypes/ranktypes.sd b/config-model/src/test/derived/ranktypes/ranktypes.sd index 1651d43afa6..8f11a21236d 100644 --- a/config-model/src/test/derived/ranktypes/ranktypes.sd +++ b/config-model/src/test/derived/ranktypes/ranktypes.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search ranktypes { +schema ranktypes { document ranktypes { diff --git a/config-model/src/test/derived/reference_fields/ad.sd b/config-model/src/test/derived/reference_fields/ad.sd index 9a4f52c7f8a..a39ec2f67ab 100644 --- a/config-model/src/test/derived/reference_fields/ad.sd +++ b/config-model/src/test/derived/reference_fields/ad.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search ad { +schema ad { document ad { field campaign_ref type reference<campaign> { indexing: attribute | summary diff --git a/config-model/src/test/derived/reference_fields/campaign.sd b/config-model/src/test/derived/reference_fields/campaign.sd index dce3a84320a..026d520dfb3 100644 --- a/config-model/src/test/derived/reference_fields/campaign.sd +++ b/config-model/src/test/derived/reference_fields/campaign.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search campaign { +schema campaign { document campaign { } } diff --git a/config-model/src/test/derived/renamedfeatures/foo.sd b/config-model/src/test/derived/renamedfeatures/foo.sd index 462eb0da44e..7ab4da4de33 100644 --- a/config-model/src/test/derived/renamedfeatures/foo.sd +++ b/config-model/src/test/derived/renamedfeatures/foo.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search foo { +schema foo { document foo { field title type string { diff --git a/config-model/src/test/derived/reserved_position/reserved_position.sd b/config-model/src/test/derived/reserved_position/reserved_position.sd index c910ced1477..68879c53e89 100644 --- a/config-model/src/test/derived/reserved_position/reserved_position.sd +++ b/config-model/src/test/derived/reserved_position/reserved_position.sd @@ -1,4 +1,4 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search position { +schema position { document position { } } diff --git a/config-model/src/test/derived/schemainheritance/parent.sd b/config-model/src/test/derived/schemainheritance/parent.sd index 41c2d89fff5..3635a179b44 100644 --- a/config-model/src/test/derived/schemainheritance/parent.sd +++ b/config-model/src/test/derived/schemainheritance/parent.sd @@ -36,5 +36,5 @@ schema parent { } import field importedschema_ref.importedfield1 as parent_imported { } - raw-as-base64-in-summary + raw-as-base64-in-summary: true } diff --git a/config-model/src/test/derived/slice/test.sd b/config-model/src/test/derived/slice/test.sd index c2060300785..0c351d4323d 100644 --- a/config-model/src/test/derived/slice/test.sd +++ b/config-model/src/test/derived/slice/test.sd @@ -1,4 +1,4 @@ -search test { +schema test { document test { } diff --git a/config-model/src/test/derived/sorting/sorting.sd b/config-model/src/test/derived/sorting/sorting.sd index a08b00ed9ac..7317c784f66 100644 --- a/config-model/src/test/derived/sorting/sorting.sd +++ b/config-model/src/test/derived/sorting/sorting.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search sorting { +schema sorting { document sorting { diff --git a/config-model/src/test/derived/streamingjuniper/streamingjuniper.sd b/config-model/src/test/derived/streamingjuniper/streamingjuniper.sd index bffc2f0cda2..392911d4b34 100644 --- a/config-model/src/test/derived/streamingjuniper/streamingjuniper.sd +++ b/config-model/src/test/derived/streamingjuniper/streamingjuniper.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search streamingjuniper { +schema streamingjuniper { document streamingjuniper { field f1 type string { indexing: index | summary diff --git a/config-model/src/test/derived/streamingstruct/streamingstruct.sd b/config-model/src/test/derived/streamingstruct/streamingstruct.sd index 32f58cc7a5e..59c325f8117 100644 --- a/config-model/src/test/derived/streamingstruct/streamingstruct.sd +++ b/config-model/src/test/derived/streamingstruct/streamingstruct.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search streamingstruct { +schema streamingstruct { document streamingstruct { field coupleof type string { @@ -15,7 +15,9 @@ search streamingstruct { struct s1 { field f1 type string { } - field f1s type string { match: substring } + field f1s type string { + match: substring + } field f2 type int { } field f3 type double { } # Allow default matchtypes in struct. Can be overridden. diff --git a/config-model/src/test/derived/streamingstructdefault/streamingstructdefault.sd b/config-model/src/test/derived/streamingstructdefault/streamingstructdefault.sd index d91020f6562..ecb7a177775 100644 --- a/config-model/src/test/derived/streamingstructdefault/streamingstructdefault.sd +++ b/config-model/src/test/derived/streamingstructdefault/streamingstructdefault.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search streamingstructdefault { +schema streamingstructdefault { document streamingstructdefault { struct sct { field s1 type string {} diff --git a/config-model/src/test/derived/structandfieldset/test.sd b/config-model/src/test/derived/structandfieldset/test.sd index da12787e564..0b50738ab54 100644 --- a/config-model/src/test/derived/structandfieldset/test.sd +++ b/config-model/src/test/derived/structandfieldset/test.sd @@ -13,7 +13,9 @@ schema test { field people type array<person> { indexing: summary - struct-field first_name { indexing: attribute } + struct-field first_name { + indexing: attribute + } struct-field last_name { indexing: attribute rank: filter diff --git a/config-model/src/test/derived/structanyorder/structanyorder.sd b/config-model/src/test/derived/structanyorder/structanyorder.sd index 7ca35cd0ec1..829ef04a1d5 100755 --- a/config-model/src/test/derived/structanyorder/structanyorder.sd +++ b/config-model/src/test/derived/structanyorder/structanyorder.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search annotationsimplicitstruct { +schema annotationsimplicitstruct { document annotationsimplicitstruct { field structfield type sct { diff --git a/config-model/src/test/derived/structinheritance/bad.sd b/config-model/src/test/derived/structinheritance/bad.sd index ef5137842ec..31bef765142 100644 --- a/config-model/src/test/derived/structinheritance/bad.sd +++ b/config-model/src/test/derived/structinheritance/bad.sd @@ -1,6 +1,6 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search bad { +schema bad { document bad { struct base { field name type string {} diff --git a/config-model/src/test/derived/structinheritance/simple.sd b/config-model/src/test/derived/structinheritance/simple.sd index 8b4bb6150c1..0e56be4fec8 100644 --- a/config-model/src/test/derived/structinheritance/simple.sd +++ b/config-model/src/test/derived/structinheritance/simple.sd @@ -1,6 +1,6 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search simple { +schema simple { document simple { struct base { field name type string {} diff --git a/config-model/src/test/derived/tensor/rank-profiles.cfg b/config-model/src/test/derived/tensor/rank-profiles.cfg index ac66ccf6938..1ec3d67cb47 100644 --- a/config-model/src/test/derived/tensor/rank-profiles.cfg +++ b/config-model/src/test/derived/tensor/rank-profiles.cfg @@ -137,7 +137,7 @@ rankprofile[].fef.property[].value "3" rankprofile[].fef.property[].name "vespa.rank.firstphase" rankprofile[].fef.property[].value "rankingExpression(firstphase)" rankprofile[].fef.property[].name "rankingExpression(firstphase).rankingScript" -rankprofile[].fef.property[].value "reduce(tensor(d0[1])((attribute{x:(rankingExpression(functionNotLabel))})), sum)" +rankprofile[].fef.property[].value "reduce(tensor(d0[1])((attribute(f3){x:(rankingExpression(functionNotLabel))})), sum)" rankprofile[].fef.property[].name "vespa.type.attribute.f2" rankprofile[].fef.property[].value "tensor<float>(x[2],y[1])" rankprofile[].fef.property[].name "vespa.type.attribute.f3" @@ -152,7 +152,7 @@ rankprofile[].fef.property[].value "3" rankprofile[].fef.property[].name "vespa.rank.firstphase" rankprofile[].fef.property[].value "rankingExpression(firstphase)" rankprofile[].fef.property[].name "rankingExpression(firstphase).rankingScript" -rankprofile[].fef.property[].value "reduce(tensor(shadow[1])((attribute{x:(shadow + rankingExpression(shadow))})), sum)" +rankprofile[].fef.property[].value "reduce(tensor(shadow[1])((attribute(f3){x:(shadow + rankingExpression(shadow))})), sum)" rankprofile[].fef.property[].name "vespa.type.attribute.f2" rankprofile[].fef.property[].value "tensor<float>(x[2],y[1])" rankprofile[].fef.property[].name "vespa.type.attribute.f3" diff --git a/config-model/src/test/derived/tensor/tensor.sd b/config-model/src/test/derived/tensor/tensor.sd index 2566708d488..a0657bae2e4 100644 --- a/config-model/src/test/derived/tensor/tensor.sd +++ b/config-model/src/test/derived/tensor/tensor.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search tensor { +schema tensor { document tensor { field f1 type tensor(x[3]) { @@ -97,7 +97,7 @@ search tensor { rank-profile profile8 { first-phase { - expression: sum(tensor(d0[1])(attribute{x:functionNotLabel()})) + expression: sum(tensor(d0[1])(attribute(f3){x:functionNotLabel()})) } function functionNotLabel() { @@ -110,7 +110,7 @@ search tensor { # shadow refers to the generate index and shadow() to the function first-phase { - expression: sum(tensor(shadow[1])(attribute{x: shadow + shadow() })) + expression: sum(tensor(shadow[1])(attribute(f3){x: shadow + shadow() })) } function shadow() { diff --git a/config-model/src/test/derived/tensor2/first.sd b/config-model/src/test/derived/tensor2/first.sd index 22b10ab5e3d..900cf515176 100644 --- a/config-model/src/test/derived/tensor2/first.sd +++ b/config-model/src/test/derived/tensor2/first.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search first { +schema first { document first { field first_field type tensor(first[10]) { indexing: summary | attribute diff --git a/config-model/src/test/derived/tensor2/second.sd b/config-model/src/test/derived/tensor2/second.sd index a347d511d80..a43495b7604 100644 --- a/config-model/src/test/derived/tensor2/second.sd +++ b/config-model/src/test/derived/tensor2/second.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search second { +schema second { document second { field second_field type tensor(second[10]) { indexing: summary | attribute diff --git a/config-model/src/test/derived/twostreamingstructs/streamingstruct.sd b/config-model/src/test/derived/twostreamingstructs/streamingstruct.sd index 0636e7a537e..a0f2888bc2a 100644 --- a/config-model/src/test/derived/twostreamingstructs/streamingstruct.sd +++ b/config-model/src/test/derived/twostreamingstructs/streamingstruct.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search streamingstruct { +schema streamingstruct { document streamingstruct { field coupleof type string { @@ -15,7 +15,9 @@ search streamingstruct { struct s1 { field f1 type string { } - field f1s type string { match: substring } + field f1s type string { + match: substring + } field f2 type int { } field f3 type double { } # Allow default matchtypes in struct. Can be overridden. @@ -24,7 +26,9 @@ search streamingstruct { struct ns1 { field nf1 type s1 { } - field nf1s type s1 { match: substring } + field nf1s type s1 { + match: substring + } field nf2 type string { } # May specify nested structs. } diff --git a/config-model/src/test/derived/twostreamingstructs/whatever.sd b/config-model/src/test/derived/twostreamingstructs/whatever.sd index 17ac30102a8..c8c7279e4e1 100644 --- a/config-model/src/test/derived/twostreamingstructs/whatever.sd +++ b/config-model/src/test/derived/twostreamingstructs/whatever.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search whatever { +schema whatever { document whatever { struct pair { diff --git a/config-model/src/test/derived/types/types.sd b/config-model/src/test/derived/types/types.sd index 15fab360940..3a0eef1332d 100644 --- a/config-model/src/test/derived/types/types.sd +++ b/config-model/src/test/derived/types/types.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search types { +schema types { document types { diff --git a/config-model/src/test/derived/uri_array/uri_array.sd b/config-model/src/test/derived/uri_array/uri_array.sd index b0b874ba2c3..6521f332a2f 100644 --- a/config-model/src/test/derived/uri_array/uri_array.sd +++ b/config-model/src/test/derived/uri_array/uri_array.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search uri_array { +schema uri_array { document uri_array { field my_uri type array<uri> { indexing: index diff --git a/config-model/src/test/derived/uri_wset/uri_wset.sd b/config-model/src/test/derived/uri_wset/uri_wset.sd index ec08428019e..8af136bbfef 100644 --- a/config-model/src/test/derived/uri_wset/uri_wset.sd +++ b/config-model/src/test/derived/uri_wset/uri_wset.sd @@ -1,5 +1,5 @@ # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -search uri_wset { +schema uri_wset { document uri_wset { field my_uri type weightedset<uri> { indexing: index diff --git a/config-model/src/test/examples/outsidedoc.sd b/config-model/src/test/examples/outsidedoc.sd index 17e24b647bf..2214cdb2d8f 100644 --- a/config-model/src/test/examples/outsidedoc.sd +++ b/config-model/src/test/examples/outsidedoc.sd @@ -10,7 +10,6 @@ search outsidedoc { field a type string { indexing: index - # index-to: default } } diff --git a/config-model/src/test/examples/rankingexpressionfunction/rankingexpressionfunction.sd b/config-model/src/test/examples/rankingexpressionfunction/rankingexpressionfunction.sd index f0d1851af90..ec673cff773 100644 --- a/config-model/src/test/examples/rankingexpressionfunction/rankingexpressionfunction.sd +++ b/config-model/src/test/examples/rankingexpressionfunction/rankingexpressionfunction.sd @@ -22,7 +22,7 @@ search rankexpression { } rank-profile macros { - function titlematch$(var1, var2) { + function titlematch(var1, var2) { expression: file: titlematch } @@ -31,7 +31,7 @@ search rankexpression { } first-phase { - expression: 0.8+0.2*titlematch$(4,5)+0.8*titlematch$(7,8)*closeness(distance) + expression: 0.8+0.2*titlematch(4,5)+0.8*titlematch(7,8)*closeness(distance) } } diff --git a/config-model/src/test/examples/rankingexpressioninfile/rankingexpressioninfile.sd b/config-model/src/test/examples/rankingexpressioninfile/rankingexpressioninfile.sd index f19fa6d56e7..7c215fe0a76 100644 --- a/config-model/src/test/examples/rankingexpressioninfile/rankingexpressioninfile.sd +++ b/config-model/src/test/examples/rankingexpressioninfile/rankingexpressioninfile.sd @@ -5,7 +5,6 @@ search rankexpression { field artist type string { indexing: summary | index - # index-to: artist, default } } diff --git a/config-model/src/test/examples/simple.sd b/config-model/src/test/examples/simple.sd index 0593de1d5a6..5acc16d9937 100644 --- a/config-model/src/test/examples/simple.sd +++ b/config-model/src/test/examples/simple.sd @@ -59,7 +59,9 @@ schema simple { indexing: attribute } - field access type byte { indexing: attribute } + field access type byte { + indexing: attribute + } field categories_src type string { @@ -80,7 +82,7 @@ schema simple { field categoriesagain type string { indexing { - input categoriesagain_src | lowercase | normalize | index + input categoriesagain_src | lowercase | normalize | index; } } diff --git a/config-model/src/test/examples/stemmingsetting.sd b/config-model/src/test/examples/stemmingsetting.sd index 68df4d685fd..c3c2852ff65 100644 --- a/config-model/src/test/examples/stemmingsetting.sd +++ b/config-model/src/test/examples/stemmingsetting.sd @@ -19,7 +19,6 @@ search stemmingsetting { } field track type string { - # index-to: song, default stemming: shortest } diff --git a/config-model/src/test/java/com/yahoo/schema/processing/RankingExpressionsTestCase.java b/config-model/src/test/java/com/yahoo/schema/processing/RankingExpressionsTestCase.java index ace3788e49a..c985d427a5a 100644 --- a/config-model/src/test/java/com/yahoo/schema/processing/RankingExpressionsTestCase.java +++ b/config-model/src/test/java/com/yahoo/schema/processing/RankingExpressionsTestCase.java @@ -41,11 +41,11 @@ public class RankingExpressionsTestCase extends AbstractSchemaTestCase { Schema schema = createSearch("src/test/examples/rankingexpressionfunction", deployProperties, rankProfileRegistry); RankProfile functionsRankProfile = rankProfileRegistry.get(schema, "macros"); Map<String, RankProfile.RankingExpressionFunction> functions = functionsRankProfile.getFunctions(); - assertEquals(2, functions.get("titlematch$").function().arguments().size()); - assertEquals("var1", functions.get("titlematch$").function().arguments().get(0)); - assertEquals("var2", functions.get("titlematch$").function().arguments().get(1)); - assertEquals("var1 * var2 + 890", functions.get("titlematch$").function().getBody().getRoot().toString()); - assertEquals("0.8 + 0.2 * titlematch$(4,5) + 0.8 * titlematch$(7,8) * closeness(distance)", + assertEquals(2, functions.get("titlematch").function().arguments().size()); + assertEquals("var1", functions.get("titlematch").function().arguments().get(0)); + assertEquals("var2", functions.get("titlematch").function().arguments().get(1)); + assertEquals("var1 * var2 + 890", functions.get("titlematch").function().getBody().getRoot().toString()); + assertEquals("0.8 + 0.2 * titlematch(4,5) + 0.8 * titlematch(7,8) * closeness(distance)", functionsRankProfile.getFirstPhaseRanking().getRoot().toString()); assertEquals("78 + closeness(distance)", functions.get("artistmatch").function().getBody().getRoot().toString()); @@ -56,19 +56,19 @@ public class RankingExpressionsTestCase extends AbstractSchemaTestCase { List<Pair<String, String>> rankProperties = rawRankProfile.configProperties(); assertEquals(6, rankProperties.size()); - assertEquals("rankingExpression(titlematch$).rankingScript", rankProperties.get(2).getFirst()); + assertEquals("rankingExpression(titlematch).rankingScript", rankProperties.get(2).getFirst()); assertEquals("var1 * var2 + 890", rankProperties.get(2).getSecond()); assertEquals("rankingExpression(artistmatch).rankingScript", rankProperties.get(3).getFirst()); assertEquals("78 + closeness(distance)", rankProperties.get(3).getSecond()); assertEquals("rankingExpression(firstphase).rankingScript", rankProperties.get(5).getFirst()); - assertEquals("0.8 + 0.2 * rankingExpression(titlematch$@126063073eb2deb.ab95cd69909927c) + 0.8 * rankingExpression(titlematch$@c7e4c2d0e6d9f2a1.1d4ed08e56cce2e6) * closeness(distance)", rankProperties.get(5).getSecond()); + assertEquals("0.8 + 0.2 * rankingExpression(titlematch@126063073eb2deb.ab95cd69909927c) + 0.8 * rankingExpression(titlematch@c7e4c2d0e6d9f2a1.1d4ed08e56cce2e6) * closeness(distance)", rankProperties.get(5).getSecond()); - assertEquals("rankingExpression(titlematch$@c7e4c2d0e6d9f2a1.1d4ed08e56cce2e6).rankingScript", rankProperties.get(1).getFirst()); + assertEquals("rankingExpression(titlematch@c7e4c2d0e6d9f2a1.1d4ed08e56cce2e6).rankingScript", rankProperties.get(1).getFirst()); assertEquals("7 * 8 + 890", rankProperties.get(1).getSecond()); - assertEquals("rankingExpression(titlematch$@126063073eb2deb.ab95cd69909927c).rankingScript", rankProperties.get(0).getFirst()); + assertEquals("rankingExpression(titlematch@126063073eb2deb.ab95cd69909927c).rankingScript", rankProperties.get(0).getFirst()); assertEquals("4 * 5 + 890", rankProperties.get(0).getSecond()); } diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilderTest.java b/config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilderTest.java index 16b4a8bed9b..81649375c8a 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilderTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilderTest.java @@ -1095,6 +1095,39 @@ public class ContainerModelBuilderTest extends ContainerModelBuilderTestBase { logger.msgs.get(1).getSecond()); } + @Test + public void logs_accesslog_not_overidable_in_hosted() { + String containerService = joinLines("<container id='foo' version='1.0'>", + " <accesslog type='json' fileNamePattern='logs/vespa/qrs/access.%Y%m%d%H%M%S' symlinkName='json_access' />", + " <nodes count=\"2\">", + " </nodes>", + "</container>"); + + String deploymentXml = joinLines("<deployment version='1.0'>", + " <prod>", + " <region>us-east-1</region>", + " </prod>", + "</deployment>"); + + ApplicationPackage applicationPackage = new MockApplicationPackage.Builder() + .withServices(containerService) + .withDeploymentSpec(deploymentXml) + .build(); + + TestLogger logger = new TestLogger(); + DeployState deployState = new DeployState.Builder() + .applicationPackage(applicationPackage) + .zone(new Zone(Environment.prod, RegionName.from("us-east-1"))) + .properties(new TestProperties().setHostedVespa(true)) + .deployLogger(logger) + .build(); + createModel(root, deployState, null, DomBuilderTest.parse(containerService)); + assertFalse(logger.msgs.isEmpty()); + assertEquals(Level.WARNING, logger.msgs.get(0).getFirst()); + assertEquals("Applications are not allowed to override the 'accesslog' element", + logger.msgs.get(0).getSecond()); + } + private void assertComponentConfigured(ApplicationContainerCluster cluster, String componentId) { Component<?, ?> component = cluster.getComponentsMap().get(ComponentId.fromString(componentId)); assertNotNull(component); diff --git a/config-proxy/src/main/sh/vespa-config-ctl.sh b/config-proxy/src/main/sh/vespa-config-ctl.sh index 63122c0e0ec..8f2e6a44563 100755 --- a/config-proxy/src/main/sh/vespa-config-ctl.sh +++ b/config-proxy/src/main/sh/vespa-config-ctl.sh @@ -109,7 +109,7 @@ case $1 in nohup nice sbin/vespa-retention-enforcer > ${LOGDIR}/vre-start.log 2>&1 </dev/null & configsources=`bin/vespa-print-default configservers_rpc` userargs=$VESPA_CONFIGPROXY_JVMARGS - jvmopts="-Xms32M -Xmx128M -XX:CompressedClassSpaceSize=32m -XX:MaxDirectMemorySize=32m -XX:ThreadStackSize=448 -XX:MaxJavaStackTraceDepth=1000 -XX:-OmitStackTraceInFastThrow" + jvmopts="-Xms32M -Xmx128M -XX:+PreserveFramePointer -XX:+UseTransparentHugePages -XX:CompressedClassSpaceSize=32m -XX:MaxDirectMemorySize=32m -XX:ThreadStackSize=448 -XX:MaxJavaStackTraceDepth=1000 -XX:-OmitStackTraceInFastThrow" VESPA_SERVICE_NAME=configproxy export VESPA_SERVICE_NAME diff --git a/configserver/src/main/sh/start-configserver b/configserver/src/main/sh/start-configserver index 29fbfa9a3c1..6cf668e346a 100755 --- a/configserver/src/main/sh/start-configserver +++ b/configserver/src/main/sh/start-configserver @@ -164,6 +164,7 @@ fixddir $bundlecachedir vespa-run-as-vespa-user vespa-runserver -s ${VESPA_SERVICE_NAME} -r 30 -p $pidfile -- \ java \ -Xms128m -Xmx2048m \ + -XX:+UseTransparentHugePages \ -XX:+PreserveFramePointer \ -XX:+HeapDumpOnOutOfMemoryError \ -XX:HeapDumpPath="${VESPA_HOME}/var/crash" \ diff --git a/container-dependency-versions/pom.xml b/container-dependency-versions/pom.xml index d5ef2ae87a3..6b8fa8ffeb9 100644 --- a/container-dependency-versions/pom.xml +++ b/container-dependency-versions/pom.xml @@ -407,7 +407,7 @@ <!-- and then verify by doing: ' ls -l vespa/vespa_jersey2/target/dependency' --> <hk2.version>2.5.0-b32</hk2.version> <hk2.osgi-resource-locator.version>1.0.1</hk2.osgi-resource-locator.version> - <jackson2.version>2.12.6</jackson2.version> + <jackson2.version>2.13.3</jackson2.version> <jackson-databind.version>${jackson2.version}</jackson-databind.version> <javassist.version>3.20.0-GA</javassist.version> <javax.annotation-api.version>1.2</javax.annotation-api.version> diff --git a/container-disc/src/main/sh/vespa-start-container-daemon.sh b/container-disc/src/main/sh/vespa-start-container-daemon.sh index 1b943aa0591..7220fded911 100755 --- a/container-disc/src/main/sh/vespa-start-container-daemon.sh +++ b/container-disc/src/main/sh/vespa-start-container-daemon.sh @@ -174,14 +174,12 @@ configure_memory() { memory_options="-Xms${jvm_minHeapsize}m -Xmx${jvm_heapsize}m" memory_options="${memory_options} -XX:ThreadStackSize=${jvm_stacksize}" memory_options="${memory_options} -XX:MaxDirectMemorySize=${maxDirectMemorySize}m" + memory_options="${memory_options} -XX:+UseTransparentHugePages" if ((jvm_compressedClassSpaceSize != 0)); then memory_options="${memory_options} -XX:CompressedClassSpaceSize=${jvm_compressedClassSpaceSize}m" fi - if [ "${VESPA_USE_HUGEPAGES}" ]; then - memory_options="${memory_options} -XX:+UseLargePages" - fi } configure_cpu() { diff --git a/container-integration-test/pom.xml b/container-integration-test/pom.xml index 14d9950b389..5a0bee3b03b 100644 --- a/container-integration-test/pom.xml +++ b/container-integration-test/pom.xml @@ -22,6 +22,12 @@ <scope>test</scope> </dependency> <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> + <version>${apache.httpclient.version}</version> + <scope>test</scope> + </dependency> + <dependency> <groupId>com.yahoo.vespa</groupId> <artifactId>application</artifactId> <version>${project.version}</version> diff --git a/container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java b/container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java index 70f95998dcb..a1cad6de419 100644 --- a/container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java +++ b/container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java @@ -141,7 +141,7 @@ public class ClusterSearcher extends Searcher { SchemaInfo schemaInfo, VespaDocumentAccess access) { if (searchClusterConfig.searchdef().size() != 1) { - throw new IllegalArgumentException("Search clusters in streaming search shall only contain a single searchdefinition : " + searchClusterConfig.searchdef()); + throw new IllegalArgumentException("Search clusters in streaming search shall only contain a single schema : " + searchClusterConfig.searchdef()); } ClusterParams clusterParams = makeClusterParams(searchclusterIndex); VdsStreamingSearcher searcher = new VdsStreamingSearcher(access); diff --git a/document/src/main/java/com/yahoo/document/json/JsonSerializationHelper.java b/document/src/main/java/com/yahoo/document/json/JsonSerializationHelper.java index 340bd542885..a9d34fc78d8 100644 --- a/document/src/main/java/com/yahoo/document/json/JsonSerializationHelper.java +++ b/document/src/main/java/com/yahoo/document/json/JsonSerializationHelper.java @@ -32,10 +32,12 @@ import com.yahoo.document.serialization.FieldWriter; import com.yahoo.tensor.Tensor; import com.yahoo.tensor.TensorAddress; import com.yahoo.tensor.TensorType; +import com.yahoo.tensor.serialization.JsonFormat; import com.yahoo.vespa.objects.FieldBase; import java.io.IOException; import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; import java.util.Base64; import java.util.Iterator; import java.util.Map; @@ -71,6 +73,19 @@ public class JsonSerializationHelper { } } + public static void serializeTensorFieldShortForm(JsonGenerator generator, FieldBase field, TensorFieldValue value) { + wrapIOException(() -> { + fieldNameIfNotNull(generator, field); + if (value.getTensor().isPresent()) { + Tensor tensor = value.getTensor().get(); + generator.writeRawValue(new String(JsonFormat.encodeShortForm(tensor), StandardCharsets.UTF_8)); + } else { + generator.writeStartObject(); + generator.writeEndObject(); + } + }); + } + public static void serializeTensorField(JsonGenerator generator, FieldBase field, TensorFieldValue value) { wrapIOException(() -> { fieldNameIfNotNull(generator, field); diff --git a/document/src/main/java/com/yahoo/document/json/JsonWriter.java b/document/src/main/java/com/yahoo/document/json/JsonWriter.java index 95faf753877..05147d2c0ab 100644 --- a/document/src/main/java/com/yahoo/document/json/JsonWriter.java +++ b/document/src/main/java/com/yahoo/document/json/JsonWriter.java @@ -63,6 +63,7 @@ import static com.yahoo.document.json.JsonSerializationHelper.serializeStringFie import static com.yahoo.document.json.JsonSerializationHelper.serializeStructField; import static com.yahoo.document.json.JsonSerializationHelper.serializeStructuredField; import static com.yahoo.document.json.JsonSerializationHelper.serializeTensorField; +import static com.yahoo.document.json.JsonSerializationHelper.serializeTensorFieldShortForm; import static com.yahoo.document.json.JsonSerializationHelper.serializeWeightedSet; import static com.yahoo.document.json.document.DocumentParser.FIELDS; import static com.yahoo.document.json.document.DocumentParser.REMOVE; @@ -77,6 +78,8 @@ public class JsonWriter implements DocumentWriter { private static final JsonFactory jsonFactory = new JsonFactory(); private final JsonGenerator generator; + private final boolean tensorShortForm; + // I really hate exception unsafe constructors, but the alternative // requires generator to not be a final /** @@ -108,7 +111,12 @@ public class JsonWriter implements DocumentWriter { * the output JSON generator */ public JsonWriter(JsonGenerator generator) { + this(generator, false); + } + + public JsonWriter(JsonGenerator generator, boolean tensorShortForm) { this.generator = generator; + this.tensorShortForm = tensorShortForm; } /** @@ -206,7 +214,11 @@ public class JsonWriter implements DocumentWriter { @Override public void write(FieldBase field, TensorFieldValue value) { - serializeTensorField(generator, field, value); + if (tensorShortForm) { + serializeTensorFieldShortForm(generator, field, value); + } else { + serializeTensorField(generator, field, value); + } } @Override diff --git a/document/src/test/java/com/yahoo/document/json/JsonWriterTestCase.java b/document/src/test/java/com/yahoo/document/json/JsonWriterTestCase.java index 7573aba519f..b7f24368ad7 100644 --- a/document/src/test/java/com/yahoo/document/json/JsonWriterTestCase.java +++ b/document/src/test/java/com/yahoo/document/json/JsonWriterTestCase.java @@ -2,6 +2,7 @@ package com.yahoo.document.json; import com.fasterxml.jackson.core.JsonFactory; +import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.io.JsonStringEncoder; import com.fasterxml.jackson.databind.ObjectMapper; import com.yahoo.document.ArrayDataType; @@ -25,6 +26,7 @@ import com.yahoo.document.datatypes.TensorFieldValue; import com.yahoo.document.internal.GeoPosType; import com.yahoo.document.json.readers.DocumentParseInfo; import com.yahoo.document.json.readers.VespaJsonDocumentReader; +import com.yahoo.tensor.Tensor; import com.yahoo.tensor.TensorType; import com.yahoo.text.Utf8; import org.junit.After; @@ -32,6 +34,7 @@ import org.junit.Before; import org.junit.Test; import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; @@ -73,6 +76,7 @@ public class JsonWriterTestCase { registerSinglePositionDocumentType(); registerMultiPositionDocumentType(); registerTensorDocumentType(); + registerIndexedTensorDocumentType(); registerReferenceDocumentType(); } @@ -90,6 +94,13 @@ public class JsonWriterTestCase { types.registerDocumentType(x); } + private void registerIndexedTensorDocumentType() { + DocumentType x = new DocumentType("testindexedtensor"); + TensorType tensorType = new TensorType.Builder().indexed("x", 3).build(); + x.addField(new Field("tensorfield", new TensorDataType(tensorType))); + types.registerDocumentType(x); + } + private void registerMultiPositionDocumentType() { DocumentType x = new DocumentType("testmultipos"); DataType d = new ArrayDataType(PositionDataType.INSTANCE); @@ -336,7 +347,6 @@ public class JsonWriterTestCase { private Document readDocumentFromJson(String docId, String fields) throws IOException { InputStream rawDoc = new ByteArrayInputStream(asFeed(docId, fields)); - JsonReader r = new JsonReader(types, rawDoc, parserFactory); DocumentParseInfo raw = r.parseDocument().get(); DocumentType docType = r.readDocumentType(raw.documentId); @@ -433,6 +443,30 @@ public class JsonWriterTestCase { } @Test + public void testTensorShortForm() throws IOException { + DocumentType documentTypeWithTensor = types.getDocumentType("testindexedtensor"); + String docId = "id:unittest:testindexedtensor::0"; + Document doc = new Document(documentTypeWithTensor, docId); + Field tensorField = documentTypeWithTensor.getField("tensorfield"); + Tensor tensor = Tensor.from("tensor(x[3]):[1,2,3]"); + doc.setFieldValue(tensorField, new TensorFieldValue(tensor)); + + assertEqualJson(asDocument(docId, "{ \"tensorfield\": {\"cells\":[{\"address\":{\"x\":\"0\"},\"value\":1.0},{\"address\":{\"x\":\"1\"},\"value\":2.0},{\"address\":{\"x\":\"2\"},\"value\":3.0}]} }"), + writeDocument(doc, false)); + assertEqualJson(asDocument(docId, "{ \"tensorfield\": {\"type\":\"tensor(x[3])\", \"values\":[1.0, 2.0, 3.0] } }"), + writeDocument(doc, true)); + } + + private byte[] writeDocument(Document doc, boolean tensorShortForm) throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + JsonFactory factory = new JsonFactory(); + JsonGenerator generator = factory.createGenerator(out); + JsonWriter writer = new JsonWriter(generator, tensorShortForm); + writer.write(doc); + return out.toByteArray(); + } + + @Test public void non_empty_reference_field_is_roundtrip_json_serialized() throws IOException { roundTripEquality("id:unittest:testrefs::helloworld", "{ \"ref_field\": \"id:unittest:smoke::and_mirrors_too\" }"); diff --git a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java index 6d5c5a00bba..f84060063d7 100644 --- a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java +++ b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java @@ -409,6 +409,13 @@ public class Flags { "Takes effect immediately", APPLICATION_ID); + public static final UnboundBooleanFlag USE_YUM_PROXY_V2 = defineFeatureFlag( + "use-yumproxy-v2", false, + List.of("mortent"), "2022-05-05", "2022-06-01", + "Use yumproxy-v2", + "Takes effect on host admin restart", + HOSTNAME); + /** WARNING: public for testing: All flags should be defined in {@link Flags}. */ public static UnboundBooleanFlag defineFeatureFlag(String flagId, boolean defaultValue, List<String> owners, String createdAt, String expiresAt, String description, diff --git a/integration/intellij/build.gradle b/integration/intellij/build.gradle index 4374f6f964a..535911c5b8e 100644 --- a/integration/intellij/build.gradle +++ b/integration/intellij/build.gradle @@ -36,7 +36,7 @@ compileJava { } group 'ai.vespa' -version '1.1.6' // Also update pom.xml version if this is changed +version '1.2.0' // Also update pom.xml version if this is changed sourceCompatibility = 11 @@ -64,10 +64,7 @@ patchPluginXml { untilBuild = '213.*' // in changeNotes you can add a description of the changes in this version (would appear in the plugin page in preferences\plugins) changeNotes = """ - Support for default values in inputs. - Support for unified constant syntax. - Support all tensor formats. - Support tensor generate functions. + Complete grammar (no more red squiggles) """ } diff --git a/integration/intellij/pom.xml b/integration/intellij/pom.xml index 3f2a4c24771..dfc44ab9dc2 100644 --- a/integration/intellij/pom.xml +++ b/integration/intellij/pom.xml @@ -9,7 +9,7 @@ <relativePath>../parent/pom.xml</relativePath> </parent> <artifactId>vespa-intellij</artifactId> <!-- Not used - plugin is build by gradle --> - <version>1.1.6</version> <!-- See copy-zip below, which depends on this being the same as the v. in build.gradle --> + <version>1.2.0</version> <!-- See copy-zip below, which depends on this being the same as the v. in build.gradle --> <description> Maven wrapper for the gradle build of this IntelliJ plugin. </description> diff --git a/integration/intellij/src/main/bnf/ai/vespa/intellij/schema/parser/sd.bnf b/integration/intellij/src/main/bnf/ai/vespa/intellij/schema/parser/sd.bnf index 87c4a012fb5..2e2df7ef410 100644 --- a/integration/intellij/src/main/bnf/ai/vespa/intellij/schema/parser/sd.bnf +++ b/integration/intellij/src/main/bnf/ai/vespa/intellij/schema/parser/sd.bnf @@ -3,7 +3,8 @@ * Vespa schema file grammar. * NOTE: This grammar does not enforce zero-or-one occurrences of elements (treats it like zero-to-many) * - * @author: Shahar Ariel + * @author Shahar Ariel + * @author bratseth */ { @@ -24,33 +25,32 @@ tokenTypeClass="ai.vespa.intellij.schema.psi.SdTokenType" // Class which will be used to create leaf nodes. extends(".*Expr")=RankingExpression // Here to deal with left-recursion that happens in expressions - + + // NOTE: As far as I (Jon) can tell these are not used. Edit the ones in sd.flex instead. tokens = [ ID_REG = 'regexp:[a-zA-Z_][a-zA-Z0-9_]*' - ID_WITH_DASH_REG = 'regexp:[a-zA-Z_][a-zA-Z0-9_-]*' WHITE_SPACE = 'regexp:\s+' COMMENT = 'regexp:#.*' SYMBOL = 'regexp:[!$|:{}().\[\]]' COMMA = 'regexp:[,]' - //BLOCK_START = '{' - //BLOCK_END = '}' INTEGER_REG = 'regexp:[0-9]+' - FLOAT_REG = 'regexp:[0-9]+[.][0-9]+[e]?' - STRING_REG = 'regexp:\"([^\"\\]*(\\.[^\"\\]*)*)\"' // TODO: Should also support single-quotes + FLOAT_REG = 'regexp:[0-9]+[.][0-9]+([eE][-]?[0-9]+)?' + STRING_REG = 'regexp:\"([^\"\\]*(\\.[^\"\\]*)*)\"' + STRING_REG_SINGLE_QUOTE = "regexp:'([^'\\]*(\\.[^'\\]*)*)'" WORD_REG = 'regexp:\w+' ] } -SdFile ::= SchemaDefinition | DocumentDefinition | RankProfileDefinition -SchemaDefinition ::= (search | schema) IdentifierVal? (inherits IdentifierVal)? '{' SchemaBody '}' -SchemaBody ::= SchemaBodyOptions* DocumentDefinition SchemaBodyOptions* // Does not support zero-or-one occurrences +SdFile ::= NL* ( SchemaDefinition | DocumentDefinition | RankProfileDefinition ) +SchemaDefinition ::= (search | schema) IdentifierVal? NL* (inherits IdentifierVal)? BlockStart SchemaBody BlockEnd +SchemaBody ::= ( SchemaBodyOptions | NL )* DocumentDefinition ( SchemaBodyOptions | NL )* // Does not support zero-or-one occurrences private SchemaBodyOptions ::= SchemaFieldDefinition | ImportFieldDefinition | DocumentSummaryDefinition | RankProfileDefinition | IndexDefinition | DocumentStructDefinition | FieldSetDefinition | ConstantDefinition | OnnxModelDefinition | StemmingDefinition | - raw-as-base64-in-summary | SchemaAnnotationDefinition + ( raw-as-base64-in-summary ':' (true | false) ) | SchemaAnnotationDefinition -SchemaFieldDefinition ::= field IdentifierVal type FieldTypeName '{' SchemaFieldBody '}' +SchemaFieldDefinition ::= field IdentifierVal type FieldTypeName BlockStart SchemaFieldBody BlockEnd { mixin="ai.vespa.intellij.schema.psi.impl.SdNamedElementImpl" implements=["ai.vespa.intellij.schema.psi.SdDeclaration" "ai.vespa.intellij.schema.psi.SdNamedElement"] } @@ -63,33 +63,33 @@ private SingleValueFieldTypeName ::= "string" | "int" | "long" | "bool" | "byte" private TensorType ::= "tensor" ('<' ("float" | "double" | "int8" | "bfloat16") '>')? '(' TensorDimension (COMMA TensorDimension)* ')' private TensorDimension ::= WordWrapper (('{' '}') | ('[' INTEGER_REG ']')) -SchemaFieldBody ::= DocumentFieldBodyOptions* // Fields of schemas and documents defined the same way here +SchemaFieldBody ::= ( DocumentFieldBodyOptions | NL )* // Fields of schemas and documents defined the same way here -DocumentSummaryDefinition ::= document-summary IdentifierWithDashVal (inherits IdentifierWithDashVal)? '{' DocumentSummaryBody '}' +DocumentSummaryDefinition ::= document-summary IdentifierWithDashVal (inherits IdentifierWithDashVal)? BlockStart DocumentSummaryBody BlockEnd { mixin="ai.vespa.intellij.schema.psi.impl.SdNamedElementImpl" implements=["ai.vespa.intellij.schema.psi.SdDeclaration" "ai.vespa.intellij.schema.psi.SdNamedElement"] } -DocumentSummaryBody ::= DocumentSummaryBodyOptions* // Does not support zero-or-one occurrences +DocumentSummaryBody ::= ( DocumentSummaryBodyOptions NL* )* // Does not support zero-or-one occurrences private DocumentSummaryBodyOptions ::= SummaryDefinition | omit-summary-features | from-disk -ImportFieldDefinition ::= import field IdentifierVal '.' IdentifierVal as IdentifierVal '{''}' +ImportFieldDefinition ::= import field IdentifierVal '.' IdentifierVal as IdentifierVal BlockStart BlockEnd { mixin="ai.vespa.intellij.schema.psi.impl.SdNamedElementImpl" implements=["ai.vespa.intellij.schema.psi.SdDeclaration" "ai.vespa.intellij.schema.psi.SdNamedElement"] } -FieldSetDefinition ::= fieldset IdentifierVal '{' FieldSetBody '}' -FieldSetBody ::= FieldSetBodyOptions* +FieldSetDefinition ::= fieldset IdentifierVal BlockStart FieldSetBody BlockEnd +FieldSetBody ::= ( FieldSetBodyOptions | NL )* private FieldSetBodyOptions ::= (fields ':' DottedIdentifier (COMMA DottedIdentifier)*) | QueryCommandDefinition | MatchDefinition -ConstantDefinition ::= constant IdentifierVal '{' ConstantBody '}' -ConstantBody ::= ConstantBodyOptions* +ConstantDefinition ::= constant IdentifierVal BlockStart ConstantBody BlockEnd +ConstantBody ::= ( ConstantBodyOptions | NL )* private ConstantBodyOptions ::= (file ':' FilePath) | (uri ':' UriPath) | (type ':' TensorType) -private FilePath ::= WordWrapper (('.' | '/') WordWrapper)+ +private FilePath ::= ( WordWrapper | INTEGER_REG) (('.' | '/' | '-') ( WordWrapper | INTEGER_REG) )+ private UriPath ::= ('H'|'h') ('T'|'t') ('T'|'t') ('P'|'p') ('S'|'s')? ':' ('//')? (IdentifierWithDashVal | '.' | '/' | ':')+ -OnnxModelDefinition ::= onnx-model IdentifierVal '{' OnnxModelBody '}' -OnnxModelBody ::= OnnxModelBodyOptions* +OnnxModelDefinition ::= onnx-model IdentifierVal BlockStart OnnxModelBody BlockEnd +OnnxModelBody ::= ( OnnxModelBodyOptions | NL )* private OnnxModelBodyOptions ::= (file ':' FilePath) | (uri ':' UriPath) | ((input | output) (RankFeature | IdentifierVal | STRING_REG) ':' ('.' | '/' | '(' | ')' | IdentifierWithDashVal | WORD_REG)) @@ -98,8 +98,8 @@ SchemaAnnotationDefinition ::= AnnotationDefinition implements=["ai.vespa.intellij.schema.psi.SdDeclaration" "ai.vespa.intellij.schema.psi.SdNamedElement"] } -private AnnotationDefinition ::= annotation IdentifierVal (inherits IdentifierVal)? '{' AnnotationFieldDefinition* '}' -AnnotationFieldDefinition ::= field IdentifierVal type FieldTypeName '{' '}' +private AnnotationDefinition ::= annotation IdentifierVal (inherits IdentifierVal)? BlockStart AnnotationFieldDefinition* BlockEnd +AnnotationFieldDefinition ::= field IdentifierVal type FieldTypeName BlockStart BlockEnd { mixin="ai.vespa.intellij.schema.psi.impl.SdNamedElementImpl" implements=["ai.vespa.intellij.schema.psi.SdDeclaration" "ai.vespa.intellij.schema.psi.SdNamedElement"] } @@ -110,149 +110,172 @@ AnnotationFieldDefinition ::= field IdentifierVal type FieldTypeName '{' '}' // NOTE: These must end by "Expr" - see this line above: extends(".*Expr")=RankingExpression // The *Expr alternatives are consumed greedily so order matters. //------------------------- -RankingExpression ::= LiteralOrGenerateTensorExpr | FilePathExpr | ParenthesisedExpr | BooleanExpr | ArithmeticExpr | IfFunctionExpr | - QueryDefinitionExpr | FunctionCallOrLambdaExpr | InListRankingExpr | PrimitiveExpr | SliceExpr +RankingExpression ::= RenameExpr | LiteralOrGenerateTensorExpr | FilePathExpr | ParenthesisedExpr | BinaryExpr | UnaryExpr | + IfFunctionExpr | FunctionCallOrLambdaExpr | RankFeatureExpr | InListRankingExpr | PrimitiveExpr | SliceExpr FilePathExpr ::= file ':' (FilePath | WordWrapper) -IfFunctionExpr ::= "if" '(' RankingExpression COMMA RankingExpression COMMA RankingExpression ')' - -InListRankingExpr ::= RankingExpression "in" '[' RankingExpression (COMMA RankingExpression)* ']' +IfFunctionExpr ::= "if" ClauseStart RankingExpression CommaSeparator RankingExpression CommaSeparator RankingExpression ClauseEnd -BooleanExpr ::= RankingExpression ComparisonOperator RankingExpression +InListRankingExpr ::= RankingExpression "in" '[' RankingExpression (CommaSeparator RankingExpression)* ']' +BinaryExpr ::= RankingExpression NL* ( ArithmeticOperator | ComparisonOperator) NL* RankingExpression +ArithmeticOperator ::= '+' | '-' | '*' | '/' | '%' | '^' | "||" | "&&" ComparisonOperator ::= '<' | '>' | "==" | "<=" | ">=" | "~=" | "!=" -ArithmeticExpr ::= RankingExpression ArithmeticOperator RankingExpression +UnaryExpr ::= UnaryOperator NL* RankingExpression +UnaryOperator ::= '!' | '-' -ArithmeticOperator ::= '+' | '-' | '*' | '/' | '%' | '^' | "||" | "&&" +RankFeatureExpr ::= RankFeature -QueryDefinitionExpr ::= QueryDefinition | ItemRawScoreDefinition +// The rename function allows lists of identifiers as arguments +RenameExpr ::= "rename" ClauseStart RankingExpression CommaSeparator + ( ArgumentDeclarations | ArgumentDeclaration ) CommaSeparator + ( ArgumentDeclarations | ArgumentDeclaration ) + ClauseEnd // Rough parsing but hard to do better due to greediness: If this is a lambda arg expressions must be identifiers -FunctionCallOrLambdaExpr ::= IdentifierWithDashVal '(' RankingExpression (COMMA RankingExpression)* ')' ('.' IdentifierWithDashVal)? - ParenthesisedExpr? // This turns the function call into a lambda +FunctionCallOrLambdaExpr ::= IdentifierVal ClauseStart RankingExpression ( CommaSeparator RankingExpression )* ClauseEnd ( '.' IdentifierVal )? + (ParenthesisedExpr)? // This turns the function call into a lambda -ParenthesisedExpr ::= '(' RankingExpression ')' +ParenthesisedExpr ::= ClauseStart RankingExpression ClauseEnd -PrimitiveExpr ::= ( (('-')? INTEGER_REG) | (('-')? FLOAT_REG) | IdentifierVal | RankFeature | STRING_REG ) +PrimitiveExpr ::= ( AnyNumber | ('$')?IdentifierVal | RankFeature | STRING_REG | STRING_REG_SINGLE_QUOTE ) SliceExpr ::= RankingExpression ( SliceKey | SliceIndex | FullTensorAddress ) -GenerateExpr ::= TensorType ParenthesisedExpr - -SliceKey ::= '{' Label '}' +SliceKey ::= BlockStart Label BlockEnd SliceIndex ::= '[' RankingExpression ']' -FullTensorAddress ::= '{' KeyValue ( ',' KeyValue )* '}' +FullTensorAddress ::= BlockStart KeyValue ( CommaSeparator KeyValue )* BlockEnd -KeyValue ::= IdentifierVal ':' ( Label | RankingExpression ) +KeyValue ::= IdentifierVal ':' ( RankingExpression | Label ) -Label ::= IdentifierVal | STRING_REG +Label ::= IdentifierVal | STRING_REG | STRING_REG_SINGLE_QUOTE LiteralOrGenerateTensorExpr ::= TensorType ( - ( ':' TensorValue ) | // literal verbose form tensor + ( NL* ':' NL* TensorValue ) | // literal verbose form tensor ParenthesisedExpr // generate tensor ) TensorValue ::= MappedTensorValue | ArrayTensorValues -MappedTensorValue ::= '{' MappedTensorBlock ( ',' MappedTensorBlock )* '}' -MappedTensorBlock ::= TensorAddress ':' ( FLOAT_REG | ArrayTensorValues ) -ArrayTensorValues ::= '[' ( FLOAT_REG | ArrayTensorValues ) ( ',' ( FLOAT_REG | ArrayTensorValues ) )* ']' +MappedTensorValue ::= BlockStart MappedTensorBlock ( COMMA MappedTensorBlock )* BlockEnd +MappedTensorBlock ::= TensorAddress ':' ( TensorCellValue | ArrayTensorValues ) +ArrayTensorValues ::= NL* '[' NL* ( TensorCellValue | ArrayTensorValues ) ( CommaSeparator ( TensorCellValue | ArrayTensorValues ) )* NL* ']' NL* TensorAddress ::= Label | FullTensorAddress +TensorCellValue ::= RankingExpression //------------------------- //-- Rank Profile rules --- //------------------------- -RankProfileDefinition ::= (rank-profile | model) IdentifierWithDashVal (inherits IdentifierWithDashVal (COMMA IdentifierWithDashVal)*)? '{' RankProfileBody '}' +RankProfileDefinition ::= (rank-profile | model) IdentifierWithDashVal (inherits IdentifierWithDashVal (COMMA IdentifierWithDashVal)*)? BlockStart RankProfileBody BlockEnd { mixin="ai.vespa.intellij.schema.psi.impl.SdNamedElementImpl" implements=["ai.vespa.intellij.schema.psi.SdDeclaration"] } -private RankProfileBody ::= RankProfileBodyOptions* // Does not support zero-or-one occurrences +private RankProfileBody ::= ( RankProfileBodyOptions | NL )* private RankProfileBodyOptions ::= MatchPhaseDefinition | NumThreadsDefinition | FunctionDefinition | TermwiseLimitDefinition | ignore-default-rank-features | RankPropertiesDefinition | FirstPhaseDefinition | SummaryFeaturesDefinition | MatchFeaturesDefinition | RankFeaturesDefinition | SecondPhaseDefinition | ConstantsDefinition | RankDefinition | RankTypeDefinition | - MinHitsDefinition | NumSearchPartitionDefinition | FieldWeightDefinition | StrictDefinition | + MinHitsDefinition | NumSearchPartitionsDefinition | FieldWeightDefinition | StrictDefinition | InputsDefinition -MatchPhaseDefinition ::= match-phase '{' MatchPhaseBody '}' -MatchPhaseBody ::= MatchPhaseBodyOptions+ -MatchPhaseBodyOptions ::= (attribute ':' DottedIdentifiers) | (order ':' (ascending | descending)) | (max-hits ':' ('-')? INTEGER_REG) - | DiversityDefinition | (evaluation-point ':' ('-')? FLOAT_REG) | - (pre-post-filter-tipping-point ':' ('-')? FLOAT_REG) // Does not support zero-or-one occurrences -DiversityDefinition ::= diversity '{' DiversityBody '}' -DiversityBody ::= DiversityBodyOptions* -private DiversityBodyOptions ::= (attribute ':' DottedIdentifiers) | (min-groups ':' ('-')? INTEGER_REG) | (cutoff-factor ':' ('-')? FLOAT_REG) | +MatchPhaseDefinition ::= match-phase BlockStart MatchPhaseBody BlockEnd +MatchPhaseBody ::= ( MatchPhaseBodyOptions | NL )* +MatchPhaseBodyOptions ::= (attribute ':' DottedIdentifier) | (order ':' (ascending | descending)) | (max-hits ':' INTEGER_REG) + | DiversityDefinition | (evaluation-point ':' FLOAT_REG) | + (pre-post-filter-tipping-point ':' FLOAT_REG) // Does not support zero-or-one occurrences +DiversityDefinition ::= diversity BlockStart DiversityBody BlockEnd +DiversityBody ::= ( DiversityBodyOptions | NL )* +private DiversityBodyOptions ::= (attribute ':' DottedIdentifier) | (min-groups ':' INTEGER_REG) | (cutoff-factor ':' FLOAT_REG) | (cutoff-strategy ':' (strict | loose)) private NumThreadsDefinition ::= num-threads-per-search ':' INTEGER_REG -private TermwiseLimitDefinition ::= termwise-limit ':' ('-')? (FLOAT_REG | INTEGER_REG) -private MinHitsDefinition ::= min-hits-per-thread ':' ('-')? INTEGER_REG -private NumSearchPartitionDefinition ::= num-search-partition ':' INTEGER_REG -FieldWeightDefinition ::= weight DottedIdentifiers ':' INTEGER_REG +private TermwiseLimitDefinition ::= termwise-limit ':' (FLOAT_REG | INTEGER_REG) +private MinHitsDefinition ::= min-hits-per-thread ':' INTEGER_REG +private NumSearchPartitionsDefinition ::= num-search-partitions ':' INTEGER_REG +FieldWeightDefinition ::= weight DottedIdentifier ':' INTEGER_REG StrictDefinition ::= strict ':' (true | false) -InputsDefinition ::= inputs '{' InputDefinition* '}' -InputDefinition ::= ( QueryDefinition | IdentifierVal) +InputsDefinition ::= inputs BlockStart ( InputDefinition | NL )* BlockEnd +InputDefinition ::= ( QueryFeature | IdentifierVal) (':')? - ( TensorType | "double" )? (':' ( TensorValue | FLOAT_REG | INTEGER_REG) )? + ( TensorType | "double" )? (':'? ( AnyNumber | TensorValue ) )? -FirstPhaseDefinition ::= first-phase '{' FirstPhaseBody '}' { mixin="ai.vespa.intellij.schema.psi.impl.SdFirstPhaseDefinitionMixin" } -FirstPhaseBody ::= FirstPhaseBodyOptions* // Does not support zero-or-one occurrences -private FirstPhaseBodyOptions ::= (keep-rank-count ':' INTEGER_REG) | (rank-score-drop-limit ':' ('-')? (FLOAT_REG | INTEGER_REG)) | ExpressionDefinition +FirstPhaseDefinition ::= first-phase BlockStart FirstPhaseBody BlockEnd + { mixin="ai.vespa.intellij.schema.psi.impl.SdFirstPhaseDefinitionMixin" } +FirstPhaseBody ::= ( FirstPhaseBodyOptions | NL )* // Does not support zero-or-one occurrences +private FirstPhaseBodyOptions ::= (keep-rank-count ':' INTEGER_REG) | (rank-score-drop-limit ':' AnyNumber) | ExpressionDefinition -ExpressionDefinition ::= expression ((':' RankingExpression) | ('{' RankingExpression* '}')) +ExpressionDefinition ::= expression ((':' RankingExpression) | (BlockStart RankingExpression* BlockEnd)) -SecondPhaseDefinition ::= second-phase '{' SecondPhaseBody '}' -SecondPhaseBody ::= SecondPhaseBodyOptions* +SecondPhaseDefinition ::= second-phase BlockStart SecondPhaseBody BlockEnd +SecondPhaseBody ::= ( SecondPhaseBodyOptions | NL )* private SecondPhaseBodyOptions ::= (rerank-count ':' INTEGER_REG) | ExpressionDefinition -RankPropertiesDefinition ::= rank-properties '{' RankPropertiesBody '}' -RankPropertiesBody ::= (RankPropertiesKey ':' RankPropertiesValue)+ +RankPropertiesDefinition ::= rank-properties BlockStart RankPropertiesBody BlockEnd +RankPropertiesBody ::= (RankPropertiesKey ':' RankPropertiesValue NL+ )+ RankPropertiesKey ::= (IdentifierWithDashVal | STRING_REG | '(' | ')' | '.' | COMMA | '$' | INTEGER_REG)+ -RankPropertiesValue ::= (('-')? INTEGER_REG) | (('-')? FLOAT_REG) | WORD_REG | DottedIdentifiers | STRING_REG +RankPropertiesValue ::= AnyNumber | WORD_REG | DottedIdentifier | STRING_REG -FunctionDefinition ::= (function | macro) inline? IdentifierVal ( '()' | '(' (ArgumentDefinition (COMMA ArgumentDefinition)*)? ')' ) - '{' ExpressionDefinition '}' +FunctionDefinition ::= (function | macro) inline? IdentifierVal ArgumentDeclarations + BlockStart ExpressionDefinition BlockEnd { mixin="ai.vespa.intellij.schema.psi.impl.SdNamedElementImpl" implements=["ai.vespa.intellij.schema.psi.SdFunctionDefinitionInterface" "ai.vespa.intellij.schema.psi.SdNamedElement"] } -ArgumentDefinition ::= IdentifierVal + +ArgumentDeclarations ::= '()' | ( ClauseStart ArgumentDeclaration (CommaSeparator ArgumentDeclaration)* NL* ClauseEnd ) +ArgumentDeclaration ::= IdentifierVal { mixin="ai.vespa.intellij.schema.psi.impl.SdNamedElementImpl" implements=["ai.vespa.intellij.schema.psi.SdDeclaration" "ai.vespa.intellij.schema.psi.SdNamedElement"] } -SummaryFeaturesDefinition ::= summary-features ((':' RankFeature+) | ((inherits IdentifierWithDashVal)? '{' RankFeature* '}')) -i -MatchFeaturesDefinition ::= match-features ((':' RankFeature+) | ((inherits IdentifierWithDashVal)? '{' RankFeature* '}')) +SummaryFeaturesDefinition ::= summary-features ((':' RankFeature+ NL+) | ((inherits IdentifierWithDashVal)? BlockStart ( RankFeature | NL )* BlockEnd)) + +MatchFeaturesDefinition ::= match-features ((':' RankFeature+ NL+) | ((inherits IdentifierWithDashVal)? BlockStart ( RankFeature | NL )* BlockEnd)) -RankFeaturesDefinition ::= rank-features ((':' RankFeature+) | ('{' RankFeature* '}')) +RankFeaturesDefinition ::= rank-features ((':' RankFeature+ NL+) | (BlockStart ( RankFeature | NL )* BlockEnd)) -ConstantsDefinition ::= constants '{' InnerConstantDefinition* '}' +ConstantsDefinition ::= constants BlockStart ( InnerConstantDefinition | NL )* BlockEnd -InnerConstantDefinition ::= ( ("constant" '(' IdentifierVal ')') | IdentifierVal ) +InnerConstantDefinition ::= ( ("constant" ClauseStart IdentifierVal ClauseEnd ) | IdentifierVal ) (':')? ( TensorType | "double" )? - (':')? ( TensorValue | FLOAT_REG | INTEGER_REG | (file ':' FilePath) | (uri ':' UriPath)) + (':')? ( TensorValue | AnyNumber | (file ':' FilePath) | (uri ':' UriPath)) -RankFeature ::= QueryDefinition | ItemRawScoreDefinition | FunctionCallExpr | DottedIdentifierWithDash -QueryDefinition ::= "query" '(' IdentifierWithDashVal ')' +RankFeature ::= ForEachFeature | ( IdentifierVal (FeatureArguments)? ( '.' IdentifierVal )* ) { mixin="ai.vespa.intellij.schema.psi.impl.SdNamedElementImpl" implements=["ai.vespa.intellij.schema.psi.SdDeclaration" "ai.vespa.intellij.schema.psi.SdNamedElement"] } -ItemRawScoreDefinition ::= "itemRawScore" '(' IdentifierVal ')' - { mixin="ai.vespa.intellij.schema.psi.impl.SdNamedElementImpl" - implements=["ai.vespa.intellij.schema.psi.SdDeclaration" "ai.vespa.intellij.schema.psi.SdNamedElement"] - } - +QueryFeature ::= "query" '(' IdentifierWithDashVal ')' + { mixin="ai.vespa.intellij.schema.psi.impl.SdNamedElementImpl" + implements=["ai.vespa.intellij.schema.psi.SdDeclaration" "ai.vespa.intellij.schema.psi.SdNamedElement"] + } + +// Needs special handling due to the nested rank feature, and the condition +ForEachFeature ::= "foreach" ClauseStart + IdentifierVal CommaSeparator // dimension + IdentifierVal CommaSeparator // variable + RankFeature CommaSeparator // feature + ( ('>' AnyNumber) | ('<' AnyNumber) | "true" | STRING_REG ) CommaSeparator // condition + IdentifierVal // operation + ClauseEnd + +// Not using ClauseEnd here to avoid consuming trailing NL's, which must be left to terminate single-line +// rank feature lists in summary/match/rank-features +FeatureArguments ::= '()' | ( ClauseStart FeatureArgument (CommaSeparator FeatureArgument)* NL* ')' ) +FeatureArgument ::= DottedIdentifier | INTEGER_REG | STRING_REG | STRING_REG_SINGLE_QUOTE + { mixin="ai.vespa.intellij.schema.psi.impl.SdNamedElementImpl" + implements=["ai.vespa.intellij.schema.psi.SdDeclaration" "ai.vespa.intellij.schema.psi.SdNamedElement"] + } + //------------------------- //---- Document rules ----- //------------------------- -DocumentDefinition ::= document (IdentifierVal (inherits IdentifierVal (COMMA IdentifierVal)*)?)? '{' DocumentBody '}' +DocumentDefinition ::= document (IdentifierVal (inherits IdentifierVal (COMMA IdentifierVal)*)?)? BlockStart DocumentBody BlockEnd { mixin="ai.vespa.intellij.schema.psi.impl.SdNamedElementImpl" implements=["ai.vespa.intellij.schema.psi.SdDeclaration" "ai.vespa.intellij.schema.psi.SdNamedElement"] } -DocumentBody ::= DocumentBodyOptions* +DocumentBody ::= ( DocumentBodyOptions | NL )* DocumentBodyOptions ::= DocumentStructDefinition | DocumentFieldDefinition | DocumentAnnotationDefinition DocumentAnnotationDefinition ::= AnnotationDefinition @@ -260,121 +283,120 @@ DocumentAnnotationDefinition ::= AnnotationDefinition implements=["ai.vespa.intellij.schema.psi.SdDeclaration" "ai.vespa.intellij.schema.psi.SdNamedElement"] } -DocumentStructDefinition ::= struct IdentifierVal '{' DocumentStructBody '}' +DocumentStructDefinition ::= struct IdentifierVal (inherits IdentifierVal)? BlockStart DocumentStructBody BlockEnd { mixin="ai.vespa.intellij.schema.psi.impl.SdNamedElementImpl" implements=["ai.vespa.intellij.schema.psi.SdDeclaration" "ai.vespa.intellij.schema.psi.SdNamedElement"] } -DocumentStructBody ::= DocumentStructFieldDefinition* -DocumentStructFieldDefinition ::= field IdentifierVal type FieldTypeName '{' DocumentStructFieldBody '}' +DocumentStructBody ::= ( DocumentStructFieldDefinition | NL )* +DocumentStructFieldDefinition ::= field IdentifierVal type FieldTypeName BlockStart DocumentStructFieldBody BlockEnd { mixin="ai.vespa.intellij.schema.psi.impl.SdNamedElementImpl" implements=["ai.vespa.intellij.schema.psi.SdDeclaration" "ai.vespa.intellij.schema.psi.SdNamedElement"] } - -DocumentStructFieldBody ::= MatchDefinition? +DocumentStructFieldBody ::= ( MatchDefinition NL* )? -DocumentFieldDefinition ::= field IdentifierVal type FieldTypeName '{' DocumentFieldBody '}' +DocumentFieldDefinition ::= field IdentifierVal type FieldTypeName BlockStart DocumentFieldBody BlockEnd { mixin="ai.vespa.intellij.schema.psi.impl.SdNamedElementImpl" implements=["ai.vespa.intellij.schema.psi.SdDeclaration" "ai.vespa.intellij.schema.psi.SdNamedElement"] } -DocumentFieldBody ::= DocumentFieldBodyOptions* // Does not support zero-or-one occurrences +DocumentFieldBody ::= ( DocumentFieldBodyOptions | NL )* // Does not support zero-or-one occurrences private DocumentFieldBodyOptions ::= StructFieldDefinition | MatchDefinition | IndexingDefinition | AttributeDefinition | AliasDefinition | RankDefinition | IndexingRewriteState | QueryCommandDefinition | SummaryDefinition | BoldingDefinition | (id ':' INTEGER_REG) | IndexDefinition | (normalizing ':' IdentifierWithDashVal) | SortingDefinition | StemmingDefinition | (weight ':' INTEGER_REG) | WeightedSetDefinition | RankTypeDefinition | DictionaryDefinition | SummaryToDefinition | header | body -//***** Field's body elements ******// + // Struct -StructFieldDefinition ::= struct-field DottedIdentifier '{' StructFieldBody '}' +StructFieldDefinition ::= struct-field DottedIdentifier BlockStart StructFieldBody BlockEnd { mixin="ai.vespa.intellij.schema.psi.impl.SdNamedElementImpl" implements=["ai.vespa.intellij.schema.psi.SdDeclaration" "ai.vespa.intellij.schema.psi.SdNamedElement"] } -StructFieldBody ::= StructFieldBodyOptions* // Does not support zero-or-one occurrences -StructFieldBodyOptions ::= IndexingDefinition | AttributeDefinition | MatchDefinition | QueryCommandDefinition | - StructFieldDefinition | SummaryDefinition +StructFieldBody ::= ( StructFieldBodyOptions | NL )* // Does not support zero-or-one occurrences +StructFieldBodyOptions ::= SummaryDefinition | IndexingDefinition | AttributeDefinition | MatchDefinition | + QueryCommandDefinition | StructFieldDefinition | RankDefinition + // Match -MatchDefinition ::= match ((':' MatchProperty) | ('{' MatchProperty+ '}')) +MatchDefinition ::= match ((':' MatchProperty NL*) | ( BlockStart ( MatchProperty NL* )* BlockEnd)) MatchProperty ::= text | token | exact | (exact-terminator ':' STRING_REG) | word | prefix | cased | uncased | substring | suffix | (max-length ':' INTEGER_REG) | gram | (gram-size ':' INTEGER_REG) | WordWrapper // Indexing -IndexingDefinition ::= indexing ((':' IndexingStatement) | ('{' IndexingStatement+ '}')) -IndexingStatement ::= IndexingStatementOptions (('|' IndexingStatementOptions)*) (';')? - // Does not support zero-or-one occurrences -IndexingStatementOptions ::= summary | attribute | index | set_language | lowercase | - (input (DottedIdentifier | IndexingStuff)+) | - ('{' IndexingStatementOptions '}') | IndexingStuff+ -private IndexingStuff ::= WordWrapper | INTEGER_REG | FLOAT_REG | STRING_REG | ('{' IndexingStatement '}') | - ':' | ('|' IndexingStatementOptions) | ';' | '.' | '(' | ')' | ArithmeticOperator | ComparisonOperator +IndexingDefinition ::= indexing ((':' IndexingStatement NL+) | ( BlockStart ( IndexingStatement ';' NL* )* BlockEnd)) +IndexingStatement ::= IndexingExpression (('|' IndexingExpression)*) +IndexingExpression ::= (input ( DottedIdentifier | IndexingStuff )+ )+ | + summary DottedIdentifier? | attribute DottedIdentifier? | index DottedIdentifier? | + set_language | lowercase | + IndexingStuff+ | + ( WordWrapper? BlockStart (NL | IndexingStatement)* BlockEnd) | +// TODO: Parse advanced indexing statements properly +private IndexingStuff ::= WordWrapper | AnyNumber | STRING_REG | BlockStart | BlockEnd | + ':' | '.' | '(' | ')' | ArithmeticOperator | ComparisonOperator + // Attribute -AttributeDefinition ::= attribute ((':' SimpleAttributeProperty) | ('{' (ComplexAttributeProperty | SimpleAttributeProperty)+ '}')) -SimpleAttributeProperty ::= fast-search | fast-access | paged | mutable | enable-bit-vectors | enable-only-bit-vector | WordWrapper // Does not support zero-or-one occurrences -ComplexAttributeProperty ::= AliasDefinition | SortingDefinition | DistanceMetricDef // Does not support zero-or-one occurrences -DistanceMetricDef ::= distance-metric ':' IdentifierWithDashVal -// Alias -AliasDefinition ::= alias (DottedIdentifier)? ':' DottedIdentifierWithDash -// Stemming -StemmingDefinition ::= stemming ':' IdentifierWithDashVal -// Rank -RankDefinition ::= rank ((DottedIdentifier? ':' RankingSetting) | ('{' RankingSetting '}')) +AttributeDefinition ::= attribute ((':' SimpleAttributeProperty NL+ ) | + BlockStart (ComplexAttributeProperty | SimpleAttributeProperty | NL)+ BlockEnd ) +SimpleAttributeProperty ::= fast-search | fast-rank | fast-access | paged | mutable | enable-bit-vectors | enable-only-bit-vector | WordWrapper +ComplexAttributeProperty ::= AliasDefinition | SortingDefinition | DistanceMetricDef +DistanceMetricDef ::= distance-metric ':' IdentifierWithDashVal NL+ +AliasDefinition ::= alias DottedIdentifier? ':' DottedIdentifierWithDash NL+ +StemmingDefinition ::= stemming ':' IdentifierWithDashVal NL+ +RankDefinition ::= rank ((DottedIdentifier? ':' RankingSetting NL+) | (BlockStart ( RankingSetting | NL )+ BlockEnd)) RankingSetting ::= filter | normal | literal | WordWrapper -// Indexing Rewrite -IndexingRewriteState ::= indexing-rewrite ':' none -// Query Command -QueryCommandDefinition ::= query-command ':' (DottedIdentifier | STRING_REG | WordWrapper) +IndexingRewriteState ::= indexing-rewrite ':' none NL+ +QueryCommandDefinition ::= query-command ':' (IdentifierWithDashVal | STRING_REG | WordWrapper) NL+ // Summary -SummaryDefinition ::= summary IdentifierWithDashVal? (type FieldTypeName)? ((':' SummaryBodyOptions) | ( '{' SummaryBody '}')) +SummaryDefinition ::= summary IdentifierWithDashVal? (type FieldTypeName)? ((':' SummaryBodyOptions NL+ ) | ( BlockStart SummaryBody BlockEnd)) { mixin="ai.vespa.intellij.schema.psi.impl.SdSummaryDefinitionMixin" } -SummaryBody ::= SummaryBodyOptions* // Does not support zero-or-one occurrences +SummaryBody ::= ( SummaryBodyOptions | NL )* // Does not support zero-or-one occurrences SummaryBodyOptions ::= full | static | dynamic | ((source ':' DottedIdentifier) (COMMA DottedIdentifier)*) | (to ':' IdentifierVal (COMMA IdentifierVal)*) | matched-elements-only | BoldingDefinition -// Summary To -SummaryToDefinition ::= summary-to ':' WordWrapper (COMMA WordWrapper)* -// Bolding -BoldingDefinition ::= bolding ':' (on | off | true | false) +SummaryToDefinition ::= summary-to ':' WordWrapper (COMMA WordWrapper)* NL+ +BoldingDefinition ::= bolding ':' (on | off | true | false) NL+ + // Index -IndexDefinition ::= index IdentifierVal? ((':' IndexProperty) | ('{' IndexProperty '}')) -IndexProperty ::= IndexPropertyOptions* -private IndexPropertyOptions ::= (alias ':' DottedIdentifierWithDash) | StemmingDefinition | (arity ':' INTEGER_REG) | - (lower-bound ':' INTEGER_REG ('L')?) | (upper-bound ':' INTEGER_REG ('L')?) | - (dense-posting-list-threshold ':' FLOAT_REG) | enable-bm25 | prefix | HnswDefinition -HnswDefinition ::= hnsw '{' HnswBody '}' -HnswBody ::= HnswBodyOptions* +IndexDefinition ::= index IdentifierVal? ((':' IndexProperty NL+ ) | (BlockStart ( IndexProperty | NL)* BlockEnd)) +private IndexProperty ::= (alias ':' DottedIdentifierWithDash) | StemmingDefinition | (arity ':' INTEGER_REG) | + (lower-bound ':' INTEGER_REG ('L')?) | (upper-bound ':' INTEGER_REG ('L')?) | + (dense-posting-list-threshold ':' FLOAT_REG) | enable-bm25 | prefix | HnswDefinition +HnswDefinition ::= hnsw BlockStart HnswBody BlockEnd +HnswBody ::= ( HnswBodyOptions | NL )* private HnswBodyOptions ::= (max-links-per-node ':' INTEGER_REG) | (neighbors-to-explore-at-insert ':' INTEGER_REG) | (multi-threaded-indexing ':' (on | off | true | false)) // Sorting -SortingDefinition ::= sorting ((':' SortingProperty) | ('{' SortingProperty* '}')) +SortingDefinition ::= sorting ((':' SortingProperty (NL)+) | (BlockStart ( SortingProperty | NL)* BlockEnd)) SortingProperty ::= ascending | descending | (function ':' SortingFunction) | (strength ':' SortingStrength) | (locale ':' IdentifierWithDashVal) SortingFunction ::= uca | raw | lowercase SortingStrength ::= primary | secondary | tertiary | quaternary | identical // Rank Type -RankTypeDefinition ::= rank-type IdentifierVal? ':' IdentifierVal +RankTypeDefinition ::= rank-type IdentifierVal? ':' IdentifierVal NL+ // Weighted Set -WeightedSetDefinition ::= weightedset ((':' WeightedSetProperty) | ('{' WeightedSetProperty* '}')) // Does not support - // zero-or-one occurrences +WeightedSetDefinition ::= weightedset ((':' WeightedSetProperty NL+ ) | (BlockStart ( WeightedSetProperty | NL )* BlockEnd)) WeightedSetProperty ::= create-if-nonexistent | remove-if-zero // Dictionary -DictionaryDefinition ::= dictionary ((':' DictionarySetting) | ('{' DictionarySetting* '}')) +DictionaryDefinition ::= dictionary ((':' DictionarySetting NL+) | (BlockStart ( DictionarySetting | NL )* BlockEnd)) DictionarySetting ::= hash | btree | cased | uncased -//***** End of Field's body elements ******// - -//--------------------- -//---- Util rules ----- -//--------------------- -private WordWrapper ::= KeywordOrIdentifier | KeywordNotIdentifier | ID_REG | ID_WITH_DASH_REG | WORD_REG +private WordWrapper ::= KeywordOrIdentifier | KeywordNotIdentifier | ID_REG | IdentifierWithDashVal | WORD_REG IdentifierVal ::= KeywordOrIdentifier | ID_REG { mixin="ai.vespa.intellij.schema.psi.impl.SdIdentifierMixin" implements=["ai.vespa.intellij.schema.psi.SdIdentifier"] } DottedIdentifier ::= IdentifierVal ('.' IdentifierVal)* -IdentifierWithDashVal ::= ID_WITH_DASH_REG | IdentifierVal { mixin="ai.vespa.intellij.schema.psi.impl.SdIdentifierMixin" - implements=["ai.vespa.intellij.schema.psi.SdIdentifier"] - } -DottedIdentifierWithDash ::= IdentifierWithDashVal ('.' IdentifierWithDashVal)* +IdentifierWithDashVal ::= IdentifierVal ('-' ( IdentifierVal | INTEGER_REG ) )* + { mixin="ai.vespa.intellij.schema.psi.impl.SdIdentifierMixin" + implements=["ai.vespa.intellij.schema.psi.SdIdentifier"] + } +DottedIdentifierWithDash ::= IdentifierWithDashVal ('.' IdentifierWithDashVal )* + +BlockStart ::= NL* '{' NL* +BlockEnd ::= NL* '}' NL* +ClauseStart ::= NL* '(' NL* +ClauseEnd ::= NL* ')' NL* +CommaSeparator ::= NL* COMMA NL* +AnyNumber ::= ('-')? ( FLOAT_REG | INTEGER_REG) // Those lists of keywords (KeywordOrIdentifier and KeywordNotIdentifier) have to be synchronized with sd.flex file. // If you add a keyword here, you should add it to the sd.flex file as well. @@ -393,10 +415,10 @@ KeywordOrIdentifier ::= schema | search | document | struct | field | type | ind // Note- in this form, those keywords can't be use as identifier-with-dash! KeywordNotIdentifier ::= struct-field | document-summary | omit-summary-features | from-disk | rank-profile | rank-type | num-threads-per-search | termwise-limit | ignore-default-rank-features | min-hits-per-thread | - num-search-partition | match-phase | max-hits | second-phase | rerank-count | min-groups | + num-search-partitions | match-phase | max-hits | second-phase | rerank-count | min-groups | first-phase | keep-rank-count | rank-score-drop-limit | rank-properties | summary-features | match-features | rank-features | - exact-terminator | max-length | gram-size | fast-search | fast-access | distance-metric | + exact-terminator | max-length | gram-size | fast-search | fast-rank | fast-access | distance-metric | indexing-rewrite | query-command | matched-elements-only | lower-bound | upper-bound | dense-posting-list-threshold | enable-bm25 | max-links-per-node | neighbors-to-explore-at-insert | multi-threaded-indexing | create-if-nonexistent | remove-if-zero | raw-as-base64-in-summary | diff --git a/integration/intellij/src/main/java/ai/vespa/intellij/schema/SdSyntaxHighlighter.java b/integration/intellij/src/main/java/ai/vespa/intellij/schema/SdSyntaxHighlighter.java index de0d58c63a0..35e26451672 100644 --- a/integration/intellij/src/main/java/ai/vespa/intellij/schema/SdSyntaxHighlighter.java +++ b/integration/intellij/src/main/java/ai/vespa/intellij/schema/SdSyntaxHighlighter.java @@ -153,7 +153,7 @@ public class SdSyntaxHighlighter extends SyntaxHighlighterBase { constants.add(SdTypes.NUM_THREADS_PER_SEARCH); constants.add(SdTypes.TERMWISE_LIMIT); constants.add(SdTypes.MIN_HITS_PER_THREAD); - constants.add(SdTypes.NUM_SEARCH_PARTITION); + constants.add(SdTypes.NUM_SEARCH_PARTITIONS); constants.add(SdTypes.KEEP_RANK_COUNT); constants.add(SdTypes.RANK_SCORE_DROP_LIMIT); constants.add(SdTypes.RERANK_COUNT); @@ -174,6 +174,7 @@ public class SdSyntaxHighlighter extends SyntaxHighlighterBase { constants.add(SdTypes.SET_LANGUAGE); constants.add(SdTypes.LOWERCASE); constants.add(SdTypes.FAST_SEARCH); + constants.add(SdTypes.FAST_RANK); constants.add(SdTypes.FAST_ACCESS); constants.add(SdTypes.PAGED); constants.add(SdTypes.MUTABLE); diff --git a/integration/intellij/src/main/java/ai/vespa/intellij/schema/SdUtil.java b/integration/intellij/src/main/java/ai/vespa/intellij/schema/SdUtil.java index 1b45c1bf4fd..e8be94c848a 100644 --- a/integration/intellij/src/main/java/ai/vespa/intellij/schema/SdUtil.java +++ b/integration/intellij/src/main/java/ai/vespa/intellij/schema/SdUtil.java @@ -2,6 +2,7 @@ package ai.vespa.intellij.schema; import ai.vespa.intellij.schema.model.RankProfile; +import ai.vespa.intellij.schema.psi.SdArgumentDeclaration; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiElement; @@ -12,7 +13,7 @@ import com.intellij.psi.search.FileTypeIndex; import com.intellij.psi.search.GlobalSearchScope; import com.intellij.psi.util.PsiTreeUtil; import ai.vespa.intellij.schema.psi.SdAnnotationFieldDefinition; -import ai.vespa.intellij.schema.psi.SdArgumentDefinition; +import ai.vespa.intellij.schema.psi.SdArgumentDeclaration; import ai.vespa.intellij.schema.psi.SdDeclaration; import ai.vespa.intellij.schema.psi.SdDocumentAnnotationDefinition; import ai.vespa.intellij.schema.psi.SdDocumentDefinition; @@ -48,7 +49,7 @@ public class SdUtil { String rankProfileName; if (rankProfile != null) { rankProfileName = rankProfile.getName(); - List<SdArgumentDefinition> args = function.getArgumentDefinitionList(); + List<SdArgumentDeclaration> args = function.getArgumentDeclarations().getArgumentDeclarationList(); StringBuilder text = new StringBuilder(rankProfileName + "." + function.getName() + "("); for (int i = 0; i < args.size(); i++) { text.append(args.get(i).getName()); @@ -114,7 +115,7 @@ public class SdUtil { // Check if element is inside a function body SdFunctionDefinition macroParent = PsiTreeUtil.getParentOfType(element, SdFunctionDefinition.class); if (macroParent != null) { - for (SdArgumentDefinition arg : PsiTreeUtil.findChildrenOfType(macroParent, SdArgumentDefinition.class)) { + for (SdArgumentDeclaration arg : PsiTreeUtil.findChildrenOfType(macroParent, SdArgumentDeclaration.class)) { if (name.equals(arg.getName())) { // if the element was declared as an argument of the function result.add(arg); return result; @@ -133,7 +134,7 @@ public class SdUtil { } for (PsiElement declaration : PsiTreeUtil.collectElements(file, psiElement -> - psiElement instanceof SdDeclaration && !(psiElement instanceof SdArgumentDefinition))) { + psiElement instanceof SdDeclaration && !(psiElement instanceof SdArgumentDeclaration))) { if (name.equals(((SdDeclaration) declaration).getName())) { result.add((SdDeclaration) declaration); break; diff --git a/integration/intellij/src/main/java/ai/vespa/intellij/schema/findUsages/SdFindUsagesProvider.java b/integration/intellij/src/main/java/ai/vespa/intellij/schema/findUsages/SdFindUsagesProvider.java index f131fc58376..f2f60dfb7f3 100644 --- a/integration/intellij/src/main/java/ai/vespa/intellij/schema/findUsages/SdFindUsagesProvider.java +++ b/integration/intellij/src/main/java/ai/vespa/intellij/schema/findUsages/SdFindUsagesProvider.java @@ -24,7 +24,8 @@ public class SdFindUsagesProvider implements FindUsagesProvider { public WordsScanner getWordsScanner() { // TODO: Not used at the moment (?) as we search by brute force return new DefaultWordsScanner(new SdLexerAdapter(), - TokenSet.create(SdTypes.ID_REG, SdTypes.ID_WITH_DASH_REG, SdTypes.IDENTIFIER_VAL, + TokenSet.create(SdTypes.ID_REG, + SdTypes.IDENTIFIER_VAL, SdTypes.IDENTIFIER_WITH_DASH_VAL), TokenSet.create(SdTypes.COMMENT), TokenSet.create(SdTypes.STRING_REG, SdTypes.INTEGER_REG, SdTypes.FLOAT_REG)); diff --git a/integration/intellij/src/main/java/ai/vespa/intellij/schema/psi/SdDeclarationType.java b/integration/intellij/src/main/java/ai/vespa/intellij/schema/psi/SdDeclarationType.java index bb140c4ce75..d534a9e4692 100644 --- a/integration/intellij/src/main/java/ai/vespa/intellij/schema/psi/SdDeclarationType.java +++ b/integration/intellij/src/main/java/ai/vespa/intellij/schema/psi/SdDeclarationType.java @@ -20,10 +20,9 @@ public enum SdDeclarationType { DOCUMENT_SUMMARY("Document-Summary"), RANK_PROFILE("Rank Profile"), FUNCTION("Function"), - FIUNCTION_ARGUMENT("Function argument"), - QUERY("Query (first use in file)"), - ITEM_RAW_SCORE("ItemRawScore (first use in file)"); - + FUNCTION_ARGUMENT("Function argument"), + FEATURE("Feature (first use in file)"); + private final String typeName; SdDeclarationType(String name) { this.typeName = name; diff --git a/integration/intellij/src/main/java/ai/vespa/intellij/schema/psi/impl/SdNamedElementImpl.java b/integration/intellij/src/main/java/ai/vespa/intellij/schema/psi/impl/SdNamedElementImpl.java index 8a2588ecf35..79c5835b5a3 100644 --- a/integration/intellij/src/main/java/ai/vespa/intellij/schema/psi/impl/SdNamedElementImpl.java +++ b/integration/intellij/src/main/java/ai/vespa/intellij/schema/psi/impl/SdNamedElementImpl.java @@ -1,6 +1,7 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package ai.vespa.intellij.schema.psi.impl; +import ai.vespa.intellij.schema.psi.SdArgumentDeclaration; import com.intellij.extapi.psi.ASTWrapperPsiElement; import com.intellij.icons.AllIcons; import com.intellij.lang.ASTNode; @@ -10,7 +11,7 @@ import com.intellij.psi.util.PsiTreeUtil; import ai.vespa.intellij.schema.SdIcons; import ai.vespa.intellij.schema.SdUtil; import ai.vespa.intellij.schema.psi.SdAnnotationFieldDefinition; -import ai.vespa.intellij.schema.psi.SdArgumentDefinition; +import ai.vespa.intellij.schema.psi.SdArgumentDeclaration; import ai.vespa.intellij.schema.psi.SdDeclarationType; import ai.vespa.intellij.schema.psi.SdDocumentAnnotationDefinition; import ai.vespa.intellij.schema.psi.SdDocumentDefinition; @@ -22,9 +23,8 @@ import ai.vespa.intellij.schema.psi.SdElementFactory; import ai.vespa.intellij.schema.psi.SdFunctionDefinition; import ai.vespa.intellij.schema.psi.SdIdentifier; import ai.vespa.intellij.schema.psi.SdImportFieldDefinition; -import ai.vespa.intellij.schema.psi.SdItemRawScoreDefinition; import ai.vespa.intellij.schema.psi.SdNamedElement; -import ai.vespa.intellij.schema.psi.SdQueryDefinition; +import ai.vespa.intellij.schema.psi.SdRankFeature; import ai.vespa.intellij.schema.psi.SdRankProfileDefinition; import ai.vespa.intellij.schema.psi.SdSchemaAnnotationDefinition; import ai.vespa.intellij.schema.psi.SdSchemaFieldDefinition; @@ -36,6 +36,7 @@ import javax.swing.Icon; /** * This abstract class is used to wrap a Psi Element with SdNamedElement interface, which enables the element to be a * "name owner" (like an identifier). It allows the element to take a part in references, find usages and more. + * * @author Shahar Ariel */ public abstract class SdNamedElementImpl extends ASTWrapperPsiElement implements SdNamedElement { @@ -50,7 +51,7 @@ public abstract class SdNamedElementImpl extends ASTWrapperPsiElement implements ASTNode asNode = this.getNode().findChildByType(SdTypes.AS); node = this.getNode().findChildByType(SdTypes.IDENTIFIER_VAL, asNode); } else if (this instanceof SdRankProfileDefinition || this instanceof SdDocumentSummaryDefinition - || this instanceof SdQueryDefinition) { + || this instanceof SdRankFeature) { node = this.getNode().findChildByType(SdTypes.IDENTIFIER_WITH_DASH_VAL); } else { node = this.getNode().findChildByType(SdTypes.IDENTIFIER_VAL); @@ -77,8 +78,8 @@ public abstract class SdNamedElementImpl extends ASTWrapperPsiElement implements return SdDeclarationType.RANK_PROFILE; } else if (this instanceof SdFunctionDefinition) { return SdDeclarationType.FUNCTION; - } else if (this instanceof SdArgumentDefinition) { - return SdDeclarationType.FIUNCTION_ARGUMENT; + } else if (this instanceof SdArgumentDeclaration) { + return SdDeclarationType.FUNCTION_ARGUMENT; } else if (this instanceof SdDocumentDefinition) { return SdDeclarationType.DOCUMENT; } else if (this instanceof SdDocumentStructDefinition) { @@ -94,10 +95,8 @@ public abstract class SdNamedElementImpl extends ASTWrapperPsiElement implements return SdDeclarationType.STRUCT_FIELD; } else if (this instanceof SdAnnotationFieldDefinition) { return SdDeclarationType.ANNOTATION_FIELD; - } else if (this instanceof SdQueryDefinition) { - return SdDeclarationType.QUERY; - } else if (this instanceof SdItemRawScoreDefinition) { - return SdDeclarationType.ITEM_RAW_SCORE; + } else if (this instanceof SdRankFeature) { + return SdDeclarationType.FEATURE; } else { return null; } @@ -147,7 +146,7 @@ public abstract class SdNamedElementImpl extends ASTWrapperPsiElement implements } SdRankProfileDefinition rankProfileParent = PsiTreeUtil.getParentOfType(element, SdRankProfileDefinition.class); if (rankProfileParent != null) { - if (element instanceof SdQueryDefinition || element instanceof SdItemRawScoreDefinition) { + if (element instanceof SdRankFeature) { return element.getName() + " in " + rankProfileParent.getName(); } return rankProfileParent.getName() + "." + element.getName(); @@ -163,8 +162,7 @@ public abstract class SdNamedElementImpl extends ASTWrapperPsiElement implements @Override public Icon getIcon(boolean unused) { if (element instanceof SdSchemaFieldDefinition || element instanceof SdDocumentFieldDefinition || - element instanceof SdAnnotationFieldDefinition || element instanceof SdQueryDefinition || - element instanceof SdItemRawScoreDefinition) { + element instanceof SdAnnotationFieldDefinition || element instanceof SdRankFeature) { return AllIcons.Nodes.Field; } else if (element instanceof SdStructFieldDefinition || element instanceof SdDocumentStructFieldDefinition) { diff --git a/integration/intellij/src/main/jflex/ai/vespa/intellij/schema/lexer/sd.flex b/integration/intellij/src/main/jflex/ai/vespa/intellij/schema/lexer/sd.flex index 3947a9fb2eb..071033509d9 100644 --- a/integration/intellij/src/main/jflex/ai/vespa/intellij/schema/lexer/sd.flex +++ b/integration/intellij/src/main/jflex/ai/vespa/intellij/schema/lexer/sd.flex @@ -29,18 +29,19 @@ import static com.intellij.psi.TokenType.WHITE_SPACE; // Pre-defined whitespace //**--------- REGEXES ---------**// // If some character sequence is matched to this regex, it will be treated as an IDENTIFIER. ID=[a-zA-Z_][a-zA-Z0-9_]* -ID_WITH_DASH = [a-zA-Z_][a-zA-Z0-9_-]* // If some character sequence is matched to this regex, it will be treated as a WHITE_SPACE. -WHITE_SPACE=[ \t\n\x0B\f\r]+ +WHITE_SPACE=[ \t\x0B\f\r]+ +NL=[\n]+ COMMENT=#.* -SYMBOL= [!$|:{}().\[\]] +SYMBOL= [;!$|:{}().\[\]] COMMA= [,] //BLOCK_START= \{ //BLOCK_END= \} INTEGER = [0-9]+ -FLOAT = {INTEGER}[.][0-9]+[e]? +FLOAT = {INTEGER}[.][0-9]+([eE][-]?[0-9]+)? STRING = \"([^\"\\]*(\\.[^\"\\]*)*)\" +STRING_SINGLE_QUOTE = '([^'\\]*(\\.[^'\\]*)*)' WORD = \w+ @@ -93,6 +94,7 @@ WORD = \w+ "gram-size" { return GRAM_SIZE; } "fast-search" { return FAST_SEARCH; } + "fast-rank" { return FAST_RANK; } "fast-access" { return FAST_ACCESS; } "alias" { return ALIAS; } "sorting" { return SORTING; } @@ -158,7 +160,7 @@ WORD = \w+ "termwise-limit" { return TERMWISE_LIMIT; } "ignore-default-rank-features" { return IGNORE_DEFAULT_RANK_FEATURES; } "min-hits-per-thread" { return MIN_HITS_PER_THREAD; } - "num-search-partition" { return NUM_SEARCH_PARTITION; } + "num-search-partitions" { return NUM_SEARCH_PARTITIONS; } "constants" { return CONSTANTS; } "second-phase" { return SECOND_PHASE; } "rerank-count" { return RERANK_COUNT; } @@ -236,10 +238,10 @@ WORD = \w+ // Here we check for character sequences which matches regular expressions defined above. {ID} { return ID_REG; } - {ID_WITH_DASH} { return ID_WITH_DASH_REG; } - + {WHITE_SPACE} { return WHITE_SPACE; } - + {NL} { return NL; } + {COMMENT} { return COMMENT; } {SYMBOL} { return SYMBOL; } {COMMA} { return COMMA; } @@ -249,6 +251,7 @@ WORD = \w+ {FLOAT} { return FLOAT_REG; } {WORD} { return WORD_REG; } {STRING} { return STRING_REG; } + {STRING_SINGLE_QUOTE} { return STRING_REG_SINGLE_QUOTE; } } diff --git a/integration/intellij/src/test/applications/rankprofilemodularity/test.sd b/integration/intellij/src/test/applications/rankprofilemodularity/test.sd index 013881248c1..f9ccf29a94e 100644 --- a/integration/intellij/src/test/applications/rankprofilemodularity/test.sd +++ b/integration/intellij/src/test/applications/rankprofilemodularity/test.sd @@ -1,3 +1,4 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. schema test { document test { diff --git a/integration/intellij/src/test/applications/rankprofilemodularity/test/outside_schema1.profile b/integration/intellij/src/test/applications/rankprofilemodularity/test/outside_schema1.profile index af27290c5f7..2e5f56fd18b 100644 --- a/integration/intellij/src/test/applications/rankprofilemodularity/test/outside_schema1.profile +++ b/integration/intellij/src/test/applications/rankprofilemodularity/test/outside_schema1.profile @@ -1,3 +1,4 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. rank-profile outside_schema1 inherits in_schema1 { function fo1() { diff --git a/integration/intellij/src/test/applications/rankprofilemodularity/test/outside_schema2.profile b/integration/intellij/src/test/applications/rankprofilemodularity/test/outside_schema2.profile index 8cf3fcfbb78..7dd41859d03 100644 --- a/integration/intellij/src/test/applications/rankprofilemodularity/test/outside_schema2.profile +++ b/integration/intellij/src/test/applications/rankprofilemodularity/test/outside_schema2.profile @@ -1,3 +1,4 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. rank-profile outside_schema2 { function fo2() { diff --git a/integration/intellij/src/test/applications/schemainheritance/child.sd b/integration/intellij/src/test/applications/schemainheritance/child.sd index ff09bad4442..d4ab271bdef 100644 --- a/integration/intellij/src/test/applications/schemainheritance/child.sd +++ b/integration/intellij/src/test/applications/schemainheritance/child.sd @@ -1,3 +1,4 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. schema child inherits parent { document child inherits parent { diff --git a/integration/intellij/src/test/applications/schemainheritance/importedschema.sd b/integration/intellij/src/test/applications/schemainheritance/importedschema.sd index 1b5acff8a26..29802ab99cc 100644 --- a/integration/intellij/src/test/applications/schemainheritance/importedschema.sd +++ b/integration/intellij/src/test/applications/schemainheritance/importedschema.sd @@ -1,3 +1,4 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. schema importedschema { document importedschema { diff --git a/integration/intellij/src/test/applications/schemainheritance/parent.sd b/integration/intellij/src/test/applications/schemainheritance/parent.sd index ba666313af1..c2dea4071a3 100644 --- a/integration/intellij/src/test/applications/schemainheritance/parent.sd +++ b/integration/intellij/src/test/applications/schemainheritance/parent.sd @@ -1,3 +1,4 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. schema parent { document parent { diff --git a/integration/intellij/src/test/applications/simple/simple.sd b/integration/intellij/src/test/applications/simple/simple.sd index 21e683b3ee4..ff56944440b 100644 --- a/integration/intellij/src/test/applications/simple/simple.sd +++ b/integration/intellij/src/test/applications/simple/simple.sd @@ -1,3 +1,4 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. schema simple { document simple { diff --git a/integration/intellij/src/test/applications/syntax/syntax.sd b/integration/intellij/src/test/applications/syntax/syntax.sd new file mode 100644 index 00000000000..3d9ab6aa0d2 --- /dev/null +++ b/integration/intellij/src/test/applications/syntax/syntax.sd @@ -0,0 +1,29 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +# A collection of syntax we can visually check is parsed correctly +schema syntax { + document syntax { + field mystring type string { + } + } + + field myarray1 type array<string> { + indexing: input mystring | split ";" | for_each { trim } | attribute + } + + field myarray2 type array<string> { + indexing: input mystring | split ";" | for_each { trim } | attribute + index: enable-bm25 + } + + field myarray2 type array<string> { + indexing { + input mystring | split ";" | for_each { + trim + } + | attribute; + } + index: enable-bm25 + } + +} diff --git a/logserver/bin/logserver-start.sh b/logserver/bin/logserver-start.sh index 384abdc31e9..02efda95798 100755 --- a/logserver/bin/logserver-start.sh +++ b/logserver/bin/logserver-start.sh @@ -78,7 +78,7 @@ ROOT=${VESPA_HOME%/} export ROOT cd $ROOT || { echo "Cannot cd to $ROOT" 1>&2; exit 1; } -addopts="-server -Xms32m -Xmx256m -XX:CompressedClassSpaceSize=32m -XX:MaxDirectMemorySize=32m -XX:ThreadStackSize=448 -XX:MaxJavaStackTraceDepth=1000 -XX:ActiveProcessorCount=2 -XX:-OmitStackTraceInFastThrow -Djava.io.tmpdir=${VESPA_HOME}/tmp" +addopts="-server -Xms32m -Xmx256m -XX:+PreserveFramePointer -XX:+UseTransparentHugePages -XX:CompressedClassSpaceSize=32m -XX:MaxDirectMemorySize=32m -XX:ThreadStackSize=448 -XX:MaxJavaStackTraceDepth=1000 -XX:ActiveProcessorCount=2 -XX:-OmitStackTraceInFastThrow -Djava.io.tmpdir=${VESPA_HOME}/tmp" oomopt="-XX:+ExitOnOutOfMemoryError" diff --git a/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp b/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp index 9ac5b02c61e..6bbedcdb18e 100644 --- a/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp @@ -24,6 +24,7 @@ #include <vespa/vespalib/util/exceptions.h> #include <vespa/vespalib/util/lambdatask.h> #include <cassert> +#include <thread> #include <vespa/log/log.h> LOG_SETUP(".proton.server.feedhandler"); diff --git a/slobrok/src/vespa/slobrok/server/service_mapping.cpp b/slobrok/src/vespa/slobrok/server/service_mapping.cpp index 45a278801b5..fa9db487995 100644 --- a/slobrok/src/vespa/slobrok/server/service_mapping.cpp +++ b/slobrok/src/vespa/slobrok/server/service_mapping.cpp @@ -4,6 +4,10 @@ namespace slobrok { +ServiceMapping::ServiceMapping(const ServiceMapping& rhs) noexcept = default; + ServiceMapping::~ServiceMapping() = default; +ServiceMapping& ServiceMapping::operator=(const ServiceMapping& rhs) = default; + } // namespace slobrok diff --git a/slobrok/src/vespa/slobrok/server/service_mapping.h b/slobrok/src/vespa/slobrok/server/service_mapping.h index b581b9431ce..89a0a5db4b1 100644 --- a/slobrok/src/vespa/slobrok/server/service_mapping.h +++ b/slobrok/src/vespa/slobrok/server/service_mapping.h @@ -11,7 +11,9 @@ struct ServiceMapping { vespalib::string name; vespalib::string spec; ServiceMapping(const vespalib::string & name_, const vespalib::string & spec_) noexcept : name(name_), spec(spec_) { } + ServiceMapping(const ServiceMapping& rhs) noexcept; ~ServiceMapping(); + ServiceMapping& operator=(const ServiceMapping& rhs); bool operator== (const ServiceMapping &other) const { return name == other.name && spec == other.spec; diff --git a/standalone-container/src/main/sh/standalone-container.sh b/standalone-container/src/main/sh/standalone-container.sh index 5ad6ce0a583..bee4c06c38d 100755 --- a/standalone-container/src/main/sh/standalone-container.sh +++ b/standalone-container/src/main/sh/standalone-container.sh @@ -170,6 +170,7 @@ StartCommand() { java \ -Xms128m -Xmx2048m \ -XX:+PreserveFramePointer \ + -XX:+UseTransparentHugePages \ -XX:+HeapDumpOnOutOfMemoryError \ -XX:HeapDumpPath="$VESPA_HOME/var/crash" \ -XX:+ExitOnOutOfMemoryError \ diff --git a/vespa_jersey2/pom.xml b/vespa_jersey2/pom.xml index 23b3b1e6cd6..41a079e4ae3 100644 --- a/vespa_jersey2/pom.xml +++ b/vespa_jersey2/pom.xml @@ -52,7 +52,7 @@ </dependency> <dependency> - <!-- TODO: try to remove! Previously pulled in by jersey-media-json-jackson. --> + <!-- TODO Vespa 8: remove! Previously pulled in by jersey-media-json-jackson. --> <groupId>com.fasterxml.jackson.jaxrs</groupId> <artifactId>jackson-jaxrs-json-provider</artifactId> <exclusions> @@ -68,6 +68,24 @@ </exclusion> </exclusions> </dependency> + <dependency> + <!-- TODO Vespa 8: remove! Previously pulled in by jersey-media-json-jackson. --> + <groupId>com.fasterxml.jackson.module</groupId> + <artifactId>jackson-module-jaxb-annotations</artifactId> + <exclusions> + <exclusion> + <!-- Conflicts with javax.activation:javax.activation-api:1.2.0, which is "exported" via jdisc_core. --> + <groupId>jakarta.activation</groupId> + <artifactId>jakarta.activation-api</artifactId> + </exclusion> + <exclusion> + <!-- Conflicts with javax.xml.bind:jaxb-api:2.3, which is "exported" via jdisc_core.--> + <groupId>jakarta.xml.bind</groupId> + <artifactId>jakarta.xml.bind-api</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> <build> diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java index 73bea9f7a00..d3f8bb40b04 100644 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java @@ -426,7 +426,7 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler { rawParameters = rawParameters.withFieldSet(path.documentType().orElseThrow() + ":[document]"); DocumentOperationParameters parameters = rawParameters.withResponseHandler(response -> { outstanding.decrementAndGet(); - handle(path, handler, response, (document, jsonResponse) -> { + handle(path, request, handler, response, (document, jsonResponse) -> { if (document != null) { jsonResponse.writeSingleDocument(document); jsonResponse.commit(Response.Status.OK); @@ -591,6 +591,7 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler { private final OutputStream out = new ContentChannelOutputStream(buffer); private final JsonGenerator json; private final ResponseHandler handler; + private final HttpRequest request; private final Queue<CompletionHandler> acks = new ConcurrentLinkedQueue<>(); private final Queue<ByteArrayOutputStream> docs = new ConcurrentLinkedQueue<>(); private final AtomicLong documentsWritten = new AtomicLong(); @@ -601,14 +602,24 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler { private ContentChannel channel; private JsonResponse(ResponseHandler handler) throws IOException { + this(handler, null); + } + + private JsonResponse(ResponseHandler handler, HttpRequest request) throws IOException { this.handler = handler; + this.request = request; json = jsonFactory.createGenerator(out); json.writeStartObject(); } /** Creates a new JsonResponse with path and id fields written. */ static JsonResponse create(DocumentPath path, ResponseHandler handler) throws IOException { - JsonResponse response = new JsonResponse(handler); + return create(path, handler, null); + } + + /** Creates a new JsonResponse with path and id fields written. */ + static JsonResponse create(DocumentPath path, ResponseHandler handler, HttpRequest request) throws IOException { + JsonResponse response = new JsonResponse(handler, request); response.writePathId(path.rawPath()); response.writeDocId(path.id()); return response; @@ -703,7 +714,11 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler { } synchronized void writeSingleDocument(Document document) throws IOException { - new JsonWriter(json).writeFields(document); + boolean tensorShortForm = false; + if (request != null && request.parameters().containsKey("format.tensors")) { + tensorShortForm = request.parameters().get("format.tensors").contains("short"); + } + new JsonWriter(json, tensorShortForm).writeFields(document); } synchronized void writeDocumentsArrayStart() throws IOException { @@ -1001,8 +1016,8 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler { void onSuccess(Document document, JsonResponse response) throws IOException; } - private static void handle(DocumentPath path, ResponseHandler handler, com.yahoo.documentapi.Response response, SuccessCallback callback) { - try (JsonResponse jsonResponse = JsonResponse.create(path, handler)) { + private static void handle(DocumentPath path, HttpRequest request, ResponseHandler handler, com.yahoo.documentapi.Response response, SuccessCallback callback) { + try (JsonResponse jsonResponse = JsonResponse.create(path, handler, request)) { jsonResponse.writeTrace(response.getTrace()); if (response.isSuccess()) callback.onSuccess((response instanceof DocumentResponse) ? ((DocumentResponse) response).getDocument() : null, jsonResponse); @@ -1037,7 +1052,7 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler { } private static void handleFeedOperation(DocumentPath path, ResponseHandler handler, com.yahoo.documentapi.Response response) { - handle(path, handler, response, (document, jsonResponse) -> jsonResponse.commit(Response.Status.OK)); + handle(path, null, handler, response, (document, jsonResponse) -> jsonResponse.commit(Response.Status.OK)); } private void updatePutMetrics(Outcome outcome) { |