jina.types.sets.match

class jina.types.sets.match.MatchSet(docs_proto, reference_doc)[source]

Bases: jina.types.sets.document.DocumentSet

MatchSet inherits from DocumentSet. It’s a subset of Documents that represents the matches

Parameters
  • docs_proto (Document) – Set of matches of the reference_doc

  • reference_doc (Document) – Reference Document for the sub-documents

append(document, **kwargs)[source]

Add a matched document to the current Document.

Parameters
  • document (Document) – Sub-document to be added

  • kwargs – Extra key value arguments

Returns

the newly added sub-document in Document view

Return type

Document view

property reference_doc

Get the document that this MatchSet referring to. :rtype: Document :return: the document the match refers to

property granularity

Get granularity of all document in this set. :rtype: int :return: the granularity of the documents of which these are match

property adjacency

Get the adjacency of all document in this set. :rtype: int :return: the adjacency of the set of matches