diff options
author | Olli Virtanen <ovirtanen@gmail.com> | 2019-03-22 09:13:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-22 09:13:19 +0100 |
commit | 7989191b378263162e31f5226710a0cc9e9c5799 (patch) | |
tree | 51c57ea055ed97313126df96e706bc38abe365ef /searchlib | |
parent | 87d95bebf84693da9ddc4859d616206110956e34 (diff) | |
parent | 828c6833bf7794060ab2d209b686db7116531b32 (diff) |
Merge pull request #8849 from vespa-engine/ollivir/searchprotocol-protobuf
Search protocol over jrt + protobuf (take 2)
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/pom.xml | 9 | ||||
-rw-r--r-- | searchlib/src/main/java/ai/vespa/searchlib/searchprotocol/protobuf/package-info.java | 5 | ||||
-rw-r--r-- | searchlib/src/protobuf/search_protocol.proto | 59 |
3 files changed, 73 insertions, 0 deletions
diff --git a/searchlib/pom.xml b/searchlib/pom.xml index 1d7862d541e..f4120ca5a10 100644 --- a/searchlib/pom.xml +++ b/searchlib/pom.xml @@ -57,6 +57,11 @@ </exclusions> <scope>provided</scope> </dependency> + <dependency> + <groupId>com.google.protobuf</groupId> + <artifactId>protobuf-java</artifactId> + <scope>provided</scope> + </dependency> </dependencies> <build> <plugins> @@ -81,6 +86,10 @@ <artifactId>ph-javacc-maven-plugin</artifactId> </plugin> <plugin> + <groupId>com.github.os72</groupId> + <artifactId>protoc-jar-maven-plugin</artifactId> + </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-install-plugin</artifactId> <configuration> diff --git a/searchlib/src/main/java/ai/vespa/searchlib/searchprotocol/protobuf/package-info.java b/searchlib/src/main/java/ai/vespa/searchlib/searchprotocol/protobuf/package-info.java new file mode 100644 index 00000000000..4463d4c9f52 --- /dev/null +++ b/searchlib/src/main/java/ai/vespa/searchlib/searchprotocol/protobuf/package-info.java @@ -0,0 +1,5 @@ +// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +@ExportPackage +package ai.vespa.searchlib.searchprotocol.protobuf; + +import com.yahoo.osgi.annotation.ExportPackage; diff --git a/searchlib/src/protobuf/search_protocol.proto b/searchlib/src/protobuf/search_protocol.proto new file mode 100644 index 00000000000..1cdf15729eb --- /dev/null +++ b/searchlib/src/protobuf/search_protocol.proto @@ -0,0 +1,59 @@ +// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +syntax = "proto3"; + +package searchlib.searchprotocol.protobuf; + +option java_package = "ai.vespa.searchlib.searchprotocol.protobuf"; + +message SearchRequest { + int32 offset = 1; + int32 hits = 2; + int32 timeout = 3; // milliseconds + int32 trace_level = 4; + repeated SortField sorting = 5; + string session_key = 6; + string document_type = 7; + bool cache_grouping = 8; + bool cache_query = 9; + string rank_profile = 10; + repeated StringProperty feature_overrides = 11; + repeated TensorProperty tensor_feature_overrides = 12; + repeated StringProperty rank_properties = 13; + repeated TensorProperty tensor_rank_properties = 14; + bytes grouping_blob = 15; // serialized opaquely like now, to be changed later + string geo_location = 16; // to be moved into query_tree + bytes query_tree_blob = 17; // serialized opaquely like now, to be changed later +} + +message TensorProperty { + string name = 1; + bytes value = 2; +} + +message StringProperty { + string name = 1; + repeated string values = 2; +} + +message SortField { + bool ascending = 1; + string field = 2; +} + +message SearchReply { + int64 total_hit_count = 1; + int64 coverage_docs = 2; + int64 active_docs = 3; + int64 soon_active_docs = 4; + bool degraded_by_match_phase = 5; + bool degraded_by_soft_timeout = 6; + repeated Hit hits = 7; + bytes grouping_blob = 8; // serialized opaquely like now, to be changed later +} + +message Hit { + bytes global_id = 1; + double relevance = 2; + bytes sort_data = 3; +} |