use of com.tyndalehouse.step.core.models.search.SubjectHeadingSearchEntry in project step by STEPBible.
the class SubjectSearchServiceImpl method getResultsAsHeadings.
private SearchResult getResultsAsHeadings(SearchQuery sq, String[] searchableVersions, Key allTopics) {
final SearchResult headingsSearch = this.jswordSearch.getResultsFromTrimmedKeys(sq, searchableVersions, allTopics.getCardinality(), allTopics, HEADINGS_ONLY);
// build the results and then return
final SubjectHeadingSearchEntry headings = new SubjectHeadingSearchEntry();
headings.setHeadingsSearch(headingsSearch);
// return the results
final SearchResult sr = new SearchResult();
sr.addEntry(headings);
sr.setTotal(headingsSearch.getTotal());
sr.setTimeTookToRetrieveScripture(headingsSearch.getTimeTookToRetrieveScripture());
return sr;
}
use of com.tyndalehouse.step.core.models.search.SubjectHeadingSearchEntry in project step by STEPBible.
the class SearchServiceImplTest method testSubjectSearch.
/**
* test exact strong match
*/
@Test
public void testSubjectSearch() {
final SearchResult searchSubject = this.searchServiceUnderTest.search(new SearchQuery("sh=elijah", new String[] { "ESV_th" }, "false", 0, 1, 1, null));
final List<SearchEntry> entries = ((SubjectHeadingSearchEntry) searchSubject.getResults().get(0)).getHeadingsSearch().getResults();
for (final SearchEntry e : entries) {
LOGGER.debug(((VerseSearchEntry) e).getPreview());
}
assertTrue(searchSubject.getResults().size() > 0);
}
Aggregations