-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 6.1.1 CE GA2, 6.1.20 EE GA2
-
Fix Version/s: 6.1.2 CE GA3, 6.1.30 EE GA3, 6.2.0 CE M6
-
Component/s: Legacy Components, Legacy Components > API
-
Environment:LIFERAY VERSION: 6.1 GA2
OPERATING SYSTEM: Windows Server 2008
APPLICATION SERVER: Tomcat 7.0
JAVA VIRTUAL MACHINE: Java 6
DATABASE: SQL Server 2008 R2
-
Branch Version/s:6.1.x
-
Backported to Branch:Committed
-
Epic/Theme:
-
Story Points:6
-
Git Pull Request:
Use the following code
String defaultAssetcategoryIds = "1693623,1693624,1693625"; List<Document> documents = null; SearchContext searchContext = SearchContextFactory.getInstance(origrequest); searchContext.setCompanyId(themeDisplay.getCompanyId()); searchContext.setGroupIds(new long[] {themeDisplay.getScopeGroupId()}); searchContext.setLocale(themeDisplay.getLocale()); searchContext.setTimeZone(themeDisplay.getTimeZone()); searchContext.setKeywords(q); searchContext.setAssetCategoryIds(StringUtil.split(defaultAssetcategoryIds,0L)); searchContext.setEnd(20); searchContext.setStart(0); String[] entryCalssName = {JournalArticle.class.getName()}; searchContext.setEntryClassNames(entryCalssName); Hits hits = indexer.search(searchContext); documents = hits.toList();
in a portlet and notice that ALL documents return and not just the ones specified via AssetCategoryIds.
NOTE: Categories will need to be created and their IDs will need to be played in defaultAssetcategoryIds
- is related to
-
LPE-8977 searchContext does apply certain facets to query
-
- Closed
-