Source code for strongdoc.api.search

from typing import List

from strongdoc import client
from strongdoc import constants
from strongdoc.proto import search_pb2, strongdoc_pb2_grpc





[docs]class DocumentResult: """ A class that will hold a single document that matches the search result from the Search query. """ def __init__(self, docid, score): """ Constructs a document that matches the search result :param docid: The matching document ID :type docid: `string` :param score: The score of the matching document :type score: `float` """ self._docid = docid self._score = score @property def docid(self): """ Get the matching document ID returns: The matching document ID :rtype: `string` """ return self._docid @docid.setter def docid(self, docid): """ Set the matching document ID :param docid: The matching document ID :type docid: `string` """ self._docid = docid @property def score(self): """ Get the score of the matching document returns: The score of the matching document :rtype: `float` """ return self._score @score.setter def score(self, score): """ Set the score of the matching document :param score: The score of the matching document :type score: `float` """ self._score = score