From ab7e349284c099fae87f33a31a7439f1dd492c6e Mon Sep 17 00:00:00 2001 From: Joan Antoni RE Date: Wed, 13 Nov 2024 14:44:15 +0100 Subject: [PATCH] Remove *Search gRPC methods and cleanup search (#2626) * Convert ParagraphSearchRequest to SearchRequest * Return appropiate paragraph response * No more RelationSearch either * Not ready to replace paragraph search request * Don't call RelationSearch anymore (py) * Remove RelationSearch * Let's try again with paragraph search :) * Typo in type * Replace last direct call to ParagraphSearch (tests) * No more ParagraphSearch (grpc) * No more DocumentSearch * No more VectorSearch * Remove test using document search * Update protos * Fix test * Cleanup query_paragraph_shard * Remove ignored params from resource search endpoint * Fix test * Fix unit tests * Cleanup relations_shard * Remove paragraph and relation search methods --- nidx/nidx_protos/src/nidx.proto | 4 - nidx/src/searcher/grpc.rs | 25 -- .../common/cluster/grpc_node_dummy.py | 6 - .../cluster/standalone/grpc_node_binding.py | 20 -- nucliadb/src/nucliadb/ingest/orm/entities.py | 10 +- .../nucliadb/search/api/v1/resource/search.py | 18 +- .../src/nucliadb/search/requesters/utils.py | 44 +-- .../src/nucliadb/search/search/chat/query.py | 19 +- nucliadb/src/nucliadb/search/search/merge.py | 11 +- nucliadb/src/nucliadb/search/search/query.py | 49 +-- nucliadb/src/nucliadb/search/search/shards.py | 24 -- .../search/integration/api/v1/test_search.py | 35 +- .../unit/search/requesters/test_utils.py | 38 ++- nucliadb/tests/search/unit/test_merge.py | 4 +- nucliadb_node/src/grpc/grpc_reader.rs | 88 ----- nucliadb_node/src/shards/shard_reader.rs | 40 +-- nucliadb_node/tests/test_search_relations.rs | 152 +++++---- nucliadb_node_binding/src/reader.rs | 47 --- .../tests/integration/test_indexing.py | 16 - nucliadb_paragraphs3/src/set_query.rs | 10 +- nucliadb_protos/nodereader.proto | 4 - .../src/nucliadb_protos/nodereader_pb2.py | 4 +- .../nucliadb_protos/nodereader_pb2_grpc.py | 132 -------- .../nucliadb_protos/nodereader_pb2_grpc.pyi | 68 ---- nucliadb_protos/rust/src/nodereader.rs | 312 ------------------ 25 files changed, 194 insertions(+), 986 deletions(-) diff --git a/nidx/nidx_protos/src/nidx.proto b/nidx/nidx_protos/src/nidx.proto index d2b652068f..d23dab0a5c 100644 --- a/nidx/nidx_protos/src/nidx.proto +++ b/nidx/nidx_protos/src/nidx.proto @@ -30,10 +30,6 @@ service NidxApi { } service NidxSearcher { - rpc DocumentSearch(nodereader.DocumentSearchRequest) returns (nodereader.DocumentSearchResponse) {} - rpc ParagraphSearch(nodereader.ParagraphSearchRequest) returns (nodereader.ParagraphSearchResponse) {} - rpc VectorSearch(nodereader.VectorSearchRequest) returns (nodereader.VectorSearchResponse) {} - rpc RelationSearch(nodereader.RelationSearchRequest) returns (nodereader.RelationSearchResponse) {} rpc DocumentIds(noderesources.ShardId) returns (nodereader.IdCollection) {} rpc ParagraphIds(noderesources.ShardId) returns (nodereader.IdCollection) {} rpc VectorIds(noderesources.VectorSetID) returns (nodereader.IdCollection) {} diff --git a/nidx/src/searcher/grpc.rs b/nidx/src/searcher/grpc.rs index 2ba2218f96..3b058974c8 100644 --- a/nidx/src/searcher/grpc.rs +++ b/nidx/src/searcher/grpc.rs @@ -53,31 +53,6 @@ impl SearchServer { #[tonic::async_trait] impl NidxSearcher for SearchServer { - async fn document_search( - &self, - _request: Request, - ) -> Result> { - todo!() - } - - async fn paragraph_search( - &self, - _request: Request, - ) -> Result> { - todo!() - } - - async fn vector_search(&self, _request: Request) -> Result> { - todo!() - } - - async fn relation_search( - &self, - _request: Request, - ) -> Result> { - todo!() - } - async fn document_ids(&self, _request: Request) -> Result> { todo!() } diff --git a/nucliadb/src/nucliadb/common/cluster/grpc_node_dummy.py b/nucliadb/src/nucliadb/common/cluster/grpc_node_dummy.py index 5a49c5da79..c75ada7758 100644 --- a/nucliadb/src/nucliadb/common/cluster/grpc_node_dummy.py +++ b/nucliadb/src/nucliadb/common/cluster/grpc_node_dummy.py @@ -22,7 +22,6 @@ from nucliadb_protos.nodereader_pb2 import ( EdgeList, RelationEdge, - RelationSearchResponse, ) from nucliadb_protos.noderesources_pb2 import ( EmptyResponse, @@ -90,11 +89,6 @@ async def GetShard(self, data): # pragma: no cover self.calls.setdefault("GetShard", []).append(data) return NodeResourcesShard(shard_id="shard", fields=2, paragraphs=2, sentences=2) - async def RelationSearch(self, data): # pragma: no cover - self.calls.setdefault("RelationSearch", []).append(data) - result = RelationSearchResponse() - return result - async def RelationEdges(self, data): # pragma: no cover self.calls.setdefault("RelationEdges", []).append(data) result = EdgeList() diff --git a/nucliadb/src/nucliadb/common/cluster/standalone/grpc_node_binding.py b/nucliadb/src/nucliadb/common/cluster/standalone/grpc_node_binding.py index a811518ff8..1125edbb48 100644 --- a/nucliadb/src/nucliadb/common/cluster/standalone/grpc_node_binding.py +++ b/nucliadb/src/nucliadb/common/cluster/standalone/grpc_node_binding.py @@ -106,26 +106,6 @@ async def Search(self, request: SearchRequest, retry: bool = False) -> SearchRes else: raise - async def ParagraphSearch(self, request: ParagraphSearchRequest) -> ParagraphSearchResponse: - loop = asyncio.get_running_loop() - result = await loop.run_in_executor( - self.executor, self.reader.paragraph_search, request.SerializeToString() - ) - pb_bytes = bytes(result) - pb = ParagraphSearchResponse() - pb.ParseFromString(pb_bytes) - return pb - - async def RelationSearch(self, request: RelationSearchRequest) -> RelationSearchResponse: - loop = asyncio.get_running_loop() - result = await loop.run_in_executor( - self.executor, self.reader.relation_search, request.SerializeToString() - ) - pb_bytes = bytes(result) - pb = RelationSearchResponse() - pb.ParseFromString(pb_bytes) - return pb - async def GetShard(self, request: GetShardRequest) -> NodeResourcesShard: loop = asyncio.get_running_loop() result = await loop.run_in_executor( diff --git a/nucliadb/src/nucliadb/ingest/orm/entities.py b/nucliadb/src/nucliadb/ingest/orm/entities.py index 0f73dd7e10..4c840d684e 100644 --- a/nucliadb/src/nucliadb/ingest/orm/entities.py +++ b/nucliadb/src/nucliadb/ingest/orm/entities.py @@ -47,7 +47,6 @@ Faceted, RelationNodeFilter, RelationPrefixSearchRequest, - RelationSearchRequest, RelationSearchResponse, SearchRequest, SearchResponse, @@ -208,16 +207,17 @@ async def get_indexed_entities_group(self, group: str) -> Optional[EntitiesGroup shard_manager = get_shard_manager() async def do_entities_search(node: AbstractIndexNode, shard_id: str) -> RelationSearchResponse: - request = RelationSearchRequest( - shard_id=shard_id, - prefix=RelationPrefixSearchRequest( + request = SearchRequest( + shard=shard_id, + relation_prefix=RelationPrefixSearchRequest( prefix="", node_filters=[ RelationNodeFilter(node_type=RelationNode.NodeType.ENTITY, node_subtype=group) ], ), ) - return await node.reader.RelationSearch(request) # type: ignore + response = await node.reader.Search(request) # type: ignore + return response.relation results = await shard_manager.apply_for_all_shards( self.kbid, diff --git a/nucliadb/src/nucliadb/search/api/v1/resource/search.py b/nucliadb/src/nucliadb/search/api/v1/resource/search.py index 1ad5501703..5d110e5ab4 100644 --- a/nucliadb/src/nucliadb/search/api/v1/resource/search.py +++ b/nucliadb/src/nucliadb/search/api/v1/resource/search.py @@ -30,13 +30,10 @@ from nucliadb.search.search.exceptions import InvalidQueryError from nucliadb.search.search.merge import merge_paragraphs_results from nucliadb.search.search.query import paragraph_query_to_pb -from nucliadb_models.common import FieldTypeName -from nucliadb_models.resource import ExtractedDataTypeName, NucliaDBRoles +from nucliadb_models.resource import NucliaDBRoles from nucliadb_models.search import ( NucliaDBClientType, - ResourceProperties, ResourceSearchResults, - SearchOptions, SearchParamDefaults, SortField, SortOrder, @@ -79,13 +76,6 @@ async def resource_search( SearchParamDefaults.range_modification_end ), highlight: bool = fastapi_query(SearchParamDefaults.highlight), - show: list[ResourceProperties] = fastapi_query( - SearchParamDefaults.show, default=list(ResourceProperties) - ), - field_type_filter: list[FieldTypeName] = fastapi_query( - SearchParamDefaults.field_type_filter, alias="field_type" - ), - extracted: list[ExtractedDataTypeName] = fastapi_query(SearchParamDefaults.extracted), x_ndb_client: NucliaDBClientType = Header(NucliaDBClientType.API), debug: bool = fastapi_query(SearchParamDefaults.debug), shards: list[str] = fastapi_query(SearchParamDefaults.shards), @@ -97,7 +87,6 @@ async def resource_search( try: pb_query = await paragraph_query_to_pb( kbid, - [SearchOptions.KEYWORD], rid, query, fields, @@ -116,7 +105,7 @@ async def resource_search( return HTTPClientError(status_code=412, detail=str(exc)) results, incomplete_results, queried_nodes = await node_query( - kbid, Method.PARAGRAPH, pb_query, shards + kbid, Method.SEARCH, pb_query, shards ) # We need to merge @@ -125,9 +114,6 @@ async def resource_search( count=page_size, page=page_number, kbid=kbid, - show=show, - field_type_filter=field_type_filter, - extracted=extracted, highlight_split=highlight, min_score=0.0, ) diff --git a/nucliadb/src/nucliadb/search/requesters/utils.py b/nucliadb/src/nucliadb/search/requesters/utils.py index a2ba7624b4..eee656c393 100644 --- a/nucliadb/src/nucliadb/search/requesters/utils.py +++ b/nucliadb/src/nucliadb/search/requesters/utils.py @@ -19,7 +19,7 @@ import asyncio import json -from enum import Enum +from enum import Enum, auto from typing import Any, Optional, Sequence, TypeVar, Union, overload from fastapi import HTTPException @@ -34,17 +34,11 @@ from nucliadb.common.nidx import get_nidx_fake_node from nucliadb.search import logger from nucliadb.search.search.shards import ( - query_paragraph_shard, query_shard, - relations_shard, suggest_shard, ) from nucliadb.search.settings import settings from nucliadb_protos.nodereader_pb2 import ( - ParagraphSearchRequest, - ParagraphSearchResponse, - RelationSearchRequest, - RelationSearchResponse, SearchRequest, SearchResponse, SuggestRequest, @@ -57,27 +51,21 @@ class Method(Enum): - SEARCH = 1 - PARAGRAPH = 2 - SUGGEST = 3 - RELATIONS = 4 + SEARCH = auto() + SUGGEST = auto() METHODS = { Method.SEARCH: query_shard, - Method.PARAGRAPH: query_paragraph_shard, Method.SUGGEST: suggest_shard, - Method.RELATIONS: relations_shard, } -REQUEST_TYPE = Union[SuggestRequest, ParagraphSearchRequest, SearchRequest, RelationSearchRequest] +REQUEST_TYPE = Union[SuggestRequest, SearchRequest] T = TypeVar( "T", SuggestResponse, - ParagraphSearchResponse, SearchResponse, - RelationSearchResponse, ) @@ -93,18 +81,6 @@ async def node_query( ) -> tuple[list[SuggestResponse], bool, list[tuple[AbstractIndexNode, str]]]: ... -@overload -async def node_query( - kbid: str, - method: Method, - pb_query: ParagraphSearchRequest, - target_shard_replicas: Optional[list[str]] = None, - use_read_replica_nodes: bool = True, - timeout: Optional[float] = None, - retry_on_primary: bool = True, -) -> tuple[list[ParagraphSearchResponse], bool, list[tuple[AbstractIndexNode, str]]]: ... - - @overload async def node_query( kbid: str, @@ -117,18 +93,6 @@ async def node_query( ) -> tuple[list[SearchResponse], bool, list[tuple[AbstractIndexNode, str]]]: ... -@overload -async def node_query( - kbid: str, - method: Method, - pb_query: RelationSearchRequest, - target_shard_replicas: Optional[list[str]] = None, - use_read_replica_nodes: bool = True, - timeout: Optional[float] = None, - retry_on_primary: bool = True, -) -> tuple[list[RelationSearchResponse], bool, list[tuple[AbstractIndexNode, str]]]: ... - - async def node_query( kbid: str, method: Method, diff --git a/nucliadb/src/nucliadb/search/search/chat/query.py b/nucliadb/src/nucliadb/search/search/chat/query.py index b69b8308b8..e47e95ada9 100644 --- a/nucliadb/src/nucliadb/search/search/chat/query.py +++ b/nucliadb/src/nucliadb/search/search/chat/query.py @@ -49,7 +49,7 @@ parse_rephrase_prompt, ) from nucliadb_protos import audit_pb2 -from nucliadb_protos.nodereader_pb2 import RelationSearchRequest, RelationSearchResponse +from nucliadb_protos.nodereader_pb2 import RelationSearchResponse, SearchRequest, SearchResponse from nucliadb_telemetry.errors import capture_exception from nucliadb_utils.utilities import get_audit @@ -214,25 +214,26 @@ async def get_relations_results( try: predict = get_predict() detected_entities = await predict.detect_entities(kbid, text_answer) - relation_request = RelationSearchRequest() - relation_request.subgraph.entry_points.extend(detected_entities) - relation_request.subgraph.depth = 1 + request = SearchRequest() + request.relation_subgraph.entry_points.extend(detected_entities) + request.relation_subgraph.depth = 1 - relations_results: list[RelationSearchResponse] + results: list[SearchResponse] ( - relations_results, + results, _, _, ) = await node_query( kbid, - Method.RELATIONS, - relation_request, + Method.SEARCH, + request, target_shard_replicas=target_shard_replicas, timeout=timeout, use_read_replica_nodes=True, retry_on_primary=False, ) - return await merge_relations_results(relations_results, relation_request.subgraph) + relations_results: list[RelationSearchResponse] = [result.relation for result in results] + return await merge_relations_results(relations_results, request.relation_subgraph) except Exception as exc: capture_exception(exc) logger.exception("Error getting relations results") diff --git a/nucliadb/src/nucliadb/search/search/merge.py b/nucliadb/src/nucliadb/search/search/merge.py index ad4e87d81b..39e4d4a62d 100644 --- a/nucliadb/src/nucliadb/search/search/merge.py +++ b/nucliadb/src/nucliadb/search/search/merge.py @@ -344,7 +344,7 @@ async def merge_paragraph_results( highlight: bool, sort: SortOptions, min_score: float, -): +) -> Paragraphs: raw_paragraph_list: list[tuple[ParagraphResult, SortValue]] = [] facets: dict[str, Any] = {} query = None @@ -545,19 +545,16 @@ async def merge_results( async def merge_paragraphs_results( - paragraph_responses: list[ParagraphSearchResponse], + responses: list[SearchResponse], count: int, page: int, kbid: str, - show: list[ResourceProperties], - field_type_filter: list[FieldTypeName], - extracted: list[ExtractedDataTypeName], highlight_split: bool, min_score: float, ) -> ResourceSearchResults: paragraphs = [] - for result in paragraph_responses: - paragraphs.append(result) + for result in responses: + paragraphs.append(result.paragraph) api_results = ResourceSearchResults() diff --git a/nucliadb/src/nucliadb/search/search/query.py b/nucliadb/src/nucliadb/search/search/query.py index 9af401d4f5..684ff39a05 100644 --- a/nucliadb/src/nucliadb/search/search/query.py +++ b/nucliadb/src/nucliadb/search/search/query.py @@ -635,7 +635,6 @@ async def adjust_page_size(self, request: nodereader_pb2.SearchRequest, reranker async def paragraph_query_to_pb( kbid: str, - features: list[SearchOptions], rid: str, query: str, fields: list[str], @@ -650,14 +649,38 @@ async def paragraph_query_to_pb( sort: Optional[str] = None, sort_ord: str = SortOrder.DESC.value, with_duplicates: bool = False, -) -> nodereader_pb2.ParagraphSearchRequest: - request = nodereader_pb2.ParagraphSearchRequest() - request.with_duplicates = with_duplicates +) -> nodereader_pb2.SearchRequest: + request = nodereader_pb2.SearchRequest() + request.paragraph = True # We need to ask for all and cut later request.page_number = 0 request.result_per_page = page_number * page_size + page_size + request.body = query + + # we don't have a specific filter only for resource_ids but key_filters + # parse "rid" and "rid/field" like ids, so it does the job + request.key_filters.append(rid) + + if len(filters) > 0: + field_labels = filters + paragraph_labels: list[str] = [] + if has_classification_label_filters(filters): + classification_labels = await get_classification_labels(kbid) + field_labels, paragraph_labels = split_labels_by_type(filters, classification_labels) + request.filter.field_labels.extend(field_labels) + request.filter.paragraph_labels.extend(paragraph_labels) + + request.faceted.labels.extend([translate_label(facet) for facet in faceted]) + request.fields.extend(fields) + + if sort: + request.order.field = sort + request.order.type = sort_ord # type: ignore + + request.with_duplicates = with_duplicates + if range_creation_start is not None: request.timestamps.from_created.FromDatetime(range_creation_start) @@ -670,24 +693,6 @@ async def paragraph_query_to_pb( if range_modification_end is not None: request.timestamps.to_modified.FromDatetime(range_modification_end) - if SearchOptions.KEYWORD in features: - request.uuid = rid - request.body = query - if len(filters) > 0: - field_labels = filters - paragraph_labels: list[str] = [] - if has_classification_label_filters(filters): - classification_labels = await get_classification_labels(kbid) - field_labels, paragraph_labels = split_labels_by_type(filters, classification_labels) - request.filter.field_labels.extend(field_labels) - request.filter.paragraph_labels.extend(paragraph_labels) - - request.faceted.labels.extend([translate_label(facet) for facet in faceted]) - if sort: - request.order.field = sort - request.order.type = sort_ord # type: ignore - request.fields.extend(fields) - return request diff --git a/nucliadb/src/nucliadb/search/search/shards.py b/nucliadb/src/nucliadb/search/search/shards.py index 6e152c6147..e1474f324d 100644 --- a/nucliadb/src/nucliadb/search/search/shards.py +++ b/nucliadb/src/nucliadb/search/search/shards.py @@ -22,10 +22,6 @@ from nucliadb.common.cluster.base import AbstractIndexNode from nucliadb_protos.nodereader_pb2 import ( GetShardRequest, - ParagraphSearchRequest, - ParagraphSearchResponse, - RelationSearchRequest, - RelationSearchResponse, SearchRequest, SearchResponse, SuggestRequest, @@ -58,29 +54,9 @@ async def get_shard(node: AbstractIndexNode, shard_id: str) -> Shard: return await node.reader.GetShard(req) # type: ignore -async def query_paragraph_shard( - node: AbstractIndexNode, shard: str, query: ParagraphSearchRequest -) -> ParagraphSearchResponse: - req = ParagraphSearchRequest() - req.CopyFrom(query) - req.id = shard - with node_observer({"type": "paragraph_search", "node_id": node.id}): - return await node.reader.ParagraphSearch(req) # type: ignore - - async def suggest_shard(node: AbstractIndexNode, shard: str, query: SuggestRequest) -> SuggestResponse: req = SuggestRequest() req.CopyFrom(query) req.shard = shard with node_observer({"type": "suggest", "node_id": node.id}): return await node.reader.Suggest(req) # type: ignore - - -async def relations_shard( - node: AbstractIndexNode, shard: str, query: RelationSearchRequest -) -> RelationSearchResponse: - req = RelationSearchRequest() - req.CopyFrom(query) - req.shard_id = shard - with node_observer({"type": "relation_search", "node_id": node.id}): - return await node.reader.RelationSearch(req) # type: ignore diff --git a/nucliadb/tests/search/integration/api/v1/test_search.py b/nucliadb/tests/search/integration/api/v1/test_search.py index 381f760c9a..61cb92ff8c 100644 --- a/nucliadb/tests/search/integration/api/v1/test_search.py +++ b/nucliadb/tests/search/integration/api/v1/test_search.py @@ -31,9 +31,7 @@ from nucliadb.tests.vectors import Q from nucliadb_models.resource import NucliaDBRoles from nucliadb_protos.nodereader_pb2 import ( - DocumentSearchRequest, - ParagraphSearchRequest, - VectorSearchRequest, + SearchRequest, ) from nucliadb_protos.writer_pb2 import Shards as PBShards @@ -161,30 +159,23 @@ async def test_search_resource_all( assert shard.paragraphs == 2 assert shard.sentences == 3 - prequest = ParagraphSearchRequest() - prequest.id = replica.shard.id - prequest.body = "Ramon" - prequest.result_per_page = 10 + request = SearchRequest() + request.shard = replica.shard.id + request.body = "Ramon" + request.result_per_page = 20 + request.document = True + request.paragraph = True + request.vector.extend(Q) + request.min_score_semantic = -1.0 - drequest = DocumentSearchRequest() - drequest.id = replica.shard.id - drequest.body = "Ramon" - drequest.result_per_page = 10 - - vrequest = VectorSearchRequest() - vrequest.id = replica.shard.id - vrequest.vector.extend(Q) - vrequest.result_per_page = 20 - vrequest.min_score = -1.0 - - paragraphs = await node_obj.reader.ParagraphSearch(prequest) # type: ignore - documents = await node_obj.reader.DocumentSearch(drequest) # type: ignore + response = await node_obj.reader.Search(request) # type: ignore + paragraphs = response.paragraph + documents = response.document + vectors = response.vector assert paragraphs.total == 1 assert documents.total == 1 - vectors = await node_obj.reader.VectorSearch(vrequest) # type: ignore - # 0-19 : My own text Ramon # 20-45 : This is great to be here # 48-65 : Where is my beer? diff --git a/nucliadb/tests/search/unit/search/requesters/test_utils.py b/nucliadb/tests/search/unit/search/requesters/test_utils.py index 6777651940..9527ba7ed2 100644 --- a/nucliadb/tests/search/unit/search/requesters/test_utils.py +++ b/nucliadb/tests/search/unit/search/requesters/test_utils.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from unittest.mock import AsyncMock, Mock +from unittest.mock import AsyncMock, Mock, patch import pytest from fastapi import HTTPException @@ -85,28 +85,22 @@ def shard_manager(): @pytest.fixture() -def search_methods(): +def faulty_search_methods(): def fake_search(node: AbstractIndexNode, shard: str, query: nodereader_pb2.SearchRequest): if node.is_read_replica(): raise Exception() return nodereader_pb2.SearchResponse() - original = utils.METHODS - utils.METHODS = { - utils.Method.SEARCH: AsyncMock(side_effect=fake_search), - utils.Method.PARAGRAPH: AsyncMock(), - } - - yield utils.METHODS - - utils.METHODS = original + faulty_methods = {utils.Method.SEARCH: AsyncMock(side_effect=fake_search)} + with patch.dict(utils.METHODS, faulty_methods, clear=True): + yield faulty_methods @pytest.mark.asyncio async def test_node_query_retries_primary_if_secondary_fails( fake_nodes, shard_manager, - search_methods, + faulty_search_methods, ): """Setting up a node and a faulty replica, validate primary is queried if secondary fails. @@ -120,19 +114,33 @@ async def test_node_query_retries_primary_if_secondary_fails( use_read_replica_nodes=True, ) # secondary fails, primary is called - assert search_methods[utils.Method.SEARCH].await_count == 2 + assert faulty_search_methods[utils.Method.SEARCH].await_count == 2 assert len(queried_nodes) == 2 assert queried_nodes[0][0].is_read_replica() assert not queried_nodes[1][0].is_read_replica() + +@pytest.fixture() +def mocked_search_methods(): + methods = {utils.Method.SEARCH: AsyncMock()} + with patch.dict(utils.METHODS, methods, clear=True): + yield methods + + +@pytest.mark.asyncio +async def test_node_dont_retry_if_secondary_succeeds( + fake_nodes, + shard_manager, + mocked_search_methods, +): results, incomplete_results, queried_nodes = await utils.node_query( kbid="my-kbid", - method=utils.Method.PARAGRAPH, + method=utils.Method.SEARCH, pb_query=Mock(), use_read_replica_nodes=True, ) # secondary succeeds, no fallback call to primary - assert search_methods[utils.Method.PARAGRAPH].await_count == 1 + assert mocked_search_methods[utils.Method.SEARCH].await_count == 1 assert len(queried_nodes) == 1 assert queried_nodes[0][0].is_read_replica() diff --git a/nucliadb/tests/search/unit/test_merge.py b/nucliadb/tests/search/unit/test_merge.py index 4ea953fd2e..e75f5416ba 100644 --- a/nucliadb/tests/search/unit/test_merge.py +++ b/nucliadb/tests/search/unit/test_merge.py @@ -24,11 +24,11 @@ async def test_str_model(): # make sure __str__ works as advertised - res = await merge_paragraphs_results([], 1, 1, "kbid", [], [], [], False, 1) + res = await merge_paragraphs_results([], 1, 1, "kbid", False, 1) assert str(res) == res.json() async def test_str_model_fallback(): with patch.object(ResourceSearchResults, "model_dump_json", side_effect=Exception("ERROR")): - res = await merge_paragraphs_results([], 1, 1, "kbid", [], [], [], False, 1) + res = await merge_paragraphs_results([], 1, 1, "kbid", False, 1) assert "sentences=None" in str(res) diff --git a/nucliadb_node/src/grpc/grpc_reader.rs b/nucliadb_node/src/grpc/grpc_reader.rs index 9b04fc43ec..5269d0475e 100644 --- a/nucliadb_node/src/grpc/grpc_reader.rs +++ b/nucliadb_node/src/grpc/grpc_reader.rs @@ -230,94 +230,6 @@ impl NodeReader for NodeReaderGRPCDriver { } } - async fn vector_search( - &self, - request: tonic::Request, - ) -> Result, tonic::Status> { - let span = Span::current(); - let vector_request = request.into_inner(); - let shard_id = vector_request.id.clone(); - let info = info_span!(parent: &span, "vector search"); - let shards = Arc::clone(&self.shards); - let task = move || { - let shard = obtain_shard(shards, shard_id)?; - run_with_telemetry(info, move || shard.vector_search(vector_request)) - }; - let response = tokio::task::spawn_blocking(task) - .await - .map_err(|error| tonic::Status::internal(format!("Blocking task panicked: {error:?}")))?; - match response { - Ok(response) => Ok(tonic::Response::new(response)), - Err(error) => Err(tonic::Status::internal(error.to_string())), - } - } - - async fn relation_search( - &self, - request: tonic::Request, - ) -> Result, tonic::Status> { - let span = Span::current(); - let relation_request = request.into_inner(); - let shard_id = relation_request.shard_id.clone(); - let info = info_span!(parent: &span, "relations search"); - let shards = Arc::clone(&self.shards); - let task = move || { - let shard = obtain_shard(shards, shard_id)?; - run_with_telemetry(info, move || shard.relation_search(relation_request)) - }; - let response = tokio::task::spawn_blocking(task) - .await - .map_err(|error| tonic::Status::internal(format!("Blocking task panicked: {error:?}")))?; - match response { - Ok(response) => Ok(tonic::Response::new(response)), - Err(error) => Err(tonic::Status::internal(error.to_string())), - } - } - - async fn document_search( - &self, - request: tonic::Request, - ) -> Result, tonic::Status> { - let span = Span::current(); - let document_request = request.into_inner(); - let shard_id = document_request.id.clone(); - let info = info_span!(parent: &span, "document search"); - let shards = Arc::clone(&self.shards); - let task = move || { - let shard = obtain_shard(shards, shard_id)?; - run_with_telemetry(info, move || shard.document_search(document_request)) - }; - let response = tokio::task::spawn_blocking(task) - .await - .map_err(|error| tonic::Status::internal(format!("Blocking task panicked: {error:?}")))?; - match response { - Ok(response) => Ok(tonic::Response::new(response)), - Err(error) => Err(tonic::Status::internal(error.to_string())), - } - } - - async fn paragraph_search( - &self, - request: tonic::Request, - ) -> Result, tonic::Status> { - let span = Span::current(); - let paragraph_request = request.into_inner(); - let shard_id = paragraph_request.id.clone(); - let info = info_span!(parent: &span, "paragraph search"); - let shards = Arc::clone(&self.shards); - let task = move || { - let shard = obtain_shard(shards, shard_id)?; - run_with_telemetry(info, move || shard.paragraph_search(paragraph_request)) - }; - let response = tokio::task::spawn_blocking(task) - .await - .map_err(|error| tonic::Status::internal(format!("Blocking task panicked: {error:?}")))?; - match response { - Ok(response) => Ok(tonic::Response::new(response)), - Err(error) => Err(tonic::Status::internal(error.to_string())), - } - } - async fn document_ids( &self, request: tonic::Request, diff --git a/nucliadb_node/src/shards/shard_reader.rs b/nucliadb_node/src/shards/shard_reader.rs index e319a925ad..776ccc7516 100644 --- a/nucliadb_node/src/shards/shard_reader.rs +++ b/nucliadb_node/src/shards/shard_reader.rs @@ -28,9 +28,8 @@ use nucliadb_core::prelude::*; use nucliadb_core::protos; use nucliadb_core::protos::shard_created::{DocumentService, ParagraphService, RelationService, VectorService}; use nucliadb_core::protos::{ - DocumentSearchRequest, DocumentSearchResponse, EdgeList, ParagraphSearchRequest, ParagraphSearchResponse, - RelationPrefixSearchRequest, RelationSearchRequest, RelationSearchResponse, SearchRequest, SearchResponse, Shard, - ShardFile, ShardFileChunk, ShardFileList, StreamRequest, SuggestFeatures, SuggestRequest, SuggestResponse, + EdgeList, RelationPrefixSearchRequest, RelationSearchRequest, SearchRequest, SearchResponse, Shard, ShardFile, + ShardFileChunk, ShardFileList, StreamRequest, SuggestFeatures, SuggestRequest, SuggestResponse, VectorSearchRequest, VectorSearchResponse, }; use nucliadb_core::query_language; @@ -624,41 +623,6 @@ impl ShardReader { }) } - #[tracing::instrument(skip_all)] - pub fn paragraph_search(&self, search_request: ParagraphSearchRequest) -> NodeResult { - let span = tracing::Span::current(); - - run_with_telemetry(info_span!(parent: &span, "paragraph reader search"), || { - read_rw_lock(&self.paragraph_reader).search(&search_request, &ParagraphsContext::default()) - }) - } - - #[tracing::instrument(skip_all)] - pub fn document_search(&self, search_request: DocumentSearchRequest) -> NodeResult { - let span = tracing::Span::current(); - - run_with_telemetry(info_span!(parent: &span, "field reader search"), || { - read_rw_lock(&self.text_reader).search(&search_request) - }) - } - - #[tracing::instrument(skip_all)] - pub fn vector_search(&self, search_request: VectorSearchRequest) -> NodeResult { - let span = tracing::Span::current(); - - run_with_telemetry(info_span!(parent: &span, "vector reader search"), || { - self.vectors_index_search(&search_request, &VectorsContext::default()) - }) - } - #[tracing::instrument(skip_all)] - pub fn relation_search(&self, search_request: RelationSearchRequest) -> NodeResult { - let span = tracing::Span::current(); - - run_with_telemetry(info_span!(parent: &span, "relation reader search"), || { - read_rw_lock(&self.relation_reader).search(&search_request) - }) - } - pub fn update(&self) -> NodeResult<()> { let shard_path = self.metadata.shard_path(); // TODO: while we don't have all shards migrated, we still have to diff --git a/nucliadb_node/tests/test_search_relations.rs b/nucliadb_node/tests/test_search_relations.rs index 7cff73d2d6..b90a964876 100644 --- a/nucliadb_node/tests/test_search_relations.rs +++ b/nucliadb_node/tests/test_search_relations.rs @@ -23,7 +23,7 @@ mod common; use std::collections::{HashMap, HashSet}; use std::time::SystemTime; -use common::{NodeFixture, TestNodeWriter}; +use common::{NodeFixture, TestNodeReader, TestNodeWriter}; use nucliadb_core::protos::op_status::Status; use nucliadb_core::protos::prost_types::Timestamp; use nucliadb_core::protos::relation::RelationType; @@ -33,6 +33,7 @@ use nucliadb_core::protos::{ EntitiesSubgraphRequest, IndexMetadata, NewShardRequest, Relation, RelationNode, RelationNodeFilter, RelationPrefixSearchRequest, RelationSearchRequest, RelationSearchResponse, Resource, ResourceId, }; +use nucliadb_protos::nodereader::SearchRequest; use rstest::*; use tonic::Request; use uuid::Uuid; @@ -338,19 +339,21 @@ async fn test_search_relations_prefixed() -> Result<(), Box Result<(), Box Result<(), Box>(); assert_eq!(results, expected); @@ -385,8 +390,9 @@ async fn test_search_relations_prefixed() -> Result<(), Box Result<(), Box>(); assert_eq!(results, expected); - let response = reader - .relation_search(RelationSearchRequest { + let response = relation_search( + &mut reader, + RelationSearchRequest { shard_id: shard_id.clone(), prefix: Some(RelationPrefixSearchRequest { prefix: "cat".to_string(), @@ -416,12 +424,13 @@ async fn test_search_relations_prefixed() -> Result<(), Box>(); assert_eq!(results, expected); @@ -429,8 +438,9 @@ async fn test_search_relations_prefixed() -> Result<(), Box Result<(), Box>(); assert_eq!(results, expected); @@ -453,19 +464,21 @@ async fn test_search_relations_prefixed() -> Result<(), Box Result<(), Box Result<(), Box Result<(), Box Result<(), Box Result<(), Box Result<(), Box anyhow::Result { + let request = SearchRequest { + shard: request.shard_id, + vectorset: "english".to_string(), + relation_prefix: request.prefix, + relation_subgraph: request.subgraph, + ..Default::default() + }; + let response = reader.search(request).await?; + Ok(response.into_inner().relation.unwrap()) +} diff --git a/nucliadb_node_binding/src/reader.rs b/nucliadb_node_binding/src/reader.rs index 1c838929f2..a834de9491 100644 --- a/nucliadb_node_binding/src/reader.rs +++ b/nucliadb_node_binding/src/reader.rs @@ -167,53 +167,6 @@ impl NodeReader { } } - pub fn vector_search<'p>(&mut self, request: RawProtos, py: Python<'p>) -> PyResult<&'p PyAny> { - let vector_request = VectorSearchRequest::decode(&mut Cursor::new(request)).expect("Error decoding arguments"); - let shard_id = vector_request.id.clone(); - let shard = self.obtain_shard(shard_id)?; - let response = shard.vector_search(vector_request); - match response { - Ok(response) => Ok(PyList::new(py, response.encode_to_vec())), - Err(error) => Err(IndexNodeException::new_err(error.to_string())), - } - } - - pub fn document_search<'p>(&mut self, request: RawProtos, py: Python<'p>) -> PyResult<&'p PyAny> { - let document_request = - DocumentSearchRequest::decode(&mut Cursor::new(request)).expect("Error decoding arguments"); - let shard_id = document_request.id.clone(); - let shard = self.obtain_shard(shard_id)?; - let response = shard.document_search(document_request); - match response { - Ok(response) => Ok(PyList::new(py, response.encode_to_vec())), - Err(error) => Err(IndexNodeException::new_err(error.to_string())), - } - } - - pub fn paragraph_search<'p>(&mut self, request: RawProtos, py: Python<'p>) -> PyResult<&'p PyAny> { - let paragraph_request = - ParagraphSearchRequest::decode(&mut Cursor::new(request)).expect("Error decoding arguments"); - let shard_id = paragraph_request.id.clone(); - let shard = self.obtain_shard(shard_id)?; - let response = shard.paragraph_search(paragraph_request); - match response { - Ok(response) => Ok(PyList::new(py, response.encode_to_vec())), - Err(error) => Err(IndexNodeException::new_err(error.to_string())), - } - } - - pub fn relation_search<'p>(&mut self, request: RawProtos, py: Python<'p>) -> PyResult<&'p PyAny> { - let relation_request = - RelationSearchRequest::decode(&mut Cursor::new(request)).expect("Error decoding arguments"); - let shard_id = relation_request.shard_id.clone(); - let shard = self.obtain_shard(shard_id)?; - let response = shard.relation_search(relation_request); - match response { - Ok(response) => Ok(PyList::new(py, response.encode_to_vec())), - Err(error) => Err(IndexNodeException::new_err(error.to_string())), - } - } - pub fn relation_edges<'p>(&mut self, request: RawProtos, py: Python<'p>) -> PyResult<&'p PyAny> { let shard_id = ShardId::decode(&mut Cursor::new(request)).expect("Error decoding arguments"); let shard = self.obtain_shard(shard_id.id)?; diff --git a/nucliadb_node_binding/tests/integration/test_indexing.py b/nucliadb_node_binding/tests/integration/test_indexing.py index 6b2a33f340..aeb80b0fc9 100644 --- a/nucliadb_node_binding/tests/integration/test_indexing.py +++ b/nucliadb_node_binding/tests/integration/test_indexing.py @@ -24,8 +24,6 @@ from nucliadb_node_binding import NodeReader, NodeWriter # type: ignore from nucliadb_protos.nodereader_pb2 import ( - DocumentSearchRequest, - DocumentSearchResponse, SearchRequest, SearchResponse, ) @@ -98,17 +96,3 @@ async def _test_set_and_search(channel): searchpb.document = True pbresult = cluster.call_search_api("search", searchpb, SearchResponse) assert pbresult.document.total == 1 - - -@pytest.mark.asyncio -async def test_set_and_document_search(data_path): - cluster = IndexNode() - shard_id = cluster.create_shard("test-kbid") - cluster.create_resource(shard_id) - - # search using the document search API - searchpb = DocumentSearchRequest() - searchpb.id = shard_id - searchpb.body = "lovely" - pbresult = cluster.call_search_api("document_search", searchpb, DocumentSearchResponse) - assert pbresult.total == 1 diff --git a/nucliadb_paragraphs3/src/set_query.rs b/nucliadb_paragraphs3/src/set_query.rs index 38796e745c..e87c5a1b7a 100644 --- a/nucliadb_paragraphs3/src/set_query.rs +++ b/nucliadb_paragraphs3/src/set_query.rs @@ -31,14 +31,14 @@ use tantivy::TantivyError; /// A Term Set Query matches all of the documents containing any of the Term provided #[derive(Debug, Clone)] pub struct SetQuery { - set: SetWightWrapper, + set: SetWeightWrapper, } impl SetQuery { /// Create a Term Set Query pub fn new(field: Field, values: Vec) -> Self { let values = values.into_iter().collect(); - let set = SetWightWrapper::new(SetWeight { + let set = SetWeightWrapper::new(SetWeight { field, values, }); @@ -56,9 +56,9 @@ impl Query for SetQuery { } #[derive(Clone, Debug)] -struct SetWightWrapper(Arc); +struct SetWeightWrapper(Arc); -impl SetWightWrapper { +impl SetWeightWrapper { fn new(v: SetWeight) -> Self { Self(Arc::new(v)) } @@ -70,7 +70,7 @@ struct SetWeight { values: HashSet, } -impl Weight for SetWightWrapper { +impl Weight for SetWeightWrapper { fn scorer(&self, reader: &SegmentReader, boost: Score) -> tantivy::Result> { let max_doc = reader.max_doc(); let mut doc_bitset = BitSet::with_max_value(max_doc); diff --git a/nucliadb_protos/nodereader.proto b/nucliadb_protos/nodereader.proto index c929473b8e..3921860213 100644 --- a/nucliadb_protos/nodereader.proto +++ b/nucliadb_protos/nodereader.proto @@ -453,10 +453,6 @@ message ShardFileChunk { service NodeReader { rpc GetShard(GetShardRequest) returns (noderesources.Shard) {} - rpc DocumentSearch(DocumentSearchRequest) returns (DocumentSearchResponse) {} - rpc ParagraphSearch(ParagraphSearchRequest) returns (ParagraphSearchResponse) {} - rpc VectorSearch(VectorSearchRequest) returns (VectorSearchResponse) {} - rpc RelationSearch(RelationSearchRequest) returns (RelationSearchResponse) {} rpc DocumentIds(noderesources.ShardId) returns (IdCollection) {} rpc ParagraphIds(noderesources.ShardId) returns (IdCollection) {} rpc VectorIds(noderesources.VectorSetID) returns (IdCollection) {} diff --git a/nucliadb_protos/python/src/nucliadb_protos/nodereader_pb2.py b/nucliadb_protos/python/src/nucliadb_protos/nodereader_pb2.py index 10b8d29947..069db8c5e6 100644 --- a/nucliadb_protos/python/src/nucliadb_protos/nodereader_pb2.py +++ b/nucliadb_protos/python/src/nucliadb_protos/nodereader_pb2.py @@ -23,7 +23,7 @@ from nucliadb_protos.noderesources_pb2 import * from nucliadb_protos.utils_pb2 import * -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n nucliadb_protos/nodereader.proto\x12\nnodereader\x1a#nucliadb_protos/noderesources.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1bnucliadb_protos/utils.proto\"p\n\x06\x46ilter\x12\x14\n\x0c\x66ield_labels\x18\x01 \x03(\t\x12\x18\n\x10paragraph_labels\x18\x02 \x03(\t\x12\x19\n\x11labels_expression\x18\x03 \x01(\t\x12\x1b\n\x13keywords_expression\x18\x04 \x01(\t\"\x82\x01\n\x0cStreamFilter\x12\x39\n\x0b\x63onjunction\x18\x01 \x01(\x0e\x32$.nodereader.StreamFilter.Conjunction\x12\x0e\n\x06labels\x18\x02 \x03(\t\"\'\n\x0b\x43onjunction\x12\x07\n\x03\x41ND\x10\x00\x12\x06\n\x02OR\x10\x01\x12\x07\n\x03NOT\x10\x02\"\x19\n\x07\x46\x61\x63\x65ted\x12\x0e\n\x06labels\x18\x01 \x03(\t\"\xc3\x01\n\x07OrderBy\x12\x11\n\x05\x66ield\x18\x01 \x01(\tB\x02\x18\x01\x12+\n\x04type\x18\x02 \x01(\x0e\x32\x1d.nodereader.OrderBy.OrderType\x12/\n\x07sort_by\x18\x03 \x01(\x0e\x32\x1e.nodereader.OrderBy.OrderField\"\x1e\n\tOrderType\x12\x08\n\x04\x44\x45SC\x10\x00\x12\x07\n\x03\x41SC\x10\x01\"\'\n\nOrderField\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0c\n\x08MODIFIED\x10\x01\"\xd2\x01\n\nTimestamps\x12\x31\n\rfrom_modified\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bto_modified\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x0c\x66rom_created\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nto_created\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\")\n\x0b\x46\x61\x63\x65tResult\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\r\n\x05total\x18\x02 \x01(\x05\"=\n\x0c\x46\x61\x63\x65tResults\x12-\n\x0c\x66\x61\x63\x65tresults\x18\x01 \x03(\x0b\x32\x17.nodereader.FacetResult\"\xc8\x03\n\x15\x44ocumentSearchRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04\x62ody\x18\x02 \x01(\t\x12\x0e\n\x06\x66ields\x18\x03 \x03(\t\x12\"\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x12.nodereader.Filter\x12\"\n\x05order\x18\x05 \x01(\x0b\x32\x13.nodereader.OrderBy\x12$\n\x07\x66\x61\x63\x65ted\x18\x06 \x01(\x0b\x32\x13.nodereader.Faceted\x12\x13\n\x0bpage_number\x18\x07 \x01(\x05\x12\x17\n\x0fresult_per_page\x18\x08 \x01(\x05\x12*\n\ntimestamps\x18\t \x01(\x0b\x32\x16.nodereader.Timestamps\x12\x12\n\x06reload\x18\n \x01(\x08\x42\x02\x18\x01\x12\x14\n\x0conly_faceted\x18\x0f \x01(\x08\x12@\n\x0bwith_status\x18\x10 \x01(\x0e\x32&.noderesources.Resource.ResourceStatusH\x00\x88\x01\x01\x12\x1b\n\x0e\x61\x64vanced_query\x18\x11 \x01(\tH\x01\x88\x01\x01\x12\x11\n\tmin_score\x18\x12 \x01(\x02\x42\x0e\n\x0c_with_statusB\x11\n\x0f_advanced_query\"\xe8\x03\n\x16ParagraphSearchRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04uuid\x18\x02 \x01(\t\x12\x0e\n\x06\x66ields\x18\x03 \x03(\t\x12\x0c\n\x04\x62ody\x18\x04 \x01(\t\x12\"\n\x06\x66ilter\x18\x05 \x01(\x0b\x32\x12.nodereader.Filter\x12\"\n\x05order\x18\x07 \x01(\x0b\x32\x13.nodereader.OrderBy\x12$\n\x07\x66\x61\x63\x65ted\x18\x08 \x01(\x0b\x32\x13.nodereader.Faceted\x12\x13\n\x0bpage_number\x18\n \x01(\x05\x12\x17\n\x0fresult_per_page\x18\x0b \x01(\x05\x12*\n\ntimestamps\x18\x0c \x01(\x0b\x32\x16.nodereader.Timestamps\x12\x12\n\x06reload\x18\r \x01(\x08\x42\x02\x18\x01\x12\x17\n\x0fwith_duplicates\x18\x0e \x01(\x08\x12\x14\n\x0conly_faceted\x18\x0f \x01(\x08\x12\x1b\n\x0e\x61\x64vanced_query\x18\x10 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x0bkey_filters\x18\x11 \x03(\t\x12\x11\n\tmin_score\x18\x12 \x01(\x02\x12&\n\x08security\x18\x13 \x01(\x0b\x32\x0f.utils.SecurityH\x01\x88\x01\x01\x42\x11\n\x0f_advanced_queryB\x0b\n\t_security\",\n\x0bResultScore\x12\x0c\n\x04\x62m25\x18\x01 \x01(\x02\x12\x0f\n\x07\x62ooster\x18\x02 \x01(\x02\"e\n\x0e\x44ocumentResult\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12&\n\x05score\x18\x03 \x01(\x0b\x32\x17.nodereader.ResultScore\x12\r\n\x05\x66ield\x18\x04 \x01(\t\x12\x0e\n\x06labels\x18\x05 \x03(\t\"\xbb\x02\n\x16\x44ocumentSearchResponse\x12\r\n\x05total\x18\x01 \x01(\x05\x12+\n\x07results\x18\x02 \x03(\x0b\x32\x1a.nodereader.DocumentResult\x12>\n\x06\x66\x61\x63\x65ts\x18\x03 \x03(\x0b\x32..nodereader.DocumentSearchResponse.FacetsEntry\x12\x13\n\x0bpage_number\x18\x04 \x01(\x05\x12\x17\n\x0fresult_per_page\x18\x05 \x01(\x05\x12\r\n\x05query\x18\x06 \x01(\t\x12\x11\n\tnext_page\x18\x07 \x01(\x08\x12\x0c\n\x04\x62m25\x18\x08 \x01(\x08\x1aG\n\x0b\x46\x61\x63\x65tsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.nodereader.FacetResults:\x02\x38\x01\"\xf8\x01\n\x0fParagraphResult\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\r\n\x05\x66ield\x18\x03 \x01(\t\x12\r\n\x05start\x18\x04 \x01(\x04\x12\x0b\n\x03\x65nd\x18\x05 \x01(\x04\x12\x11\n\tparagraph\x18\x06 \x01(\t\x12\r\n\x05split\x18\x07 \x01(\t\x12\r\n\x05index\x18\x08 \x01(\x04\x12&\n\x05score\x18\t \x01(\x0b\x32\x17.nodereader.ResultScore\x12\x0f\n\x07matches\x18\n \x03(\t\x12\x32\n\x08metadata\x18\x0b \x01(\x0b\x32 .noderesources.ParagraphMetadata\x12\x0e\n\x06labels\x18\x0c \x03(\t\"\xe8\x02\n\x17ParagraphSearchResponse\x12\x16\n\x0e\x66uzzy_distance\x18\n \x01(\x05\x12\r\n\x05total\x18\x01 \x01(\x05\x12,\n\x07results\x18\x02 \x03(\x0b\x32\x1b.nodereader.ParagraphResult\x12?\n\x06\x66\x61\x63\x65ts\x18\x03 \x03(\x0b\x32/.nodereader.ParagraphSearchResponse.FacetsEntry\x12\x13\n\x0bpage_number\x18\x04 \x01(\x05\x12\x17\n\x0fresult_per_page\x18\x05 \x01(\x05\x12\r\n\x05query\x18\x06 \x01(\t\x12\x11\n\tnext_page\x18\x07 \x01(\x08\x12\x0c\n\x04\x62m25\x18\x08 \x01(\x08\x12\x10\n\x08\x65matches\x18\t \x03(\t\x1aG\n\x0b\x46\x61\x63\x65tsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.nodereader.FacetResults:\x02\x38\x01\"\x8f\x02\n\x13VectorSearchRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06vector\x18\x02 \x03(\x02\x12\x14\n\x0c\x66ield_labels\x18\x03 \x03(\t\x12\x18\n\x10paragraph_labels\x18\x12 \x03(\t\x12\x13\n\x0bpage_number\x18\x04 \x01(\x05\x12\x17\n\x0fresult_per_page\x18\x05 \x01(\x05\x12\x12\n\x06reload\x18\r \x01(\x08\x42\x02\x18\x01\x12\x17\n\x0fwith_duplicates\x18\x0e \x01(\x08\x12\x12\n\nvector_set\x18\x0f \x01(\t\x12\x13\n\x0bkey_filters\x18\x10 \x03(\t\x12\x11\n\tmin_score\x18\x11 \x01(\x02\x12\x15\n\rfield_filters\x18\x13 \x03(\t\"&\n\x18\x44ocumentVectorIdentifier\x12\n\n\x02id\x18\x01 \x01(\t\"\x98\x01\n\x0e\x44ocumentScored\x12\x34\n\x06\x64oc_id\x18\x01 \x01(\x0b\x32$.nodereader.DocumentVectorIdentifier\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x31\n\x08metadata\x18\x03 \x01(\x0b\x32\x1f.noderesources.SentenceMetadata\x12\x0e\n\x06labels\x18\x04 \x03(\t\"s\n\x14VectorSearchResponse\x12-\n\tdocuments\x18\x01 \x03(\x0b\x32\x1a.nodereader.DocumentScored\x12\x13\n\x0bpage_number\x18\x04 \x01(\x05\x12\x17\n\x0fresult_per_page\x18\x05 \x01(\x05\"q\n\x12RelationNodeFilter\x12/\n\tnode_type\x18\x01 \x01(\x0e\x32\x1c.utils.RelationNode.NodeType\x12\x19\n\x0cnode_subtype\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0f\n\r_node_subtype\"\x95\x01\n\x12RelationEdgeFilter\x12\x33\n\rrelation_type\x18\x01 \x01(\x0e\x32\x1c.utils.Relation.RelationType\x12\x1d\n\x10relation_subtype\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x16\n\x0erelation_value\x18\x03 \x03(\tB\x13\n\x11_relation_subtype\"c\n\x1bRelationPrefixSearchRequest\x12\x0e\n\x06prefix\x18\x01 \x01(\t\x12\x34\n\x0cnode_filters\x18\x02 \x03(\x0b\x32\x1e.nodereader.RelationNodeFilter\"B\n\x1cRelationPrefixSearchResponse\x12\"\n\x05nodes\x18\x01 \x03(\x0b\x32\x13.utils.RelationNode\"\x87\x02\n\x17\x45ntitiesSubgraphRequest\x12)\n\x0c\x65ntry_points\x18\x01 \x03(\x0b\x32\x13.utils.RelationNode\x12\x12\n\x05\x64\x65pth\x18\x03 \x01(\x05H\x00\x88\x01\x01\x12M\n\x10\x64\x65leted_entities\x18\x04 \x03(\x0b\x32\x33.nodereader.EntitiesSubgraphRequest.DeletedEntities\x12\x16\n\x0e\x64\x65leted_groups\x18\x05 \x03(\t\x1a<\n\x0f\x44\x65letedEntities\x12\x14\n\x0cnode_subtype\x18\x01 \x01(\t\x12\x13\n\x0bnode_values\x18\x02 \x03(\tB\x08\n\x06_depth\">\n\x18\x45ntitiesSubgraphResponse\x12\"\n\trelations\x18\x01 \x03(\x0b\x32\x0f.utils.Relation\"\xad\x01\n\x15RelationSearchRequest\x12\x10\n\x08shard_id\x18\x01 \x01(\t\x12\x12\n\x06reload\x18\x05 \x01(\x08\x42\x02\x18\x01\x12\x37\n\x06prefix\x18\x0b \x01(\x0b\x32\'.nodereader.RelationPrefixSearchRequest\x12\x35\n\x08subgraph\x18\x0c \x01(\x0b\x32#.nodereader.EntitiesSubgraphRequest\"\x8a\x01\n\x16RelationSearchResponse\x12\x38\n\x06prefix\x18\x0b \x01(\x0b\x32(.nodereader.RelationPrefixSearchResponse\x12\x36\n\x08subgraph\x18\x0c \x01(\x0b\x32$.nodereader.EntitiesSubgraphResponse\"\xcb\x06\n\rSearchRequest\x12\r\n\x05shard\x18\x01 \x01(\t\x12\x0e\n\x06\x66ields\x18\x02 \x03(\t\x12\x0c\n\x04\x62ody\x18\x03 \x01(\t\x12\"\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x12.nodereader.Filter\x12\"\n\x05order\x18\x05 \x01(\x0b\x32\x13.nodereader.OrderBy\x12$\n\x07\x66\x61\x63\x65ted\x18\x06 \x01(\x0b\x32\x13.nodereader.Faceted\x12\x13\n\x0bpage_number\x18\x07 \x01(\x05\x12\x17\n\x0fresult_per_page\x18\x08 \x01(\x05\x12*\n\ntimestamps\x18\t \x01(\x0b\x32\x16.nodereader.Timestamps\x12\x0e\n\x06vector\x18\n \x03(\x02\x12\x11\n\tvectorset\x18\x0f \x01(\t\x12\x12\n\x06reload\x18\x0b \x01(\x08\x42\x02\x18\x01\x12\x11\n\tparagraph\x18\x0c \x01(\x08\x12\x10\n\x08\x64ocument\x18\r \x01(\x08\x12\x17\n\x0fwith_duplicates\x18\x0e \x01(\x08\x12\x14\n\x0conly_faceted\x18\x10 \x01(\x08\x12\x1b\n\x0e\x61\x64vanced_query\x18\x12 \x01(\tH\x00\x88\x01\x01\x12@\n\x0bwith_status\x18\x11 \x01(\x0e\x32&.noderesources.Resource.ResourceStatusH\x01\x88\x01\x01\x12\x38\n\trelations\x18\x13 \x01(\x0b\x32!.nodereader.RelationSearchRequestB\x02\x18\x01\x12@\n\x0frelation_prefix\x18\x14 \x01(\x0b\x32\'.nodereader.RelationPrefixSearchRequest\x12>\n\x11relation_subgraph\x18\x15 \x01(\x0b\x32#.nodereader.EntitiesSubgraphRequest\x12\x13\n\x0bkey_filters\x18\x16 \x03(\t\x12\x1a\n\x12min_score_semantic\x18\x17 \x01(\x02\x12\x16\n\x0emin_score_bm25\x18\x19 \x01(\x02\x12&\n\x08security\x18\x18 \x01(\x0b\x32\x0f.utils.SecurityH\x02\x88\x01\x01\x42\x11\n\x0f_advanced_queryB\x0e\n\x0c_with_statusB\x0b\n\t_security\"\xd1\x01\n\x0eSuggestRequest\x12\r\n\x05shard\x18\x01 \x01(\t\x12\x0c\n\x04\x62ody\x18\x02 \x01(\t\x12-\n\x08\x66\x65\x61tures\x18\x06 \x03(\x0e\x32\x1b.nodereader.SuggestFeatures\x12\"\n\x06\x66ilter\x18\x03 \x01(\x0b\x32\x12.nodereader.Filter\x12*\n\ntimestamps\x18\x04 \x01(\x0b\x32\x16.nodereader.Timestamps\x12\x0e\n\x06\x66ields\x18\x05 \x03(\t\x12\x13\n\x0bkey_filters\x18\x07 \x03(\t\"2\n\x0fRelatedEntities\x12\x10\n\x08\x65ntities\x18\x01 \x03(\t\x12\r\n\x05total\x18\x02 \x01(\r\"\xb1\x01\n\x0fSuggestResponse\x12\r\n\x05total\x18\x01 \x01(\x05\x12,\n\x07results\x18\x02 \x03(\x0b\x32\x1b.nodereader.ParagraphResult\x12\r\n\x05query\x18\x03 \x01(\t\x12\x10\n\x08\x65matches\x18\x04 \x03(\t\x12@\n\x0e\x65ntity_results\x18\x06 \x01(\x0b\x32(.nodereader.RelationPrefixSearchResponse\"\xe6\x01\n\x0eSearchResponse\x12\x34\n\x08\x64ocument\x18\x01 \x01(\x0b\x32\".nodereader.DocumentSearchResponse\x12\x36\n\tparagraph\x18\x02 \x01(\x0b\x32#.nodereader.ParagraphSearchResponse\x12\x30\n\x06vector\x18\x03 \x01(\x0b\x32 .nodereader.VectorSearchResponse\x12\x34\n\x08relation\x18\x04 \x01(\x0b\x32\".nodereader.RelationSearchResponse\"\x1b\n\x0cIdCollection\x12\x0b\n\x03ids\x18\x01 \x03(\t\"Q\n\x0cRelationEdge\x12/\n\tedge_type\x18\x01 \x01(\x0e\x32\x1c.utils.Relation.RelationType\x12\x10\n\x08property\x18\x02 \x01(\t\"2\n\x08\x45\x64geList\x12&\n\x04list\x18\x01 \x03(\x0b\x32\x18.nodereader.RelationEdge\"N\n\x0fGetShardRequest\x12(\n\x08shard_id\x18\x01 \x01(\x0b\x32\x16.noderesources.ShardId\x12\x11\n\tvectorset\x18\x02 \x01(\t\"+\n\rParagraphItem\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06labels\x18\x02 \x03(\t\";\n\x0c\x44ocumentItem\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\r\n\x05\x66ield\x18\x02 \x01(\t\x12\x0e\n\x06labels\x18\x03 \x03(\t\"\xab\x01\n\rStreamRequest\x12\x32\n\x12\x66ilter__deprecated\x18\x01 \x01(\x0b\x32\x12.nodereader.FilterB\x02\x18\x01\x12\x12\n\x06reload\x18\x02 \x01(\x08\x42\x02\x18\x01\x12(\n\x08shard_id\x18\x03 \x01(\x0b\x32\x16.noderesources.ShardId\x12(\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x18.nodereader.StreamFilter\"(\n\x14GetShardFilesRequest\x12\x10\n\x08shard_id\x18\x01 \x01(\t\"5\n\rShardFileList\x12$\n\x05\x66iles\x18\x02 \x03(\x0b\x32\x15.nodereader.ShardFile\"0\n\tShardFile\x12\x15\n\rrelative_path\x18\x01 \x01(\t\x12\x0c\n\x04size\x18\x02 \x01(\x04\"C\n\x18\x44ownloadShardFileRequest\x12\x10\n\x08shard_id\x18\x01 \x01(\t\x12\x15\n\rrelative_path\x18\x02 \x01(\t\"-\n\x0eShardFileChunk\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\r\n\x05index\x18\x02 \x01(\x05*/\n\x0fSuggestFeatures\x12\x0c\n\x08\x45NTITIES\x10\x00\x12\x0e\n\nPARAGRAPHS\x10\x01\x32\xc8\t\n\nNodeReader\x12?\n\x08GetShard\x12\x1b.nodereader.GetShardRequest\x1a\x14.noderesources.Shard\"\x00\x12Y\n\x0e\x44ocumentSearch\x12!.nodereader.DocumentSearchRequest\x1a\".nodereader.DocumentSearchResponse\"\x00\x12\\\n\x0fParagraphSearch\x12\".nodereader.ParagraphSearchRequest\x1a#.nodereader.ParagraphSearchResponse\"\x00\x12S\n\x0cVectorSearch\x12\x1f.nodereader.VectorSearchRequest\x1a .nodereader.VectorSearchResponse\"\x00\x12Y\n\x0eRelationSearch\x12!.nodereader.RelationSearchRequest\x1a\".nodereader.RelationSearchResponse\"\x00\x12\x41\n\x0b\x44ocumentIds\x12\x16.noderesources.ShardId\x1a\x18.nodereader.IdCollection\"\x00\x12\x42\n\x0cParagraphIds\x12\x16.noderesources.ShardId\x1a\x18.nodereader.IdCollection\"\x00\x12\x43\n\tVectorIds\x12\x1a.noderesources.VectorSetID\x1a\x18.nodereader.IdCollection\"\x00\x12\x41\n\x0bRelationIds\x12\x16.noderesources.ShardId\x1a\x18.nodereader.IdCollection\"\x00\x12?\n\rRelationEdges\x12\x16.noderesources.ShardId\x1a\x14.nodereader.EdgeList\"\x00\x12\x41\n\x06Search\x12\x19.nodereader.SearchRequest\x1a\x1a.nodereader.SearchResponse\"\x00\x12\x44\n\x07Suggest\x12\x1a.nodereader.SuggestRequest\x1a\x1b.nodereader.SuggestResponse\"\x00\x12\x46\n\nParagraphs\x12\x19.nodereader.StreamRequest\x1a\x19.nodereader.ParagraphItem\"\x00\x30\x01\x12\x44\n\tDocuments\x12\x19.nodereader.StreamRequest\x1a\x18.nodereader.DocumentItem\"\x00\x30\x01\x12N\n\rGetShardFiles\x12 .nodereader.GetShardFilesRequest\x1a\x19.nodereader.ShardFileList\"\x00\x12Y\n\x11\x44ownloadShardFile\x12$.nodereader.DownloadShardFileRequest\x1a\x1a.nodereader.ShardFileChunk\"\x00\x30\x01P\x00P\x02\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n nucliadb_protos/nodereader.proto\x12\nnodereader\x1a#nucliadb_protos/noderesources.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1bnucliadb_protos/utils.proto\"p\n\x06\x46ilter\x12\x14\n\x0c\x66ield_labels\x18\x01 \x03(\t\x12\x18\n\x10paragraph_labels\x18\x02 \x03(\t\x12\x19\n\x11labels_expression\x18\x03 \x01(\t\x12\x1b\n\x13keywords_expression\x18\x04 \x01(\t\"\x82\x01\n\x0cStreamFilter\x12\x39\n\x0b\x63onjunction\x18\x01 \x01(\x0e\x32$.nodereader.StreamFilter.Conjunction\x12\x0e\n\x06labels\x18\x02 \x03(\t\"\'\n\x0b\x43onjunction\x12\x07\n\x03\x41ND\x10\x00\x12\x06\n\x02OR\x10\x01\x12\x07\n\x03NOT\x10\x02\"\x19\n\x07\x46\x61\x63\x65ted\x12\x0e\n\x06labels\x18\x01 \x03(\t\"\xc3\x01\n\x07OrderBy\x12\x11\n\x05\x66ield\x18\x01 \x01(\tB\x02\x18\x01\x12+\n\x04type\x18\x02 \x01(\x0e\x32\x1d.nodereader.OrderBy.OrderType\x12/\n\x07sort_by\x18\x03 \x01(\x0e\x32\x1e.nodereader.OrderBy.OrderField\"\x1e\n\tOrderType\x12\x08\n\x04\x44\x45SC\x10\x00\x12\x07\n\x03\x41SC\x10\x01\"\'\n\nOrderField\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0c\n\x08MODIFIED\x10\x01\"\xd2\x01\n\nTimestamps\x12\x31\n\rfrom_modified\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bto_modified\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x0c\x66rom_created\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nto_created\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\")\n\x0b\x46\x61\x63\x65tResult\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\r\n\x05total\x18\x02 \x01(\x05\"=\n\x0c\x46\x61\x63\x65tResults\x12-\n\x0c\x66\x61\x63\x65tresults\x18\x01 \x03(\x0b\x32\x17.nodereader.FacetResult\"\xc8\x03\n\x15\x44ocumentSearchRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04\x62ody\x18\x02 \x01(\t\x12\x0e\n\x06\x66ields\x18\x03 \x03(\t\x12\"\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x12.nodereader.Filter\x12\"\n\x05order\x18\x05 \x01(\x0b\x32\x13.nodereader.OrderBy\x12$\n\x07\x66\x61\x63\x65ted\x18\x06 \x01(\x0b\x32\x13.nodereader.Faceted\x12\x13\n\x0bpage_number\x18\x07 \x01(\x05\x12\x17\n\x0fresult_per_page\x18\x08 \x01(\x05\x12*\n\ntimestamps\x18\t \x01(\x0b\x32\x16.nodereader.Timestamps\x12\x12\n\x06reload\x18\n \x01(\x08\x42\x02\x18\x01\x12\x14\n\x0conly_faceted\x18\x0f \x01(\x08\x12@\n\x0bwith_status\x18\x10 \x01(\x0e\x32&.noderesources.Resource.ResourceStatusH\x00\x88\x01\x01\x12\x1b\n\x0e\x61\x64vanced_query\x18\x11 \x01(\tH\x01\x88\x01\x01\x12\x11\n\tmin_score\x18\x12 \x01(\x02\x42\x0e\n\x0c_with_statusB\x11\n\x0f_advanced_query\"\xe8\x03\n\x16ParagraphSearchRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04uuid\x18\x02 \x01(\t\x12\x0e\n\x06\x66ields\x18\x03 \x03(\t\x12\x0c\n\x04\x62ody\x18\x04 \x01(\t\x12\"\n\x06\x66ilter\x18\x05 \x01(\x0b\x32\x12.nodereader.Filter\x12\"\n\x05order\x18\x07 \x01(\x0b\x32\x13.nodereader.OrderBy\x12$\n\x07\x66\x61\x63\x65ted\x18\x08 \x01(\x0b\x32\x13.nodereader.Faceted\x12\x13\n\x0bpage_number\x18\n \x01(\x05\x12\x17\n\x0fresult_per_page\x18\x0b \x01(\x05\x12*\n\ntimestamps\x18\x0c \x01(\x0b\x32\x16.nodereader.Timestamps\x12\x12\n\x06reload\x18\r \x01(\x08\x42\x02\x18\x01\x12\x17\n\x0fwith_duplicates\x18\x0e \x01(\x08\x12\x14\n\x0conly_faceted\x18\x0f \x01(\x08\x12\x1b\n\x0e\x61\x64vanced_query\x18\x10 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x0bkey_filters\x18\x11 \x03(\t\x12\x11\n\tmin_score\x18\x12 \x01(\x02\x12&\n\x08security\x18\x13 \x01(\x0b\x32\x0f.utils.SecurityH\x01\x88\x01\x01\x42\x11\n\x0f_advanced_queryB\x0b\n\t_security\",\n\x0bResultScore\x12\x0c\n\x04\x62m25\x18\x01 \x01(\x02\x12\x0f\n\x07\x62ooster\x18\x02 \x01(\x02\"e\n\x0e\x44ocumentResult\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12&\n\x05score\x18\x03 \x01(\x0b\x32\x17.nodereader.ResultScore\x12\r\n\x05\x66ield\x18\x04 \x01(\t\x12\x0e\n\x06labels\x18\x05 \x03(\t\"\xbb\x02\n\x16\x44ocumentSearchResponse\x12\r\n\x05total\x18\x01 \x01(\x05\x12+\n\x07results\x18\x02 \x03(\x0b\x32\x1a.nodereader.DocumentResult\x12>\n\x06\x66\x61\x63\x65ts\x18\x03 \x03(\x0b\x32..nodereader.DocumentSearchResponse.FacetsEntry\x12\x13\n\x0bpage_number\x18\x04 \x01(\x05\x12\x17\n\x0fresult_per_page\x18\x05 \x01(\x05\x12\r\n\x05query\x18\x06 \x01(\t\x12\x11\n\tnext_page\x18\x07 \x01(\x08\x12\x0c\n\x04\x62m25\x18\x08 \x01(\x08\x1aG\n\x0b\x46\x61\x63\x65tsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.nodereader.FacetResults:\x02\x38\x01\"\xf8\x01\n\x0fParagraphResult\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\r\n\x05\x66ield\x18\x03 \x01(\t\x12\r\n\x05start\x18\x04 \x01(\x04\x12\x0b\n\x03\x65nd\x18\x05 \x01(\x04\x12\x11\n\tparagraph\x18\x06 \x01(\t\x12\r\n\x05split\x18\x07 \x01(\t\x12\r\n\x05index\x18\x08 \x01(\x04\x12&\n\x05score\x18\t \x01(\x0b\x32\x17.nodereader.ResultScore\x12\x0f\n\x07matches\x18\n \x03(\t\x12\x32\n\x08metadata\x18\x0b \x01(\x0b\x32 .noderesources.ParagraphMetadata\x12\x0e\n\x06labels\x18\x0c \x03(\t\"\xe8\x02\n\x17ParagraphSearchResponse\x12\x16\n\x0e\x66uzzy_distance\x18\n \x01(\x05\x12\r\n\x05total\x18\x01 \x01(\x05\x12,\n\x07results\x18\x02 \x03(\x0b\x32\x1b.nodereader.ParagraphResult\x12?\n\x06\x66\x61\x63\x65ts\x18\x03 \x03(\x0b\x32/.nodereader.ParagraphSearchResponse.FacetsEntry\x12\x13\n\x0bpage_number\x18\x04 \x01(\x05\x12\x17\n\x0fresult_per_page\x18\x05 \x01(\x05\x12\r\n\x05query\x18\x06 \x01(\t\x12\x11\n\tnext_page\x18\x07 \x01(\x08\x12\x0c\n\x04\x62m25\x18\x08 \x01(\x08\x12\x10\n\x08\x65matches\x18\t \x03(\t\x1aG\n\x0b\x46\x61\x63\x65tsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.nodereader.FacetResults:\x02\x38\x01\"\x8f\x02\n\x13VectorSearchRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06vector\x18\x02 \x03(\x02\x12\x14\n\x0c\x66ield_labels\x18\x03 \x03(\t\x12\x18\n\x10paragraph_labels\x18\x12 \x03(\t\x12\x13\n\x0bpage_number\x18\x04 \x01(\x05\x12\x17\n\x0fresult_per_page\x18\x05 \x01(\x05\x12\x12\n\x06reload\x18\r \x01(\x08\x42\x02\x18\x01\x12\x17\n\x0fwith_duplicates\x18\x0e \x01(\x08\x12\x12\n\nvector_set\x18\x0f \x01(\t\x12\x13\n\x0bkey_filters\x18\x10 \x03(\t\x12\x11\n\tmin_score\x18\x11 \x01(\x02\x12\x15\n\rfield_filters\x18\x13 \x03(\t\"&\n\x18\x44ocumentVectorIdentifier\x12\n\n\x02id\x18\x01 \x01(\t\"\x98\x01\n\x0e\x44ocumentScored\x12\x34\n\x06\x64oc_id\x18\x01 \x01(\x0b\x32$.nodereader.DocumentVectorIdentifier\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x31\n\x08metadata\x18\x03 \x01(\x0b\x32\x1f.noderesources.SentenceMetadata\x12\x0e\n\x06labels\x18\x04 \x03(\t\"s\n\x14VectorSearchResponse\x12-\n\tdocuments\x18\x01 \x03(\x0b\x32\x1a.nodereader.DocumentScored\x12\x13\n\x0bpage_number\x18\x04 \x01(\x05\x12\x17\n\x0fresult_per_page\x18\x05 \x01(\x05\"q\n\x12RelationNodeFilter\x12/\n\tnode_type\x18\x01 \x01(\x0e\x32\x1c.utils.RelationNode.NodeType\x12\x19\n\x0cnode_subtype\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0f\n\r_node_subtype\"\x95\x01\n\x12RelationEdgeFilter\x12\x33\n\rrelation_type\x18\x01 \x01(\x0e\x32\x1c.utils.Relation.RelationType\x12\x1d\n\x10relation_subtype\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x16\n\x0erelation_value\x18\x03 \x03(\tB\x13\n\x11_relation_subtype\"c\n\x1bRelationPrefixSearchRequest\x12\x0e\n\x06prefix\x18\x01 \x01(\t\x12\x34\n\x0cnode_filters\x18\x02 \x03(\x0b\x32\x1e.nodereader.RelationNodeFilter\"B\n\x1cRelationPrefixSearchResponse\x12\"\n\x05nodes\x18\x01 \x03(\x0b\x32\x13.utils.RelationNode\"\x87\x02\n\x17\x45ntitiesSubgraphRequest\x12)\n\x0c\x65ntry_points\x18\x01 \x03(\x0b\x32\x13.utils.RelationNode\x12\x12\n\x05\x64\x65pth\x18\x03 \x01(\x05H\x00\x88\x01\x01\x12M\n\x10\x64\x65leted_entities\x18\x04 \x03(\x0b\x32\x33.nodereader.EntitiesSubgraphRequest.DeletedEntities\x12\x16\n\x0e\x64\x65leted_groups\x18\x05 \x03(\t\x1a<\n\x0f\x44\x65letedEntities\x12\x14\n\x0cnode_subtype\x18\x01 \x01(\t\x12\x13\n\x0bnode_values\x18\x02 \x03(\tB\x08\n\x06_depth\">\n\x18\x45ntitiesSubgraphResponse\x12\"\n\trelations\x18\x01 \x03(\x0b\x32\x0f.utils.Relation\"\xad\x01\n\x15RelationSearchRequest\x12\x10\n\x08shard_id\x18\x01 \x01(\t\x12\x12\n\x06reload\x18\x05 \x01(\x08\x42\x02\x18\x01\x12\x37\n\x06prefix\x18\x0b \x01(\x0b\x32\'.nodereader.RelationPrefixSearchRequest\x12\x35\n\x08subgraph\x18\x0c \x01(\x0b\x32#.nodereader.EntitiesSubgraphRequest\"\x8a\x01\n\x16RelationSearchResponse\x12\x38\n\x06prefix\x18\x0b \x01(\x0b\x32(.nodereader.RelationPrefixSearchResponse\x12\x36\n\x08subgraph\x18\x0c \x01(\x0b\x32$.nodereader.EntitiesSubgraphResponse\"\xcb\x06\n\rSearchRequest\x12\r\n\x05shard\x18\x01 \x01(\t\x12\x0e\n\x06\x66ields\x18\x02 \x03(\t\x12\x0c\n\x04\x62ody\x18\x03 \x01(\t\x12\"\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x12.nodereader.Filter\x12\"\n\x05order\x18\x05 \x01(\x0b\x32\x13.nodereader.OrderBy\x12$\n\x07\x66\x61\x63\x65ted\x18\x06 \x01(\x0b\x32\x13.nodereader.Faceted\x12\x13\n\x0bpage_number\x18\x07 \x01(\x05\x12\x17\n\x0fresult_per_page\x18\x08 \x01(\x05\x12*\n\ntimestamps\x18\t \x01(\x0b\x32\x16.nodereader.Timestamps\x12\x0e\n\x06vector\x18\n \x03(\x02\x12\x11\n\tvectorset\x18\x0f \x01(\t\x12\x12\n\x06reload\x18\x0b \x01(\x08\x42\x02\x18\x01\x12\x11\n\tparagraph\x18\x0c \x01(\x08\x12\x10\n\x08\x64ocument\x18\r \x01(\x08\x12\x17\n\x0fwith_duplicates\x18\x0e \x01(\x08\x12\x14\n\x0conly_faceted\x18\x10 \x01(\x08\x12\x1b\n\x0e\x61\x64vanced_query\x18\x12 \x01(\tH\x00\x88\x01\x01\x12@\n\x0bwith_status\x18\x11 \x01(\x0e\x32&.noderesources.Resource.ResourceStatusH\x01\x88\x01\x01\x12\x38\n\trelations\x18\x13 \x01(\x0b\x32!.nodereader.RelationSearchRequestB\x02\x18\x01\x12@\n\x0frelation_prefix\x18\x14 \x01(\x0b\x32\'.nodereader.RelationPrefixSearchRequest\x12>\n\x11relation_subgraph\x18\x15 \x01(\x0b\x32#.nodereader.EntitiesSubgraphRequest\x12\x13\n\x0bkey_filters\x18\x16 \x03(\t\x12\x1a\n\x12min_score_semantic\x18\x17 \x01(\x02\x12\x16\n\x0emin_score_bm25\x18\x19 \x01(\x02\x12&\n\x08security\x18\x18 \x01(\x0b\x32\x0f.utils.SecurityH\x02\x88\x01\x01\x42\x11\n\x0f_advanced_queryB\x0e\n\x0c_with_statusB\x0b\n\t_security\"\xd1\x01\n\x0eSuggestRequest\x12\r\n\x05shard\x18\x01 \x01(\t\x12\x0c\n\x04\x62ody\x18\x02 \x01(\t\x12-\n\x08\x66\x65\x61tures\x18\x06 \x03(\x0e\x32\x1b.nodereader.SuggestFeatures\x12\"\n\x06\x66ilter\x18\x03 \x01(\x0b\x32\x12.nodereader.Filter\x12*\n\ntimestamps\x18\x04 \x01(\x0b\x32\x16.nodereader.Timestamps\x12\x0e\n\x06\x66ields\x18\x05 \x03(\t\x12\x13\n\x0bkey_filters\x18\x07 \x03(\t\"2\n\x0fRelatedEntities\x12\x10\n\x08\x65ntities\x18\x01 \x03(\t\x12\r\n\x05total\x18\x02 \x01(\r\"\xb1\x01\n\x0fSuggestResponse\x12\r\n\x05total\x18\x01 \x01(\x05\x12,\n\x07results\x18\x02 \x03(\x0b\x32\x1b.nodereader.ParagraphResult\x12\r\n\x05query\x18\x03 \x01(\t\x12\x10\n\x08\x65matches\x18\x04 \x03(\t\x12@\n\x0e\x65ntity_results\x18\x06 \x01(\x0b\x32(.nodereader.RelationPrefixSearchResponse\"\xe6\x01\n\x0eSearchResponse\x12\x34\n\x08\x64ocument\x18\x01 \x01(\x0b\x32\".nodereader.DocumentSearchResponse\x12\x36\n\tparagraph\x18\x02 \x01(\x0b\x32#.nodereader.ParagraphSearchResponse\x12\x30\n\x06vector\x18\x03 \x01(\x0b\x32 .nodereader.VectorSearchResponse\x12\x34\n\x08relation\x18\x04 \x01(\x0b\x32\".nodereader.RelationSearchResponse\"\x1b\n\x0cIdCollection\x12\x0b\n\x03ids\x18\x01 \x03(\t\"Q\n\x0cRelationEdge\x12/\n\tedge_type\x18\x01 \x01(\x0e\x32\x1c.utils.Relation.RelationType\x12\x10\n\x08property\x18\x02 \x01(\t\"2\n\x08\x45\x64geList\x12&\n\x04list\x18\x01 \x03(\x0b\x32\x18.nodereader.RelationEdge\"N\n\x0fGetShardRequest\x12(\n\x08shard_id\x18\x01 \x01(\x0b\x32\x16.noderesources.ShardId\x12\x11\n\tvectorset\x18\x02 \x01(\t\"+\n\rParagraphItem\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06labels\x18\x02 \x03(\t\";\n\x0c\x44ocumentItem\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\r\n\x05\x66ield\x18\x02 \x01(\t\x12\x0e\n\x06labels\x18\x03 \x03(\t\"\xab\x01\n\rStreamRequest\x12\x32\n\x12\x66ilter__deprecated\x18\x01 \x01(\x0b\x32\x12.nodereader.FilterB\x02\x18\x01\x12\x12\n\x06reload\x18\x02 \x01(\x08\x42\x02\x18\x01\x12(\n\x08shard_id\x18\x03 \x01(\x0b\x32\x16.noderesources.ShardId\x12(\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x18.nodereader.StreamFilter\"(\n\x14GetShardFilesRequest\x12\x10\n\x08shard_id\x18\x01 \x01(\t\"5\n\rShardFileList\x12$\n\x05\x66iles\x18\x02 \x03(\x0b\x32\x15.nodereader.ShardFile\"0\n\tShardFile\x12\x15\n\rrelative_path\x18\x01 \x01(\t\x12\x0c\n\x04size\x18\x02 \x01(\x04\"C\n\x18\x44ownloadShardFileRequest\x12\x10\n\x08shard_id\x18\x01 \x01(\t\x12\x15\n\rrelative_path\x18\x02 \x01(\t\"-\n\x0eShardFileChunk\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\r\n\x05index\x18\x02 \x01(\x05*/\n\x0fSuggestFeatures\x12\x0c\n\x08\x45NTITIES\x10\x00\x12\x0e\n\nPARAGRAPHS\x10\x01\x32\xdf\x06\n\nNodeReader\x12?\n\x08GetShard\x12\x1b.nodereader.GetShardRequest\x1a\x14.noderesources.Shard\"\x00\x12\x41\n\x0b\x44ocumentIds\x12\x16.noderesources.ShardId\x1a\x18.nodereader.IdCollection\"\x00\x12\x42\n\x0cParagraphIds\x12\x16.noderesources.ShardId\x1a\x18.nodereader.IdCollection\"\x00\x12\x43\n\tVectorIds\x12\x1a.noderesources.VectorSetID\x1a\x18.nodereader.IdCollection\"\x00\x12\x41\n\x0bRelationIds\x12\x16.noderesources.ShardId\x1a\x18.nodereader.IdCollection\"\x00\x12?\n\rRelationEdges\x12\x16.noderesources.ShardId\x1a\x14.nodereader.EdgeList\"\x00\x12\x41\n\x06Search\x12\x19.nodereader.SearchRequest\x1a\x1a.nodereader.SearchResponse\"\x00\x12\x44\n\x07Suggest\x12\x1a.nodereader.SuggestRequest\x1a\x1b.nodereader.SuggestResponse\"\x00\x12\x46\n\nParagraphs\x12\x19.nodereader.StreamRequest\x1a\x19.nodereader.ParagraphItem\"\x00\x30\x01\x12\x44\n\tDocuments\x12\x19.nodereader.StreamRequest\x1a\x18.nodereader.DocumentItem\"\x00\x30\x01\x12N\n\rGetShardFiles\x12 .nodereader.GetShardFilesRequest\x1a\x19.nodereader.ShardFileList\"\x00\x12Y\n\x11\x44ownloadShardFile\x12$.nodereader.DownloadShardFileRequest\x1a\x1a.nodereader.ShardFileChunk\"\x00\x30\x01P\x00P\x02\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -153,5 +153,5 @@ _globals['_SHARDFILECHUNK']._serialized_start=6901 _globals['_SHARDFILECHUNK']._serialized_end=6946 _globals['_NODEREADER']._serialized_start=6998 - _globals['_NODEREADER']._serialized_end=8222 + _globals['_NODEREADER']._serialized_end=7861 # @@protoc_insertion_point(module_scope) diff --git a/nucliadb_protos/python/src/nucliadb_protos/nodereader_pb2_grpc.py b/nucliadb_protos/python/src/nucliadb_protos/nodereader_pb2_grpc.py index 5998e224bd..ca43ffa3b5 100644 --- a/nucliadb_protos/python/src/nucliadb_protos/nodereader_pb2_grpc.py +++ b/nucliadb_protos/python/src/nucliadb_protos/nodereader_pb2_grpc.py @@ -22,26 +22,6 @@ def __init__(self, channel): request_serializer=nucliadb__protos_dot_nodereader__pb2.GetShardRequest.SerializeToString, response_deserializer=nucliadb__protos_dot_noderesources__pb2.Shard.FromString, ) - self.DocumentSearch = channel.unary_unary( - '/nodereader.NodeReader/DocumentSearch', - request_serializer=nucliadb__protos_dot_nodereader__pb2.DocumentSearchRequest.SerializeToString, - response_deserializer=nucliadb__protos_dot_nodereader__pb2.DocumentSearchResponse.FromString, - ) - self.ParagraphSearch = channel.unary_unary( - '/nodereader.NodeReader/ParagraphSearch', - request_serializer=nucliadb__protos_dot_nodereader__pb2.ParagraphSearchRequest.SerializeToString, - response_deserializer=nucliadb__protos_dot_nodereader__pb2.ParagraphSearchResponse.FromString, - ) - self.VectorSearch = channel.unary_unary( - '/nodereader.NodeReader/VectorSearch', - request_serializer=nucliadb__protos_dot_nodereader__pb2.VectorSearchRequest.SerializeToString, - response_deserializer=nucliadb__protos_dot_nodereader__pb2.VectorSearchResponse.FromString, - ) - self.RelationSearch = channel.unary_unary( - '/nodereader.NodeReader/RelationSearch', - request_serializer=nucliadb__protos_dot_nodereader__pb2.RelationSearchRequest.SerializeToString, - response_deserializer=nucliadb__protos_dot_nodereader__pb2.RelationSearchResponse.FromString, - ) self.DocumentIds = channel.unary_unary( '/nodereader.NodeReader/DocumentIds', request_serializer=nucliadb__protos_dot_noderesources__pb2.ShardId.SerializeToString, @@ -110,30 +90,6 @@ def GetShard(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def DocumentSearch(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ParagraphSearch(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def VectorSearch(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def RelationSearch(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - def DocumentIds(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -210,26 +166,6 @@ def add_NodeReaderServicer_to_server(servicer, server): request_deserializer=nucliadb__protos_dot_nodereader__pb2.GetShardRequest.FromString, response_serializer=nucliadb__protos_dot_noderesources__pb2.Shard.SerializeToString, ), - 'DocumentSearch': grpc.unary_unary_rpc_method_handler( - servicer.DocumentSearch, - request_deserializer=nucliadb__protos_dot_nodereader__pb2.DocumentSearchRequest.FromString, - response_serializer=nucliadb__protos_dot_nodereader__pb2.DocumentSearchResponse.SerializeToString, - ), - 'ParagraphSearch': grpc.unary_unary_rpc_method_handler( - servicer.ParagraphSearch, - request_deserializer=nucliadb__protos_dot_nodereader__pb2.ParagraphSearchRequest.FromString, - response_serializer=nucliadb__protos_dot_nodereader__pb2.ParagraphSearchResponse.SerializeToString, - ), - 'VectorSearch': grpc.unary_unary_rpc_method_handler( - servicer.VectorSearch, - request_deserializer=nucliadb__protos_dot_nodereader__pb2.VectorSearchRequest.FromString, - response_serializer=nucliadb__protos_dot_nodereader__pb2.VectorSearchResponse.SerializeToString, - ), - 'RelationSearch': grpc.unary_unary_rpc_method_handler( - servicer.RelationSearch, - request_deserializer=nucliadb__protos_dot_nodereader__pb2.RelationSearchRequest.FromString, - response_serializer=nucliadb__protos_dot_nodereader__pb2.RelationSearchResponse.SerializeToString, - ), 'DocumentIds': grpc.unary_unary_rpc_method_handler( servicer.DocumentIds, request_deserializer=nucliadb__protos_dot_noderesources__pb2.ShardId.FromString, @@ -314,74 +250,6 @@ def GetShard(request, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - @staticmethod - def DocumentSearch(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/nodereader.NodeReader/DocumentSearch', - nucliadb__protos_dot_nodereader__pb2.DocumentSearchRequest.SerializeToString, - nucliadb__protos_dot_nodereader__pb2.DocumentSearchResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ParagraphSearch(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/nodereader.NodeReader/ParagraphSearch', - nucliadb__protos_dot_nodereader__pb2.ParagraphSearchRequest.SerializeToString, - nucliadb__protos_dot_nodereader__pb2.ParagraphSearchResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def VectorSearch(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/nodereader.NodeReader/VectorSearch', - nucliadb__protos_dot_nodereader__pb2.VectorSearchRequest.SerializeToString, - nucliadb__protos_dot_nodereader__pb2.VectorSearchResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def RelationSearch(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/nodereader.NodeReader/RelationSearch', - nucliadb__protos_dot_nodereader__pb2.RelationSearchRequest.SerializeToString, - nucliadb__protos_dot_nodereader__pb2.RelationSearchResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - @staticmethod def DocumentIds(request, target, diff --git a/nucliadb_protos/python/src/nucliadb_protos/nodereader_pb2_grpc.pyi b/nucliadb_protos/python/src/nucliadb_protos/nodereader_pb2_grpc.pyi index 51b77a7bb5..dd964ffeaf 100644 --- a/nucliadb_protos/python/src/nucliadb_protos/nodereader_pb2_grpc.pyi +++ b/nucliadb_protos/python/src/nucliadb_protos/nodereader_pb2_grpc.pyi @@ -71,26 +71,6 @@ class NodeReaderStub: nucliadb_protos.noderesources_pb2.Shard, ] - DocumentSearch: grpc.UnaryUnaryMultiCallable[ - nucliadb_protos.nodereader_pb2.DocumentSearchRequest, - nucliadb_protos.nodereader_pb2.DocumentSearchResponse, - ] - - ParagraphSearch: grpc.UnaryUnaryMultiCallable[ - nucliadb_protos.nodereader_pb2.ParagraphSearchRequest, - nucliadb_protos.nodereader_pb2.ParagraphSearchResponse, - ] - - VectorSearch: grpc.UnaryUnaryMultiCallable[ - nucliadb_protos.nodereader_pb2.VectorSearchRequest, - nucliadb_protos.nodereader_pb2.VectorSearchResponse, - ] - - RelationSearch: grpc.UnaryUnaryMultiCallable[ - nucliadb_protos.nodereader_pb2.RelationSearchRequest, - nucliadb_protos.nodereader_pb2.RelationSearchResponse, - ] - DocumentIds: grpc.UnaryUnaryMultiCallable[ nucliadb_protos.noderesources_pb2.ShardId, nucliadb_protos.nodereader_pb2.IdCollection, @@ -156,26 +136,6 @@ class NodeReaderAsyncStub: nucliadb_protos.noderesources_pb2.Shard, ] - DocumentSearch: grpc.aio.UnaryUnaryMultiCallable[ - nucliadb_protos.nodereader_pb2.DocumentSearchRequest, - nucliadb_protos.nodereader_pb2.DocumentSearchResponse, - ] - - ParagraphSearch: grpc.aio.UnaryUnaryMultiCallable[ - nucliadb_protos.nodereader_pb2.ParagraphSearchRequest, - nucliadb_protos.nodereader_pb2.ParagraphSearchResponse, - ] - - VectorSearch: grpc.aio.UnaryUnaryMultiCallable[ - nucliadb_protos.nodereader_pb2.VectorSearchRequest, - nucliadb_protos.nodereader_pb2.VectorSearchResponse, - ] - - RelationSearch: grpc.aio.UnaryUnaryMultiCallable[ - nucliadb_protos.nodereader_pb2.RelationSearchRequest, - nucliadb_protos.nodereader_pb2.RelationSearchResponse, - ] - DocumentIds: grpc.aio.UnaryUnaryMultiCallable[ nucliadb_protos.noderesources_pb2.ShardId, nucliadb_protos.nodereader_pb2.IdCollection, @@ -243,34 +203,6 @@ class NodeReaderServicer(metaclass=abc.ABCMeta): context: _ServicerContext, ) -> typing.Union[nucliadb_protos.noderesources_pb2.Shard, collections.abc.Awaitable[nucliadb_protos.noderesources_pb2.Shard]]: ... - @abc.abstractmethod - def DocumentSearch( - self, - request: nucliadb_protos.nodereader_pb2.DocumentSearchRequest, - context: _ServicerContext, - ) -> typing.Union[nucliadb_protos.nodereader_pb2.DocumentSearchResponse, collections.abc.Awaitable[nucliadb_protos.nodereader_pb2.DocumentSearchResponse]]: ... - - @abc.abstractmethod - def ParagraphSearch( - self, - request: nucliadb_protos.nodereader_pb2.ParagraphSearchRequest, - context: _ServicerContext, - ) -> typing.Union[nucliadb_protos.nodereader_pb2.ParagraphSearchResponse, collections.abc.Awaitable[nucliadb_protos.nodereader_pb2.ParagraphSearchResponse]]: ... - - @abc.abstractmethod - def VectorSearch( - self, - request: nucliadb_protos.nodereader_pb2.VectorSearchRequest, - context: _ServicerContext, - ) -> typing.Union[nucliadb_protos.nodereader_pb2.VectorSearchResponse, collections.abc.Awaitable[nucliadb_protos.nodereader_pb2.VectorSearchResponse]]: ... - - @abc.abstractmethod - def RelationSearch( - self, - request: nucliadb_protos.nodereader_pb2.RelationSearchRequest, - context: _ServicerContext, - ) -> typing.Union[nucliadb_protos.nodereader_pb2.RelationSearchResponse, collections.abc.Awaitable[nucliadb_protos.nodereader_pb2.RelationSearchResponse]]: ... - @abc.abstractmethod def DocumentIds( self, diff --git a/nucliadb_protos/rust/src/nodereader.rs b/nucliadb_protos/rust/src/nodereader.rs index f7fd3d9f02..c750cca0b4 100644 --- a/nucliadb_protos/rust/src/nodereader.rs +++ b/nucliadb_protos/rust/src/nodereader.rs @@ -876,106 +876,6 @@ pub mod node_reader_client { .insert(GrpcMethod::new("nodereader.NodeReader", "GetShard")); self.inner.unary(req, path, codec).await } - pub async fn document_search( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/nodereader.NodeReader/DocumentSearch", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("nodereader.NodeReader", "DocumentSearch")); - self.inner.unary(req, path, codec).await - } - pub async fn paragraph_search( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/nodereader.NodeReader/ParagraphSearch", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("nodereader.NodeReader", "ParagraphSearch")); - self.inner.unary(req, path, codec).await - } - pub async fn vector_search( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/nodereader.NodeReader/VectorSearch", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("nodereader.NodeReader", "VectorSearch")); - self.inner.unary(req, path, codec).await - } - pub async fn relation_search( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/nodereader.NodeReader/RelationSearch", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("nodereader.NodeReader", "RelationSearch")); - self.inner.unary(req, path, codec).await - } pub async fn document_ids( &mut self, request: impl tonic::IntoRequest, @@ -1248,34 +1148,6 @@ pub mod node_reader_server { tonic::Response, tonic::Status, >; - async fn document_search( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn paragraph_search( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn vector_search( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn relation_search( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; async fn document_ids( &self, request: tonic::Request, @@ -1469,190 +1341,6 @@ pub mod node_reader_server { }; Box::pin(fut) } - "/nodereader.NodeReader/DocumentSearch" => { - #[allow(non_camel_case_types)] - struct DocumentSearchSvc(pub Arc); - impl< - T: NodeReader, - > tonic::server::UnaryService - for DocumentSearchSvc { - type Response = super::DocumentSearchResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::document_search(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = DocumentSearchSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/nodereader.NodeReader/ParagraphSearch" => { - #[allow(non_camel_case_types)] - struct ParagraphSearchSvc(pub Arc); - impl< - T: NodeReader, - > tonic::server::UnaryService - for ParagraphSearchSvc { - type Response = super::ParagraphSearchResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::paragraph_search(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = ParagraphSearchSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/nodereader.NodeReader/VectorSearch" => { - #[allow(non_camel_case_types)] - struct VectorSearchSvc(pub Arc); - impl< - T: NodeReader, - > tonic::server::UnaryService - for VectorSearchSvc { - type Response = super::VectorSearchResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::vector_search(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = VectorSearchSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/nodereader.NodeReader/RelationSearch" => { - #[allow(non_camel_case_types)] - struct RelationSearchSvc(pub Arc); - impl< - T: NodeReader, - > tonic::server::UnaryService - for RelationSearchSvc { - type Response = super::RelationSearchResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::relation_search(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = RelationSearchSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } "/nodereader.NodeReader/DocumentIds" => { #[allow(non_camel_case_types)] struct DocumentIdsSvc(pub Arc);