本文整理匯總了Java中com.hp.autonomy.hod.client.api.textindex.query.search.Print類的典型用法代碼示例。如果您正苦於以下問題:Java Print類的具體用法?Java Print怎麽用?Java Print使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Print類屬於com.hp.autonomy.hod.client.api.textindex.query.search包,在下文中一共展示了Print類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getDocumentContent
import com.hp.autonomy.hod.client.api.textindex.query.search.Print; //導入依賴的package包/類
@SuppressWarnings("SpringCacheableComponentsInspection")
@Cacheable(value = CacheNames.GET_DOCUMENT_CONTENT, cacheResolver = CachingConfiguration.PER_USER_CACHE_RESOLVER_NAME)
@Override
public List<HodSearchResult> getDocumentContent(final HodGetContentRequest request) throws HodErrorException {
final List<HodSearchResult> contentResults = new ArrayList<>();
for(final GetContentRequestIndex<ResourceName> indexAndReferences : request.getIndexesAndReferences()) {
final GetContentRequestBuilder builder = new GetContentRequestBuilder()
.setPrint(request.getPrint())
.setSummary(Summary.concept)
.setSecurityInfo(authenticationRetriever.getPrincipal().getSecurityInfo());
if(request.getPrint() == Print.fields) {
builder.setPrintFields(documentFieldsService.getPrintFields(Collections.emptyList()));
}
final List<HodSearchResult> documents = getContentService.getContent(new ArrayList<>(indexAndReferences.getReferences()), indexAndReferences.getIndex(), builder).getDocuments();
addDomainToSearchResults(contentResults, Collections.singleton(indexAndReferences.getIndex()), documents);
}
return contentResults;
}
示例2: constructObject
import com.hp.autonomy.hod.client.api.textindex.query.search.Print; //導入依賴的package包/類
@Override
protected SuggestRequest<HodQueryRestrictions> constructObject() {
return HodSuggestRequestImpl.<ResourceName>builder()
.reference("REFERENCE")
.queryRestrictions(HodQueryRestrictionsImpl.builder()
.queryText("*")
.fieldText("NOT(EMPTY):{FIELD}")
.database(ResourceName.WIKI_ENG)
.minDate(ZonedDateTime.parse("2016-11-15T16:07:00Z[UTC]"))
.maxDate(ZonedDateTime.parse("2016-11-15T16:07:01Z[UTC]"))
.minScore(5)
.languageType("englishUtf8")
.anyLanguage(false)
.build())
.start(1)
.maxResults(50)
.summary(Summary.concept.name())
.summaryCharacters(250)
.sort(Sort.relevance.name())
.highlight(true)
.print(Print.fields.name())
.printField("CATEGORY")
.build();
}
示例3: constructObject
import com.hp.autonomy.hod.client.api.textindex.query.search.Print; //導入依賴的package包/類
@Override
protected HodQueryRequest constructObject() {
return HodQueryRequestImpl.<ResourceName>builder()
.queryRestrictions(HodQueryRestrictionsImpl.builder()
.queryText("*")
.fieldText("NOT(EMPTY):{FIELD}")
.database(ResourceName.WIKI_ENG)
.minDate(ZonedDateTime.parse("2016-11-15T16:07:00Z[UTC]"))
.maxDate(ZonedDateTime.parse("2016-11-15T16:07:01Z[UTC]"))
.minScore(5)
.languageType("englishUtf8")
.anyLanguage(false)
.build())
.start(1)
.maxResults(50)
.summary(Summary.concept.name())
.summaryCharacters(250)
.sort(Sort.relevance.name())
.highlight(true)
.autoCorrect(true)
.print(Print.fields.name())
.printField("CATEGORY")
.queryType(QueryRequest.QueryType.MODIFIED)
.build();
}
示例4: testGetContentWithReference
import com.hp.autonomy.hod.client.api.textindex.query.search.Print; //導入依賴的package包/類
@Test
public void testGetContentWithReference() throws HodErrorException {
final GetContentRequestBuilder params = new GetContentRequestBuilder()
.setPrint(Print.all);
final QueryResults<Document> documents = getContentService.getContent(
getTokenProxy(),
Collections.singletonList("f6eef7b0-eb5c-4458-a22d-faadb4785539"),
getPrivateIndex(),
params
);
final List<Document> documentList = documents.getDocuments();
assertThat(documentList, hasSize(1));
final Document document0 = documentList.get(0);
assertThat(document0.getTitle(), is("DOCUMENT FOR GET CONTENT"));
}
示例5: export
import com.hp.autonomy.hod.client.api.textindex.query.search.Print; //導入依賴的package包/類
@Override
protected void export(final OutputStream outputStream,
final HodQueryRequest queryRequest,
final Collection<String> selectedFieldNames) throws HodErrorException, IOException {
final HodQueryRequest queryRequestForCount = queryRequest.toBuilder()
.maxResults(1)
.print(Print.no_results.name())
.build();
final Documents<HodSearchResult> searchResult = documentsService.queryTextIndex(queryRequestForCount);
final int totalResults = Math.min(Math.min(searchResult.getTotalResults(), queryRequest.getMaxResults()), HodDocumentsService.HOD_MAX_RESULTS);
final ExportFormat exportFormat = getExportFormat();
final PlatformDataExportService<HodQueryRequest, HodErrorException> exportService = exportServiceFactory.getPlatformDataExportService(exportFormat)
.orElseThrow(() -> new UnsupportedOperationException("Query result export not supported for format " + exportFormat.name()));
exportService.exportQueryResults(outputStream, queryRequest, exportFormat, selectedFieldNames, totalResults);
}
示例6: setQueryParams
import com.hp.autonomy.hod.client.api.textindex.query.search.Print; //導入依賴的package包/類
private QueryRequestBuilder setQueryParams(final HodSearchRequest searchRequest, final boolean setQueryProfile) {
final String profileName = configService.getConfig().getQueryManipulation().getProfile();
final Print print = Optional.ofNullable(searchRequest.getPrint()).map(Print::valueOf).orElse(null);
final QueryRequestBuilder queryRequestBuilder = new QueryRequestBuilder()
.setAbsoluteMaxResults(Math.min(searchRequest.getMaxResults(), HOD_MAX_RESULTS))
.setSummary(Optional.ofNullable(searchRequest.getSummary()).map(Summary::valueOf).orElse(null))
.setStart(searchRequest.getStart())
.setMaxPageResults(searchRequest.getMaxResults() - searchRequest.getStart() + 1)
.setTotalResults(true)
.setIndexes(searchRequest.getQueryRestrictions().getDatabases())
.setFieldText(searchRequest.getQueryRestrictions().getFieldText())
.setSort(Optional.ofNullable(searchRequest.getSort()).map(Sort::valueOf).orElse(null))
.setMinDate(zonedDateTimeToJodaTime(searchRequest.getQueryRestrictions().getMinDate()))
.setMaxDate(zonedDateTimeToJodaTime(searchRequest.getQueryRestrictions().getMaxDate()))
.setPrint(print)
.setMinScore(searchRequest.getQueryRestrictions().getMinScore())
.setSecurityInfo(authenticationRetriever.getPrincipal().getSecurityInfo());
if(print == Print.fields) {
queryRequestBuilder.setPrintFields(documentFieldsService.getPrintFields(searchRequest.getPrintFields()));
}
if(searchRequest.isHighlight()) {
queryRequestBuilder
.setHighlight(Highlight.terms)
.setStartTag(HIGHLIGHT_START_TAG)
.setEndTag(HIGHLIGHT_END_TAG);
}
if(setQueryProfile) {
queryRequestBuilder.setQueryProfile(new ResourceName(getDomain(), profileName));
}
return queryRequestBuilder;
}
示例7: constructObject
import com.hp.autonomy.hod.client.api.textindex.query.search.Print; //導入依賴的package包/類
@Override
protected HodGetContentRequest constructObject() {
return HodGetContentRequestImpl.builder()
.indexAndReferences(new HodGetContentRequestIndexImpl(ResourceName.WIKI_ENG, Collections.singleton("Reference1")))
.print(Print.fields)
.build();
}
示例8: addParams
import com.hp.autonomy.hod.client.api.textindex.query.search.Print; //導入依賴的package包/類
@Override
protected void addParams(final QueryRequestBuilder<HodQueryRequest, HodQueryRestrictions, ?> queryRequestBuilder) {
queryRequestBuilder.print(Print.no_results.name());
}
示例9: addParams
import com.hp.autonomy.hod.client.api.textindex.query.search.Print; //導入依賴的package包/類
@Override
protected void addParams(final GetContentRequestBuilder<HodGetContentRequest, HodGetContentRequestIndex, ?> request) {
((HodGetContentRequestBuilder) request)
.print(Print.all);
}
示例10: getPrint
import com.hp.autonomy.hod.client.api.textindex.query.search.Print; //導入依賴的package包/類
/**
* What to display in the document result output
*
* @return What to display in the document result output
*/
Print getPrint();