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

Examples of org.springframework.data.solr.core.query.FacetOptions.FacetParameter


      solrQuery.setFacetPrefix(facetOptions.getFacetPrefix());
    }
    for (FieldWithFacetParameters parametrizedField : facetOptions.getFieldsWithParameters()) {
      addPerFieldFacetParameters(solrQuery, parametrizedField);
      if (parametrizedField.getSort() != null && FacetOptions.FacetSort.INDEX.equals(parametrizedField.getSort())) {
        addFieldSpecificParameterToSolrQuery(solrQuery, parametrizedField, new FacetParameter(FacetParams.FACET_SORT,
            FacetParams.FACET_SORT_INDEX));
      }

    }
  }
View Full Code Here


  @Test
  public void testConstructSolrQueryWithCustomFieldFacetParameters() {
    FacetQuery query = new SimpleFacetQuery(new Criteria("field_1").is("value_1"));
    FieldWithFacetParameters fieldWithFacetParameters = new FieldWithFacetParameters("facet_2")
        .addFacetParameter(new FacetParameter(FacetParams.FACET_ZEROS, "on"));
    FacetOptions facetOptions = new FacetOptions(new SimpleField("facet_1"), fieldWithFacetParameters);
    query.setFacetOptions(facetOptions);

    SolrQuery solrQuery = queryParser.constructSolrQuery(query);
    Assert.assertEquals("on", solrQuery.getParams("f." + fieldWithFacetParameters.getName() + ".facet.zeros")[0]);
View Full Code Here

TOP

Related Classes of org.springframework.data.solr.core.query.FacetOptions.FacetParameter

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.