@Test public void createQuery_SORTING() { JudgmentCriteria criteria = new JudgmentCriteria(); Paging paging = new Paging(0, 10, Sorting.relevanceSorting()); when(criteriaTransformer.transformCriteria(any())).thenReturn("*:*"); SolrQuery solrQuery = queryFactory.createQuery(criteria, paging); assertEquals("score desc", solrQuery.getSortField()); }
@Override public SolrQuery createQuery(C criteria, Paging paging) { SolrQuery query = new SolrQuery(); String queryString = criteriaTransformer.transformCriteria(criteria); query.setQuery(queryString); applyPaging(query, paging); applySorting(query, paging); applyHighlighting(query); return query; }
SearchQueryFactoryImpl implements SearchQueryFactory<C> { @Override public SolrQuery createQuery(C criteria, Paging paging) { SolrQuery query = new SolrQuery(); String queryString = criteriaTransformer.transformCriteria(criteria); query.setQuery(queryString); applyPaging(query, paging); applySorting(query, paging); applyHighlighting(query); return query; } }
SearchQueryFactoryImpl implements SearchQueryFactory<C> { @Override public SolrQuery createQuery(C criteria, Paging paging) { SolrQuery query = new SolrQuery(); String queryString = criteriaTransformer.transformCriteria(criteria); query.setQuery(queryString); applyPaging(query, paging); applySorting(query, paging); applyHighlighting(query); return query; }  }
SearchQueryFactoryImpl implements SearchQueryFactory<C> { @Override public SolrQuery createQuery(C criteria, Paging paging) { SolrQuery query = new SolrQuery(); String queryString = criteriaTransformer.transformCriteria(criteria); query.setQuery(queryString); applyPaging(query, paging); applySorting(query, paging); applyHighlighting(query); return query; }  @Override SolrQuery createQuery(C criteria, Paging paging); void setCriteriaTransformer(CriteriaTransformer<C> criteriaTransformer); void setHighlightParams(HighlightingParams highlightParams); }
SearchQueryFactoryImpl implements SearchQueryFactory<C> { @Override public SolrQuery createQuery(C criteria, Paging paging) { SolrQuery query = new SolrQuery(); String queryString = criteriaTransformer.transformCriteria(criteria); query.setQuery(queryString); applyPaging(query, paging); applySorting(query, paging); applyHighlighting(query); return query; }  @Override SolrQuery createQuery(C criteria, Paging paging); void setCriteriaTransformer(CriteriaTransformer<C> criteriaTransformer); void setHighlightParams(HighlightingParams highlightParams);  }