use of org.nextprot.api.solr.QueryRequest in project nextprot-api by calipho-sib.
the class SolrServiceTest method shoulReturnSomeTermsWhenStopWordsAreIncludedInQuery.
@Test
public void shoulReturnSomeTermsWhenStopWordsAreIncludedInQuery() throws Exception {
QueryRequest qr;
Query q;
SearchResult result;
long numFound;
qr = new QueryRequest();
qr.setQuery("brain");
q = queryBuilderService.buildQueryForSearch(qr, "term");
result = service.executeQuery(q);
numFound = result.getFound();
// we should get some results
assertTrue(numFound > 0);
qr = new QueryRequest();
qr.setQuery("brain in the of");
q = queryBuilderService.buildQueryForSearch(qr, "term");
result = service.executeQuery(q);
numFound = result.getFound();
// we should ALSO get some results
assertTrue(numFound > 0);
}
use of org.nextprot.api.solr.QueryRequest in project nextprot-api by calipho-sib.
the class SolrServiceTest method shouldReturnResultsFromSimpleGoldEntryQuery.
@Test
public void shouldReturnResultsFromSimpleGoldEntryQuery() throws Exception {
QueryRequest qr = new QueryRequest();
qr.setQuality("GOLD");
qr.setQuery("MSH6");
Query q = queryBuilderService.buildQueryForSearch(qr, "entry");
SearchResult result = service.executeQuery(q);
assertEquals(73, result.getFound());
}
use of org.nextprot.api.solr.QueryRequest in project nextprot-api by calipho-sib.
the class SolrServiceTest method shouldReturnResultsFromSimpleTermQuery.
@Test
public void shouldReturnResultsFromSimpleTermQuery() throws Exception {
QueryRequest qr = new QueryRequest();
qr.setQuery("liver");
Query q = queryBuilderService.buildQueryForSearch(qr, "term");
SearchResult result = service.executeQuery(q);
assertEquals(1356, result.getFound());
}
use of org.nextprot.api.solr.QueryRequest in project nextprot-api by calipho-sib.
the class SolrServiceTest method shouldReturnResultsFromSimpleEntryQuery.
@Test
public void shouldReturnResultsFromSimpleEntryQuery() throws Exception {
QueryRequest qr = new QueryRequest();
qr.setQuery("MSH6");
Query q = queryBuilderService.buildQueryForSearch(qr, "entry");
SearchResult result = service.executeQuery(q);
assertEquals(101, result.getFound());
}
use of org.nextprot.api.solr.QueryRequest in project nextprot-api by calipho-sib.
the class ExportController method streamEntriesSubPart.
@RequestMapping(value = "/export/entries/{view}", method = { RequestMethod.GET })
public void streamEntriesSubPart(@PathVariable("view") String view, HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "query", required = false) String query, @RequestParam(value = "listId", required = false) String listId, @RequestParam(value = "queryId", required = false) String queryId, @RequestParam(value = "sparql", required = false) String sparql, @RequestParam(value = "chromosome", required = false) String chromosome, @RequestParam(value = "filter", required = false) String filter, @RequestParam(value = "sort", required = false) String sort, @RequestParam(value = "order", required = false) String order, @RequestParam(value = "quality", required = false) String quality) {
QueryRequest qr = buildQueryRequest(request, query, listId, queryId, sparql, chromosome, filter, quality, sort, order);
streamEntryService.streamQueriedEntries(qr, NextprotMediaType.valueOf(request), view, response);
}
Aggregations