掲示板
FacetedSearch get latest version of article
8年前 に sawi _ によって更新されました。
FacetedSearch get latest version of article
Regular Member 投稿: 165 参加年月日: 09/03/27 最新の投稿
Hi
I try search journal articles with FacetedSearch but I have one problem.
I get all version of article. How I can get only last approved version insted of all history version
Code:
Regards
sawi
I try search journal articles with FacetedSearch but I have one problem.
I get all version of article. How I can get only last approved version insted of all history version
Code:
String searchKeyword = "";
HttpServletRequest httpRequest = PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(request));
List<document> documents = null;
SearchContext searchContext = SearchContextFactory.getInstance(httpRequest);
searchContext.setKeywords(searchKeyword);
searchContext.setEnd(2000);
searchContext.setStart(0);
String[] entryCalssName = {JournalArticle.class.getName()};
searchContext.setEntryClassNames(entryCalssName);
MultiValueFacet assetTagsFacet = new MultiValueFacet(searchContext);
assetTagsFacet.setFieldName(Field.ASSET_TAG_NAMES);
searchContext.addFacet(assetTagsFacet);
searchContext.setAttribute("assetTagNames", "news");
Indexer indexer = FacetedSearcher.getInstance();
Hits hits;
hits = indexer.search(searchContext);
documents = hits.toList();
....
</document>
Regards
sawi
8年前 に Denis Signoretto によって更新されました。
RE: FacetedSearch get latest version of article
Expert 投稿: 375 参加年月日: 09/04/21 最新の投稿
Hi
JournalIndexer class set latest web contents with a "head" field.
You can get the latest versions of the web contents adding a required term "head" with value Boolean.TRUE
HTH,
Denis.
JournalIndexer class set latest web contents with a "head" field.
You can get the latest versions of the web contents adding a required term "head" with value Boolean.TRUE
HTH,
Denis.