def _search_query_with_filter(
        self,
        query_vector: List[float],
        k: int,
        filter_type: str,
        nprobe: str,
        reorder_factor: str,
        vector_field: str = "vector_field",
        filter: Union[Dict, List, None] = None,
    ) -> Dict:
        """
        Construct search query with pre-filter or post-filter.

        Args:
            query_vector(List[float]): Vector embedding to query.
            k(int): Maximum number of results. default: 4.
            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.
            vector_field(str): Document field embeddings are stored in. default: "vector_field".
            filter(Union[Dict, List, None]): filter for lindorm search. default: None.

        Returns:
            A dictionary representing the query.

        """
        if not filter:
            filter = MATCH_ALL_QUERY
        return {
            "size": k,
            "query": {
                "knn": {
                    vector_field: {"vector": query_vector, "filter": filter, "k": k}
                }
            },
            "ext": {
                "lvector": {
                    "filter_type": filter_type,
                    "nprobe": nprobe,
                    "reorder_factor": reorder_factor,
                }
            },
        }

        Construct search query with pre-filter or post-filter.

        Args:
            query_vector(List[float]): Vector embedding to query.
            k(int): Maximum number of results. default: 4.
            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.
            vector_field(str): Document field embeddings are stored in. default: "vector_field".
            filter(Union[Dict, List, None]): filter for lindorm search. default: None.

        Returns:
            A dictionary representing the query.

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