def _gen_query_request(self, query: VectorStoreQuery) -> models.QueryRequest:
        """
        Generate the OpenSearch query request.

        Args:
            query (VectorStoreQuery): The vector store query

        Return:
            OpenSearch query request

        """
        filter = _to_ha3_engine_filter(query.filters)
        request = models.QueryRequest(
            table_name=self._config.table_name,
            namespace=self._config.namespace,
            vector=query.query_embedding,
            top_k=query.similarity_top_k,
            filter=filter,
            include_vector=True,
            output_fields=self._config.output_fields,
        )

        if self._config.search_config:
            request.order = self._config.search_config.get("order", "ASC")
            score_threshold: float = self._config.search_config.get(
                "score_threshold", None
            )
            if score_threshold is not None:
                request.score_threshold = score_threshold
            search_params = self._config.search_config.get("search_params", None)
            if search_params is not None:
                request.search_params = json.dumps(search_params)
        return request

        Generate the OpenSearch query request.

        Args:
            query (VectorStoreQuery): The vector store query

        Return:
            OpenSearch query request

        
llama-index-integrations/vector_stores/llama-index-vector-stores-alibabacloud-opensearch/llama_index/vector_stores/alibabacloud_opensearch/base.py