Mirko Sertic created SOLR-17055:
-----------------------------------
Summary: KnnVectorQuery: Wrong number of search results when
running in cloud-mode
Key: SOLR-17055
URL: https://issues.apache.org/jira/browse/SOLR-17055
Project: Solr
Issue Type: Bug
Security Level: Public (Default Security Level. Issues are Public)
Affects Versions: 9.4, 9.2.1, 9.3, 9.1.1, 9.2, 9.1
Reporter: Mirko Sertic
It seems that the KnnVectorQuery gives a wrong number of search results when
running Solr in cloud-mode. To be more specific, a collection with multiple
shards gives the wrong number of search results.
The query
{noformat}
{!knn f=TESTEMBEDDING_EU_3 topK=3}[1.0,1.0,1.0]{noformat}
on a collection with two shards results in six documents, but the query asked
for the topK=3. It seems that internally the topK query parameter is per shard,
and not per query result. This is an unexpected behavior, as the technical
layout of the collection should not affect the query parameter from a users
perspective.
This problem can be reproduced by adding the following documents to a
collection with two shards and running the mentioned query:
{code:java}
{
id: 'Position1',
TESTEMBEDDING_EU_3: [0, 0, 0]
}
{
id: 'Position2',
TESTEMBEDDING_EU_3: [0.1, 0.1, 0.1]
}
{
id: 'Position3',
TESTEMBEDDING_EU_3: [0.2, 0.2, 0.2]
}
{
id: 'Position4',
TESTEMBEDDING_EU_3: [0.3, 0.3, 0.3]
}
{
id: 'Position5',
TESTEMBEDDING_EU_3: [0.4, 0.4, 0.4]
}
{
id: 'Position6',
TESTEMBEDDING_EU_3: [0.5, 0.5, 0.5]
}
{
id: 'Position7',
TESTEMBEDDING_EU_3: [0.6, 0.6, 0.6]
}
{
id: 'Position8',
TESTEMBEDDING_EU_3: [0.7, 0.7, 0.7]
}
{
id: 'Position9',
TESTEMBEDDING_EU_3: [0.8, 0.8, 0.8]
}
{
id: 'Position10',
TESTEMBEDDING_EU_3: [0.9, 0.9, 0.9]
}
{
id: 'Position11',
TESTEMBEDDING_EU_3: [1.0, 1.0, 1.0]
} {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]