use of org.springframework.data.solr.core.query.SimpleQuery in project nixmash-blog by mintster.
the class SolrLocationTests method tearDown.
@After
public void tearDown() {
Query query = new SimpleQuery(new SimpleStringCriteria("cat:test"));
solrOperations.delete(query);
solrOperations.commit();
}
use of org.springframework.data.solr.core.query.SimpleQuery in project nixmash-blog by mintster.
the class CustomPostDocRepositoryImpl method quickSearch.
@Override
public List<PostDoc> quickSearch(String searchTerms) {
logger.debug("Searching Title and Body with Multiple Terms : {}", searchTerms);
Query query = new SimpleQuery(titleAndBodyCriteria(searchTerms));
query.setRows(1000);
Page<PostDoc> results = solrTemplate.queryForPage(query, PostDoc.class);
return results.getContent();
}
use of org.springframework.data.solr.core.query.SimpleQuery in project nixmash-blog by mintster.
the class CustomPostDocRepositoryImpl method pagedQuickSearch.
@Override
public Page<PostDoc> pagedQuickSearch(String searchTerms, PageRequest pageRequest) {
logger.debug("Paged Title and Body Quick Search with : {}", searchTerms);
Query query = new SimpleQuery(titleAndBodyCriteria(searchTerms));
query.setRows(1000);
query.setPageRequest(pageRequest);
Page<PostDoc> results = solrTemplate.queryForPage(query, PostDoc.class);
return results;
}
use of org.springframework.data.solr.core.query.SimpleQuery in project nixmash-blog by mintster.
the class CustomPostDocRepositoryImpl method fullSearch.
@Override
public List<PostDoc> fullSearch(PostQueryDTO postQueryDTO) {
Query query = new SimpleQuery(postQueryDTO.getQuery());
if (!postQueryDTO.getPostType().equals(PostType.UNDEFINED)) {
query.addFilterQuery(new SimpleQuery(new Criteria(IPostDoc.POST_TYPE).is(postQueryDTO.getPostType())));
}
query.addFilterQuery(new SimpleQuery(new Criteria(IPostDoc.DOCTYPE).is(SolrDocType.POST)));
query.setRows(1000);
Page<PostDoc> results = solrTemplate.queryForPage(query, PostDoc.class);
return results.getContent();
}
use of org.springframework.data.solr.core.query.SimpleQuery in project nixmash-blog by mintster.
the class CustomPostDocRepositoryImpl method pagedFullSearch.
@Override
public Page<PostDoc> pagedFullSearch(PostQueryDTO postQueryDTO, PageRequest pageRequest) {
Query query = new SimpleQuery(postQueryDTO.getQuery());
if (!postQueryDTO.getPostType().equals(PostType.UNDEFINED)) {
query.addFilterQuery(new SimpleQuery(new Criteria(IPostDoc.POST_TYPE).is(postQueryDTO.getPostType())));
}
query.addFilterQuery(new SimpleQuery(new Criteria(IPostDoc.DOCTYPE).is(SolrDocType.POST)));
query.setRows(1000);
query.setPageRequest(pageRequest);
Page<PostDoc> results = solrTemplate.queryForPage(query, PostDoc.class);
return results;
}
Aggregations