SearchUnit uses json2html (https://json2html.com/) and in theory you can use an inline function, though I've never tried it. You would for example set
keyotiResultViewer.resultItemTransform
to a template object, as described here
https://json2html.com/ex...s/#example-basic-inline note that this is different to the html template string, instead it uses their object notation to define the template. I would get into more detail but I honestly don't know much about it.
The alternative, that may be simpler is to preprocess the results before display, you can do that by overriding (in javascript)
keyotiSearch.presentResults
eg.
Code:
<script type='text/javascript'>
var basePresentResults = keyotiSearch.presentResults;
keyotiSearch.presentResults = function(){
//process results
for (var i = 0; i < keyotiSearch.resultObject.Results.length; i++) {
//look here at keyotiSearch.resultObject.Results[i] and see what data there is, and change as necessary
}
basePresentResults();
}
</script>
I haven't tried that, but I think it will work. Let me know what you choose and how it goes, posting your attempt if it doesn't work.
Jim
-your feedback is helpful to other users, thank you!