kaiwangleo commented on code in PR #997:
URL: https://github.com/apache/flink-agents/pull/997#discussion_r3850580810


##########
integrations/vector-stores/elasticsearch/src/main/java/org/apache/flink/agents/integrations/vectorstores/elasticsearch/ElasticsearchVectorStore.java:
##########
@@ -336,23 +336,25 @@ public Map<String, Object> getStoreKwargs() {
     /**
      * Retrieve documents from the vector store.
      *
-     * <p>If ids is not provided, this method will retrieve documents 
according to {@code limit},
-     * {@code offset}, and {@code filter_query} in additional arguments. If 
{@code limit} is null,
-     * up to {@link ElasticsearchVectorStore#MAX_RESULT_WINDOW} documents are 
returned (an
-     * Elasticsearch ceiling).
+     * <p>When {@code ids} is non-empty, documents are retrieved directly by 
ID and the filter,
+     * limit, offset, and {@code filter_query} arguments are not applied.
      *
-     * <p>The unified {@code filters} DSL parameter is not yet translated to 
Elasticsearch's native
-     * query DSL — callers needing structured filtering should pass a raw 
{@code filter_query} via
-     * {@code extraArgs}. TODO: implement equality-DSL translation parallel to 
the Python Chroma
-     * implementation.
+     * <p>Otherwise, {@code filters} provides equality-only matching against 
document metadata. Each
+     * entry is translated to an Elasticsearch {@code term} query on {@code
+     * <metadataField>.<key>.keyword}, and multiple entries are combined with 
AND semantics. A raw
+     * Elasticsearch JSON query may also be supplied as {@code filter_query} 
in {@code extraArgs};
+     * when both forms are present, they are combined with AND semantics.
      *
-     * @param ids The ids of the documents.
-     * @param collection The name of the collection to be retrieved. If is 
null, retrieve the
-     *     default collection.
-     * @param filters Unified filter DSL. Currently ignored — see method 
Javadoc.
-     * @param limit Maximum number of documents to return; falls back to {@link
-     *     ElasticsearchVectorStore#MAX_RESULT_WINDOW} when null.
-     * @param extraArgs Additional arguments. (offset, filter_query, etc.)
+     * <p>The {@code limit} parameter takes precedence over a {@code limit} 
value in {@code
+     * extraArgs}. If neither is provided, up to {@link 
ElasticsearchVectorStore#MAX_RESULT_WINDOW}

Review Comment:
   Thanks for pointing out this distinction. `MAX_RESULT_WINDOW` is only the 
fallback request size used by this implementation when neither the `limit` 
parameter nor an `extraArgs` limit is provided. The effective `from + size` 
limit is controlled by the target index's `index.max_result_window` setting, 
which defaults to 10,000 but is configurable. I updated the `get` Javadoc and 
the constant comment accordingly in commit `608312b2`; no runtime behavior 
changed. The focused Spotless check and `git diff --check` pass.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to