def _knn_search_query(
        self,
        vector_field: str,
        query_embedding: List[float],
        k: int,
        filter_type: str,
        nprobe: str,
        reorder_factor: str,
        filters: Optional[MetadataFilters] = None,
    ) -> Dict:
        """
        Do knn search.

        If there are no filters do approx-knn search.
        If there are filters, do an exhaustive exact knn search using filters.

        Note that approximate knn search does not support metadata filting.

        Args:
            query_embedding(List[float]): Vector embedding to query.
            k(int): Maximum number of results.
            filter_type(str): filter_type for lindorm search, pre_filter and post_filter are supported;
                default: "post_filter".
            nprobe (str): number of cluster units to query; between 1 and method.parameters.nlist.
                No default value.
            reorder_factor (str): reorder_factor for lindorm search; between 1 and 200; default: 10.

        Optional Args:
            filters(Optional[MetadataFilters]): Optional filters to apply before the search.
                Supports filter-context queries documented at
                https://opensearch.org/docs/latest/query-dsl/query-filter-context/

        Returns:
            Up to k targets closest to query_embedding.

        """
        filter_list = self._parse_filters(filters)
        if not filters:
            search_query = self._default_approximate_search_query(
                query_vector=query_embedding,
                k=k,
                vector_field=vector_field,
                nprobe=nprobe,
                reorder_factor=reorder_factor,
            )
        else:
            if filters.condition == FilterCondition.AND:
                filter = {"bool": {"must": filter_list}}
            elif filters.condition == FilterCondition.OR:
                filter = {"bool": {"should": filter_list}}
            else:
                # TODO: FilterCondition can also be 'NOT', but llama_index does not support it yet.
                # https://opensearch.org/docs/latest/query-dsl/compound/bool/
                # post_filter = {"bool": {"must_not": filter_list}}
                raise ValueError(f"Unsupported filter condition: {filters.condition}")

            search_query = self._search_query_with_filter(
                query_vector=query_embedding,
                vector_field=vector_field,
                k=k,
                filter=filter,
                nprobe=nprobe,
                reorder_factor=reorder_factor,
                filter_type=filter_type,
            )

        return search_query

        Do knn search.

        If there are no filters do approx-knn search.
        If there are filters, do an exhaustive exact knn search using filters.

        Note that approximate knn search does not support metadata filting.

        Args:
            query_embedding(List[float]): Vector embedding to query.
            k(int): Maximum number of results.
            filter_type(str): filter_type for lindorm search, pre_filter and post_filter are supported;
                default: "post_filter".
            nprobe (str): number of cluster units to query; between 1 and method.parameters.nlist.
                No default value.
            reorder_factor (str): reorder_factor for lindorm search; between 1 and 200; default: 10.

        Optional Args:
            filters(Optional[MetadataFilters]): Optional filters to apply before the search.
                Supports filter-context queries documented at
                https://opensearch.org/docs/latest/query-dsl/query-filter-context/

        Returns:
            Up to k targets closest to query_embedding.

        
llama-index-integrations/vector_stores/llama-index-vector-stores-lindorm/llama_index/vector_stores/lindorm/base.py