diff options
Diffstat (limited to 'configserver/src/test/apps/zkapp')
14 files changed, 256 insertions, 0 deletions
diff --git a/configserver/src/test/apps/zkapp/components/defs-only.jar b/configserver/src/test/apps/zkapp/components/defs-only.jar Binary files differnew file mode 100644 index 00000000000..681301a3d8b --- /dev/null +++ b/configserver/src/test/apps/zkapp/components/defs-only.jar diff --git a/configserver/src/test/apps/zkapp/components/file.txt b/configserver/src/test/apps/zkapp/components/file.txt new file mode 100644 index 00000000000..e167ca380f5 --- /dev/null +++ b/configserver/src/test/apps/zkapp/components/file.txt @@ -0,0 +1 @@ +/home/vespa/test/file.txt
\ No newline at end of file diff --git a/configserver/src/test/apps/zkapp/deployment.xml b/configserver/src/test/apps/zkapp/deployment.xml new file mode 100644 index 00000000000..a9e9fdff07e --- /dev/null +++ b/configserver/src/test/apps/zkapp/deployment.xml @@ -0,0 +1,8 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!-- Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> +<deployment version='1.0'> + <test/> + <prod global-service-id='mydisc'>+ + <region active='true'>us-east</region> + </prod> +</deployment> diff --git a/configserver/src/test/apps/zkapp/files/foo.json b/configserver/src/test/apps/zkapp/files/foo.json new file mode 100644 index 00000000000..ed72b09660a --- /dev/null +++ b/configserver/src/test/apps/zkapp/files/foo.json @@ -0,0 +1 @@ +foo : foo diff --git a/configserver/src/test/apps/zkapp/files/sub/bar.json b/configserver/src/test/apps/zkapp/files/sub/bar.json new file mode 100644 index 00000000000..2f008f410ec --- /dev/null +++ b/configserver/src/test/apps/zkapp/files/sub/bar.json @@ -0,0 +1 @@ +bar : bar diff --git a/configserver/src/test/apps/zkapp/hosts.xml b/configserver/src/test/apps/zkapp/hosts.xml new file mode 100644 index 00000000000..fc545b34f6f --- /dev/null +++ b/configserver/src/test/apps/zkapp/hosts.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> +<hosts> + <host name="localhost"> + <alias>node1</alias> + </host> + <host name="schmocalhost"> + <alias>node2</alias> + </host> +</hosts> + diff --git a/configserver/src/test/apps/zkapp/searchdefinitions/bar.expression b/configserver/src/test/apps/zkapp/searchdefinitions/bar.expression new file mode 100644 index 00000000000..eed496e6aeb --- /dev/null +++ b/configserver/src/test/apps/zkapp/searchdefinitions/bar.expression @@ -0,0 +1 @@ +bar(f*2) diff --git a/configserver/src/test/apps/zkapp/searchdefinitions/foo.expression b/configserver/src/test/apps/zkapp/searchdefinitions/foo.expression new file mode 100644 index 00000000000..ce26aa75dcb --- /dev/null +++ b/configserver/src/test/apps/zkapp/searchdefinitions/foo.expression @@ -0,0 +1 @@ +foo()+1 diff --git a/configserver/src/test/apps/zkapp/searchdefinitions/laptop.sd b/configserver/src/test/apps/zkapp/searchdefinitions/laptop.sd new file mode 100644 index 00000000000..147e128df16 --- /dev/null +++ b/configserver/src/test/apps/zkapp/searchdefinitions/laptop.sd @@ -0,0 +1,41 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +search laptop { + + document laptop inherits product { + + field batterycapacity type int { + indexing: attribute + } + + field location_str type array<string> { + + } + } + + field batteryrank type int { + indexing: input batterycapacity | attribute + } + + field location type array<position> { + indexing: input location_str | for_each { to_pos } | attribute + } + + rank-profile default { + second-phase { + expression: fieldMatch(title)*fieldMatch(title).weight + rerank-count: 150 + } + summary-features: fieldMatch(title) + + rank-features: attribute(batterycapacity) match.weight.batterycapacity + + rank-properties { + fieldMatch(title).maxOccurrences : 40 + fieldMatch(title).proximityLimit : 5 + } + } + + rank-profile batteryranked { + } + +} diff --git a/configserver/src/test/apps/zkapp/searchdefinitions/music.sd b/configserver/src/test/apps/zkapp/searchdefinitions/music.sd new file mode 100644 index 00000000000..d0eec200b90 --- /dev/null +++ b/configserver/src/test/apps/zkapp/searchdefinitions/music.sd @@ -0,0 +1,44 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +# A basic search definition - called music, should be saved to music.sd +search music { + + # It contains one document type only - called music as well + document music { + + field title type string { + indexing: summary | index # How this field should be indexed + # index-to: title, default # Create two indexes + rank-type: about # Type of ranking settings to apply + header + } + + field artist type string { + indexing: summary | attribute | index + # index-to: artist, default + rank-type:about + header + } + + field year type int { + indexing: summary | attribute + header + } + + # Increase rank score of popular documents regardless of query + field popularity type int { + indexing: summary | attribute + body + } + + field url type uri { + indexing: summary | index + header + } + + field cover type raw { + body + } + + } + +} diff --git a/configserver/src/test/apps/zkapp/searchdefinitions/pc.sd b/configserver/src/test/apps/zkapp/searchdefinitions/pc.sd new file mode 100644 index 00000000000..89f9ffe530d --- /dev/null +++ b/configserver/src/test/apps/zkapp/searchdefinitions/pc.sd @@ -0,0 +1,47 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +search pc { + + document pc inherits product { + + field brand type string { + indexing: index | summary + } + + field color type string { + indexing: summary | index + index: prefix + alias: colour + rank: filter + } + + field cpuspeed type int { + indexing: summary + } + + field location_str type array<string> { + + } + } + + field location type array<position> { + indexing: input location_str | for_each { to_pos } | attribute + } + + rank-profile default { + first-phase { + expression: fieldMatch(brand).completeness + fieldMatch(color).completeness + } + second-phase { + expression: fieldMatch(brand).completeness*fieldMatch(brand).importancy + fieldMatch(color).completeness*fieldMatch(color).importancy + } + + summary-features: fieldMatch(title) fieldMatch(brand).proximity match.weight.title nativeFieldMatch(title) + + rank-features: attribute(cpuspeed) + + rank-properties { + fieldMatch(brand).maxOccurrences : 20 + } + } + +} diff --git a/configserver/src/test/apps/zkapp/searchdefinitions/product.sd b/configserver/src/test/apps/zkapp/searchdefinitions/product.sd new file mode 100644 index 00000000000..d8b1d725d1c --- /dev/null +++ b/configserver/src/test/apps/zkapp/searchdefinitions/product.sd @@ -0,0 +1,13 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +document product { + + field title type string { + indexing: index | summary + # index-to: title, default + } + + field price type int { + indexing: index | summary | attribute + } + +} diff --git a/configserver/src/test/apps/zkapp/searchdefinitions/sock.sd b/configserver/src/test/apps/zkapp/searchdefinitions/sock.sd new file mode 100644 index 00000000000..1620d790b65 --- /dev/null +++ b/configserver/src/test/apps/zkapp/searchdefinitions/sock.sd @@ -0,0 +1,27 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +search sock { + + document sock inherits product { + + field size type int { + indexing: index | summary | attribute + } + + field color type string { + indexing: summary + index: prefix + } + + field brand type string { + indexing: summary + } + + } + + rank-profile other { + second-phase { + expression: fieldMatch(color).fieldCompleteness + fieldMatch(brand).proximity + } + } + +} diff --git a/configserver/src/test/apps/zkapp/services.xml b/configserver/src/test/apps/zkapp/services.xml new file mode 100644 index 00000000000..aee18cc450a --- /dev/null +++ b/configserver/src/test/apps/zkapp/services.xml @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> +<services version="1.0"> + + <admin version="2.0"> + <adminserver hostalias="node1"/> + <slobroks> + <slobrok hostalias="node1"/> + <slobrok hostalias="node2"/> + </slobroks> + </admin> + + <clients version="2.0"> + <gateways protocols="http"> + <gateway hostalias="node1" /> + </gateways> + </clients> + + <search version="2.0"> + <qrservers> + <qrserver hostalias="node1" /> + </qrservers> + <cluster name="music" indexingmode="realtime"> + <searchdefinitions> + <searchdefinition name="music" /> + </searchdefinitions> + <clustercontrollers> + <clustercontroller hostalias="node1" /> + </clustercontrollers> + <topleveldispatchers> + <topleveldispatcher hostalias="node1" /> + </topleveldispatchers> + <row index="0"> + <searchnodes> + <searchnode hostalias="node1" index="0" /> + </searchnodes> + </row> + </cluster> + </search> + + <storage version="3.0"> + <cluster redundancy="1"> +<!-- +Do not reshuffle nodes or change index values - this will cause +massive document redistribution. + +If you want to discontinue use of a node, set it in the 'retired' state, +this will rebalance the documents out of the node. Once node is empty, +you can stop it and delete the reference to it in vespa-services and +vespa-hosts files. +--> + <group index="0" name="mycluster"> + <node hostalias="node1" index="0"/> + </group> + + <fleetcontroller hostalias="node1" /> + </cluster> + </storage> + +</services> |