yunfengzhou-hub commented on code in PR #1280:
URL: https://github.com/apache/flink-agents/pull/1280#discussion_r4321091483
##########
integrations/vector-stores/elasticsearch/src/main/java/org/apache/flink/agents/integrations/vectorstores/elasticsearch/ElasticsearchVectorStore.java:
##########
@@ -318,8 +318,8 @@ public Map<String, Object> getStoreKwargs() {
m.put("vector_field", this.vectorField);
m.put("dims", this.dims);
if (this.k != null) {
- // Expose as top_k (preferred name); keep legacy key for
compatibility if referenced
- m.put("top_k", this.k);
+ // queryEmbedding() reads this under "k"; expose it under the same
key
+ m.put("k", this.k);
Review Comment:
Fixed — `queryEmbedding` now sets `.size(Math.min(limit, k))`, so `k` picks
neighbours and `limit` bounds the hits. Added both cases through `query()`:
store k=8 with limit=3 expects 3, no store k with limit=12 expects 12. Not run
locally (no Elasticsearch here); CI executes that class against the compose
server. Effective-pair validation left as a follow-up.
--
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]