當前位置: 首頁>>代碼示例>>Java>>正文


Java Print類代碼示例

本文整理匯總了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;
}
 
開發者ID:hpe-idol,項目名稱:haven-search-components,代碼行數:23,代碼來源:HodDocumentsServiceImpl.java

示例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();
}
 
開發者ID:hpe-idol,項目名稱:haven-search-components,代碼行數:25,代碼來源:HodSuggestRequestTest.java

示例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();
}
 
開發者ID:hpe-idol,項目名稱:haven-search-components,代碼行數:26,代碼來源:HodQueryRequestTest.java

示例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"));
}
 
開發者ID:hpe-idol,項目名稱:java-hod-client,代碼行數:21,代碼來源:GetContentServiceITCase.java

示例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);
}
 
開發者ID:hpe-idol,項目名稱:find,代碼行數:17,代碼來源:HodExportController.java

示例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;
}
 
開發者ID:hpe-idol,項目名稱:haven-search-components,代碼行數:37,代碼來源:HodDocumentsServiceImpl.java

示例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();
}
 
開發者ID:hpe-idol,項目名稱:haven-search-components,代碼行數:8,代碼來源:HodGetContentRequestTest.java

示例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());
}
 
開發者ID:hpe-idol,項目名稱:find,代碼行數:5,代碼來源:HodSavedQueryController.java

示例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);
}
 
開發者ID:hpe-idol,項目名稱:find,代碼行數:6,代碼來源:HodDocumentsController.java

示例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();
 
開發者ID:hpe-idol,項目名稱:haven-search-components,代碼行數:7,代碼來源:HodGetContentRequest.java


注:本文中的com.hp.autonomy.hod.client.api.textindex.query.search.Print類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。