@Test public void createQuery_HIGHLIGHTING() { when(criteriaTransformer.transformCriteria(any())).thenReturn("*:*"); SolrQuery solrQuery = queryFactory.createQuery(new JudgmentCriteria(), null); assertTrue(solrQuery.getHighlight()); assertEquals("<highlight>", solrQuery.getHighlightSimplePre()); assertEquals("</highlight>", solrQuery.getHighlightSimplePost()); assertEquals(2, solrQuery.getHighlightFields().length); assertEquals("firstContent", solrQuery.getHighlightFields()[0]); assertEquals("secondContent", solrQuery.getHighlightFields()[1]); assertEquals("50", solrQuery.getFieldParam("firstContent", HighlightParams.FRAGSIZE)); assertEquals("2", solrQuery.getFieldParam("firstContent", HighlightParams.SNIPPETS)); assertEquals("200", solrQuery.getFieldParam("secondContent", HighlightParams.FRAGSIZE)); assertEquals("5", solrQuery.getFieldParam("secondContent", HighlightParams.SNIPPETS)); }
@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);  }