Example usage for org.springframework.data.solr.core.query HighlightOptions setNrSnipplets

List of usage examples for org.springframework.data.solr.core.query HighlightOptions setNrSnipplets

Introduction

In this page you can find the example usage for org.springframework.data.solr.core.query HighlightOptions setNrSnipplets.

Prototype

public HighlightOptions setNrSnipplets(Integer nrSnipplets) 

Source Link

Document

set hl.snippets

Usage

From source file:org.springframework.data.solr.core.DefaultQueryParserTests.java

@Test
public void testConstructSorlQueryWithHighlightOptionNrSnipplets() {
    SimpleHighlightQuery query = new SimpleHighlightQuery(new SimpleStringCriteria("field_1:value_1"));
    HighlightOptions options = new HighlightOptions();
    options.setNrSnipplets(10);
    query.setHighlightOptions(options);//from w ww .  jav  a2  s  .c  o  m

    SolrQuery solrQuery = queryParser.constructSolrQuery(query);
    Assert.assertEquals(options.getNrSnipplets().intValue(), solrQuery.getHighlightSnippets());
}