System.out.println(result.getMimeType() + ": Mime Type"); System.out.println(result.getPath() + ": Path"); System.out.println(result.getFormat() + ": Format");
System.out.println(result.getMimeType() + ": Mime Type"); System.out.println(result.getPath() + ": Path"); System.out.println(result.getFormat() + ": Format");
System.out.println(result.getMimeType() + ": Mime Type"); System.out.println(result.getPath() + ": Path"); System.out.println(result.getFormat() + ": Format");
private void checkResults(SearchHandle results) { assertNotNull(results); assertFalse(results.getMetrics().getTotalTime() == -1); MatchDocumentSummary[] summaries = results.getMatchResults(); assertNotNull(summaries); assertTrue(summaries.length > 0); for (MatchDocumentSummary summary : summaries) { assertTrue("Mime type of document", summary.getMimeType().matches("(application|text)/xml")); assertEquals("Format of document", Format.XML, summary.getFormat()); Document relevanceTrace = summary.getRelevanceInfo(); if (relevanceTrace != null) { assertEquals(relevanceTrace.getDocumentElement().getLocalName(),"relevance-info"); } MatchLocation[] locations = summary.getMatchLocations(); for (MatchLocation location : locations) { assertNotNull(location.getAllSnippetText()); } } }
private void checkCts(CtsQueryWriteHandle handle, String optionsName, long numMatches) { RawCtsQueryDefinition rawCtsQueryDefinition; if (optionsName == null) { rawCtsQueryDefinition = queryMgr.newRawCtsQueryDefinition(handle); } else { rawCtsQueryDefinition = queryMgr.newRawCtsQueryDefinition(handle, optionsName); } SearchHandle results; results = queryMgr.search(rawCtsQueryDefinition, new SearchHandle()); assertNotNull(results); assertEquals(results.getTotalResults(), numMatches); assertFalse(results.getMetrics().getTotalTime() == -1); MatchDocumentSummary[] summaries = results.getMatchResults(); assertNotNull(summaries); assertTrue(summaries.length > 0); for (MatchDocumentSummary summary : summaries) { assertTrue("Mime type of document", summary.getMimeType().matches("(application|text)/xml")); assertEquals("Format of document", Format.XML, summary.getFormat()); MatchLocation[] locations = summary.getMatchLocations(); for (MatchLocation location : locations) { assertNotNull(location.getAllSnippetText()); } } }