Posted on 23/04/2025 17:04:55
Hi John
That is not easily possible - the index is used for searching - and if values are not stored, they cannot be retrieved.
Your IndexExtender probably has some logic related to the value - if you extract that to a method, you can create an extension method for the productviewmodel that has the same logic:
public static string GetCustomValue(this ProductViewModel productViewModel){...}
Alternatively you need to find the paragraph settings, find the repository and index, load the index, find the product based off the autoid in the index using a query, get the document from the search result and find the value in a stored field..... Lots of code and lots of potential performance issues.
Another solution again is to create a custom field on a product and move your IndexExtender logic into a SQL task that will update that custom field on the product - then it will be indexed and be available in your templates.
BR Nicolai