Unable to delete items from the index

Created on 17 April 2025, 3 months ago

Problem/Motivation

Currently, we are indexing 2 content types with embedding enabled and chunk size set to 25.
We did not specify an ID field, and Typesense generated the id and the document_id for us.
Examples of generated IDS:
id: entity:node-5863:en_22 document_id: entity:node-5863:en
id: entity:node-5863:en_21 document_id: entity:node-5863:en
id: entity:node-5863:en_20 document_id: entity:node-5863:en

Steps to reproduce

Delete or archive a node.
When Typesense is trying to retrieve the document from the index, it uses the following call:

$this->getTypesenseClient()->deleteDocument($collection, $item_id);

The $item_id value passed to the function is entity:node-5863:en, which means that the document is never found in the index, and it will stay available in search until we manually clear the index data.

A different function is used when the reindex is happening:

$this->getTypesenseClient()->deleteDocuments($collection, ['filter_by' => 'nid:=' . $document['nid']]);
🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom Alina Basarabeanu

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024