A class that translates or converts data into a format that can be used with Weaviate, a vector search engine. It extends the BaseTranslator class and provides specific implementation for Weaviate.

Type Parameters

Hierarchy

Constructors

Properties

VisitComparisonOutput: WeaviateComparisonResult
VisitOperationOutput: WeaviateOperationResult
VisitStructuredQueryOutput: {
    filter?: T["FilterType"];
}

Type declaration

  • Optional filter?: T["FilterType"]
allowedComparators: Comparator[] = ...
allowedOperators: Operator[] = ...

Methods

  • Formats the given function into a string representation. Throws an error if the function is not a known comparator or operator, or if it is not allowed.

    Parameters

    • func: Operator | Comparator

      The function to format, which can be an Operator or Comparator.

    Returns string

    A string representation of the function.

  • Merges two filters into one. If both filters are empty, returns undefined. If one filter is empty or the merge type is 'replace', returns the other filter. If the merge type is 'and' or 'or', returns a new filter with the merged results. Throws an error for unknown merge types.

    Parameters

    • defaultFilter: undefined | WeaviateFilter

      The default filter to merge.

    • generatedFilter: undefined | WeaviateFilter

      The generated filter to merge.

    • mergeType: string = "and"

      The type of merge to perform. Can be 'and', 'or', or 'replace'. Defaults to 'and'.

    Returns undefined | WeaviateFilter

    A merged WeaviateFilter, or undefined if both filters are empty.

  • Visits a comparison and returns a WeaviateComparisonResult. The comparison's value is checked for type and the comparator is formatted. Throws an error if the value type is not supported.

    Parameters

    Returns WeaviateComparisonResult

    A WeaviateComparisonResult.

  • Visits a structured query and returns a WeaviateStructuredQueryResult. If the query has a filter, it is visited.

    Parameters

    Returns {
        filter?: T["FilterType"];
    }

    A WeaviateStructuredQueryResult.

    • Optional filter?: T["FilterType"]

Generated using TypeDoc