kaiwangleo commented on code in PR #997:
URL: https://github.com/apache/flink-agents/pull/997#discussion_r3793545051
##########
integrations/vector-stores/elasticsearch/src/main/java/org/apache/flink/agents/integrations/vectorstores/elasticsearch/ElasticsearchVectorStore.java:
##########
@@ -336,23 +336,29 @@ 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. Because
+ * Elasticsearch dynamic mapping creates `.keyword` sub-fields only for
strings, filters on
Review Comment:
Fixed in `271818de` after merging the latest `upstream/main` in `ae5be353`.
All five occurrences now use Javadoc inline code tags: `{@code .keyword}`
and `{@code filter_query}`. There are no Markdown backticks left in the file.
While rebuilding the Javadocs on the updated base, I also aligned
`queryEmbedding` with the pre-filter behavior now present on `main` from #1001.
Validation passed:
- `bash tools/lint.sh -c`
- `git diff --check`
- the final diff against `upstream/main` contains only the three intended
Javadoc sections
##########
integrations/vector-stores/elasticsearch/src/main/java/org/apache/flink/agents/integrations/vectorstores/elasticsearch/ElasticsearchVectorStore.java:
##########
@@ -546,7 +554,7 @@ private void deleteDocuments(
if (combined != null) {
builder.query(q -> q.withJson(new StringReader(combined)));
} else {
- // No filter at all → delete every document (match_all).
+ // No filter at all 闂?delete every document (match_all).
Review Comment:
Fixed in `271818de` after merging the latest `upstream/main` in `ae5be353`.
I resolved the conflicting Elasticsearch file from the exact upstream
version before reapplying the three Javadoc updates. This preserves both
original comments exactly:
```java
// No filter at all → delete every document (match_all).
// hit.score() is a Double — null for plain get-all responses, populated for
```
The corrupted comment hunks are no longer present in the PR diff. The final
diff against `upstream/main` contains only the `get`, `delete`, and
`queryEmbedding` Javadocs. `bash tools/lint.sh -c` and `git diff --check` both
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]