diff options
Diffstat (limited to 'configserver/src/test/apps/zkapp/searchdefinitions')
7 files changed, 174 insertions, 0 deletions
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 + } + } + +} |