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

Examples of org.springframework.data.solr.core.query.SimpleStringCriteria


        new CustomSolrRepositoryImpl(this.solrOperations));
  }

  @After
  public void tearDown() {
    solrOperations.delete(new SimpleQuery(new SimpleStringCriteria("*:*")));
    solrOperations.commit();
  }
 
View Full Code Here


    this.solrTemplate = solrTemplate;
  }

  @Override
  public Page<Product> findProductsByCustomImplementation(String value, Pageable page) {
    return solrTemplate.queryForPage(new SimpleQuery(new SimpleStringCriteria("name:" + value)).setPageRequest(page),
        Product.class);
  }
View Full Code Here

    }
  }

  protected SimpleQuery createQueryFromString(String queryString, SolrParameterAccessor parameterAccessor) {
    String parsedQueryString = replacePlaceholders(queryString, parameterAccessor);
    return new SimpleQuery(new SimpleStringCriteria(parsedQueryString));
  }
View Full Code Here

    return getValue();
  }

  @Override
  public FilterQuery getQuery() {
    return new SimpleQuery(new SimpleStringCriteria(getValue()));
  }
View Full Code Here

      super(solrOperations, solrQueryMethod);
    }

    @Override
    protected Query createQuery(SolrParameterAccessor parameterAccessor) {
      return new SimpleQuery(new SimpleStringCriteria("fake:query"));
    }
View Full Code Here

  private void deleteAll() {
    SolrOperations template;
    try {
      template = createSolrTemplate();
      template.delete(new SimpleQuery(new SimpleStringCriteria("*:*")));
      template.commit();
    } catch (IOException e) {
      throw new RuntimeException(e);
    } catch (ParserConfigurationException e) {
      throw new RuntimeException(e);
View Full Code Here

    Assert.assertEquals(options.getFragsize().intValue(), solrQuery.getHighlightFragsize());
  }

  @Test
  public void testConstructSorlQueryWithHighlightOptionFormatter() {
    SimpleHighlightQuery query = new SimpleHighlightQuery(new SimpleStringCriteria("field_1:value_1"));
    HighlightOptions options = new HighlightOptions();
    options.setFormatter("formatter");
    query.setHighlightOptions(options);

    SolrQuery solrQuery = queryParser.constructSolrQuery(query);
View Full Code Here

    Assert.assertEquals(options.getFormatter(), solrQuery.getParams(HighlightParams.FORMATTER)[0]);
  }

  @Test
  public void testConstructSorlQueryWithHighlightOptionNrSnipplets() {
    SimpleHighlightQuery query = new SimpleHighlightQuery(new SimpleStringCriteria("field_1:value_1"));
    HighlightOptions options = new HighlightOptions();
    options.setNrSnipplets(10);
    query.setHighlightOptions(options);

    SolrQuery solrQuery = queryParser.constructSolrQuery(query);
View Full Code Here

    Assert.assertEquals(options.getNrSnipplets().intValue(), solrQuery.getHighlightSnippets());
  }

  @Test
  public void testConstructSorlQueryWithHighlightOptionsAndAnySolrParameter() {
    SimpleHighlightQuery query = new SimpleHighlightQuery(new SimpleStringCriteria("field_1:value_1"));
    HighlightOptions options = new HighlightOptions();
    options.addHighlightParameter(HighlightParams.SIMPLE_PRE, "{pre}");
    query.setHighlightOptions(options);

    SolrQuery solrQuery = queryParser.constructSolrQuery(query);
View Full Code Here

        solrQuery.getHighlightSimplePre());
  }

  @Test
  public void testConstructSorlQueryWithFieldSpecificHighlightOptions() {
    SimpleHighlightQuery query = new SimpleHighlightQuery(new SimpleStringCriteria("field_1:value_1"));
    HighlightOptions options = new HighlightOptions();

    HighlightOptions.FieldWithHighlightParameters fieldWithHighlightParameters = new HighlightOptions.FieldWithHighlightParameters(
        "field_2");
    fieldWithHighlightParameters.setFormatter("formatter");
View Full Code Here

TOP

Related Classes of org.springframework.data.solr.core.query.SimpleStringCriteria

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.