diff --git a/en/searcher-development.html b/en/searcher-development.html index e31efdd04b..825d5fcc2d 100644 --- a/en/searcher-development.html +++ b/en/searcher-development.html @@ -165,6 +165,7 @@
{% highlight java %} package com.yahoo.search.example; +import com.yahoo.data.access.simple.Value; import com.yahoo.search.*; import com.yahoo.search.result.Hit; import com.yahoo.search.searchchain.Execution; @@ -178,6 +179,9 @@Writing a Searcher
Result result = execution.search(query); // Pass on to the next searcher to get results Hit hit = new Hit("test"); hit.setField("message", "Hello world"); + Value.ObjectValue mapValue = new Value.ObjectValue(); // For structured data, use the dedicated class + mapValue.put("hello", "world"); + hit.setField("mapValue", mapValue); result.hits().add(hit); return result; }