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

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

Introduction

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

Prototype

@Nullable
public Integer getNrSnipplets() 

Source Link

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);/*from   w w  w.java  2  s .c o  m*/
    query.setHighlightOptions(options);

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