/**
* Add snippets to the search-results. It adds a new field
* SNIPPET_FIELDNAME_PREFIX_field with the snippet for each field
*/
private void addSnippets (GroupedSearchResults res, org.apache.lucene.search.Query query) throws IOException {
Formatter simpleHtmlFormatter= new SimpleHTMLFormatter(HIGHLIGHTER_PREFIX, HIGHLIGHTER_SUFFIX);
for (int i= 0; i < snippetOfFields.length; i++) {
String fieldToSnippet = snippetOfFields[i];
int snippetLength= snippetsLength[i];
QueryScorer scorer= new QueryScorer(query, fieldToSnippet);
addSnippets(res, fieldToSnippet, snippetLength, scorer, simpleHtmlFormatter);