Also notified you on Slack, but this way other people can also find the answer to this question.
With Examine v3, it seems like you'll have to convert the values to a dictionary, add/change values and then set the valueset against the event arguments.
I cannot get this working in V11. The e.SetValues() does not save the new items. And when I hit save again, the previously added items are added again. Here is my code
Examine, Transforming index values in V10
Anyone know how to transform your Examine index in V10?
A breaking change was introduced which makes ValueSet immutable.
TryAdd to add new items to index no longer works. The documentation still claims it can be used:
https://our.umbraco.com/documentation/reference/searching/examine/examine-events#adding-the-path-of-the-node-as-a-searchable-field-into-the-index
However you can see the breaking change here:
https://github.com/umbraco/Umbraco-CMS/pull/12307
Cheers,
Marc
Also notified you on Slack, but this way other people can also find the answer to this question.
With Examine v3, it seems like you'll have to convert the values to a dictionary, add/change values and then set the valueset against the event arguments.
You can see this being used in the tests that are present in the Examine v3 code base: https://github.com/Shazwazza/Examine/blob/release/3.0/src/Examine.Test/Examine.Lucene/Index/LuceneIndexTests.cs#L328
Just to add to this, you need to use SetValues to update the index:
Thanks for sharing Marc, just ran in to this issue myself today.
h5yr
O.
I cannot get this working in V11. The e.SetValues() does not save the new items. And when I hit save again, the previously added items are added again. Here is my code
https://our.umbraco.com/forum/using-umbraco-and-getting-started//110908-unable-to-get-an-examine-custom-index-item-to-work-in-v11
Can anyone point me in the right direction?
is working on a reply...