Gravatar for bhanu.korthiwada@outlook.com

Question by Bhanu Prakash, Jan 23, 2019 11:44 AM

Remove indexed items

We have a checkbox to exclude some items from Coveo using inbound pipeline, at later point of time when we check some items to exclude from the index (these items were already index before) and executed Re-Index Tree from developer tab. Even after re-index tree, these items are in Coveo Index. What is the correct way of getting these items removed from coveo index? (Without full reindex)

Inbound pipeline used as it is in Custom Inbound Pipeline

1 Reply
Gravatar for flguillemette@coveo.com

Answer by François Lachance-Guillemette, Jan 23, 2019 12:41 PM

In the `CoveoInboundFilterPipelineArgs` object, there is a `ForceDelete` property that you can set that forces to send a delete to the index.

You could leverage this feature in your custom inbound filter.

For instance, this is used in our product by `IndexLatestVersionInboundFilter`. When the item is the latest version, it goes through the pipeline. But each earlier version will get `IsExcluded = true` and `ForceDeleteItem = true`. This ensures that only the latest version is in the index, otherwise, there would be no direct way to detect that a new version should overwrite the older ones.

When you do use this feature, the following line appears in the logs:

`The item {0} in the language {1} and version {2} is excluded and will be deleted.`.

Gravatar for bhanu.korthiwada@outlook.com

Comment by Bhanu Prakash, Jan 23, 2019 1:34 PM

Understood, thank you!

Ask a question