Details

    • Branch Version/s:
      6.1.x
    • Backported to Branch:
      Committed
    • Epic/Theme:
    • Story Points:
      6

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  3 years, 47 weeks, 2 days ago