This issue has been created
There are 4 updates.
 
 
LLM AI Integration / cid:jira-generated-image-avatar-1fefb726-9d79-4b3f-a1ec-54e062c16ef9 LLMAI-239 Closed

Semantic search misses some of the best matching chunks when few results are requested

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-086ecf75-37bc-474a-a1df-6967ea654501 Paul Pantiru created this issue on 20/Nov/26 12:01
 
Summary: Semantic search misses some of the best matching chunks when few results are requested
Issue Type: cid:jira-generated-image-avatar-1fefb726-9d79-4b3f-a1ec-54e062c16ef9 Bug
Affects Versions: 0.3
Assignee: Unassigned
Created: 20/Nov/26 12:01
Priority: cid:jira-generated-image-static-major-df8fb40d-28af-4bff-9fe4-a6bbbc74b4bf Major
Reporter: Paul Pantiru
Description:

Problem

When a search asks for only a few semantic results, the results are often not the best matching chunks of the collection: asking for more results returns better matches in the first positions than asking for few. The chat is the most affected, since its context uses 2 or 3 semantic results by default.

Steps to reproduce

  1. Index a collection with a few thousand chunks.
  2. Send POST /rest/wikis/xwiki/aiLLM/search?query=<text>&collection=<name>&limitSemanticResults=3&limitKeywordResults=0.
  3. Send the same request with limitSemanticResults=100.

Result

For some queries, the 3 results of the first request are not the first 3 results of the second one, and the best match of the second request can be missing from the first.

Expected

The first request returns the first 3 results of the second one.

Cause

The search of the vector index is approximate, and it explores less of the index when it is asked for fewer nearest neighbors. The semantic query asks for exactly as many neighbors as results requested.

Fix

Ask the index for at least 100 nearest neighbors and return the requested number of results.

 
 

4 updates

 
cid:jira-generated-image-avatar-086ecf75-37bc-474a-a1df-6967ea654501 Changes by Paul Pantiru on 20/Nov/26 12:01
 
Fix Version: 1.0.1
Assignee: Paul Pantiru
Resolution: Fixed
Status: Open Closed