Skip to content

Retrieve

RetrieveOp

Bases: PhysicalOperator

__init__

__init__(
    index: Collection | RAGPretrainedModel,
    search_attr: str,
    output_attrs: list[dict] | type[Schema],
    search_func: Callable | None,
    k: int,
    *args,
    **kwargs,
) -> None

Initialize the RetrieveOp object.

Parameters:

  • index (Collection | RAGPretrainedModel) –

    The PZ index to use for retrieval.

  • search_attr (str) –

    The attribute to search on.

  • output_attrs (list[dict]) –

    The output fields containing the results of the search.

  • search_func (Callable | None) –

    The function to use for searching the index. If None, the default search function will be used.

  • k (int) –

    The number of top results to retrieve.

__call__

__call__(candidate: DataRecord) -> DataRecordSet