Package org.springframework.data.solr.core.query.HighlightOptions

Examples of org.springframework.data.solr.core.query.HighlightOptions.HighlightParameter


    String highlightPrefix = queryMethod.getHighlightPrefix();
    if (highlightPrefix != null) {
      if (isSimpleHighlightingOption(formatter)) {
        options.setSimplePrefix(highlightPrefix);
      } else {
        options.addHighlightParameter(new HighlightParameter(HighlightParams.TAG_PRE, highlightPrefix));
      }
    }
    String highlightPostfix = queryMethod.getHighlightPostfix();
    if (highlightPostfix != null) {
      if (isSimpleHighlightingOption(formatter)) {
        options.setSimplePostfix(highlightPostfix);
      } else {
        options.addHighlightParameter(new HighlightParameter(HighlightParams.TAG_POST, highlightPostfix));
      }
    }
  }
View Full Code Here


  @Test
  public void testAddParamters() {
    options.addHighlightParameter(PARAMETER_NAME, PARAMETER_VALUE);
    Assert.assertEquals(1, options.getHighlightParameters().size());

    HighlightParameter parameter = options.getHighlightParameters().iterator().next();
    Assert.assertEquals(PARAMETER_NAME, parameter.getName());
    Assert.assertEquals(PARAMETER_VALUE, parameter.getValue());
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.solr.core.query.HighlightOptions.HighlightParameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.