throws Exception { searchContext.setAttribute("relatedClassName", Boolean.TRUE); searchContext.setAttribute("relatedClassName", Boolean.FALSE);
searchContext.setAttribute( "relatedEntryClassNames", getSearchClassNames());
protected SearchContext buildSearchContext( long groupId, long userId, long creatorUserId, int status, int start, int end) throws PortalException { SearchContext searchContext = new SearchContext(); searchContext.setAttribute(Field.STATUS, status); searchContext.setAttribute("paginationType", "none"); if (creatorUserId > 0) { searchContext.setAttribute( Field.USER_ID, String.valueOf(creatorUserId)); } Group group = groupLocalService.getGroup(groupId); searchContext.setCompanyId(group.getCompanyId()); searchContext.setEnd(end); searchContext.setGroupIds(new long[] {groupId}); searchContext.setSorts(new Sort(Field.MODIFIED_DATE, true)); searchContext.setStart(start); searchContext.setUserId(userId); return searchContext; }
request); searchContext.setAttribute("paginationType", "more");
@Override public void contribute( SearchContext searchContext, SearchContextContributorHelper searchContextContributorHelper) { String[] fullQueryEntryClassNames = searchContext.getFullQueryEntryClassNames(); if (ArrayUtil.isNotEmpty(fullQueryEntryClassNames)) { searchContext.setAttribute( "relatedEntryClassNames", searchContextContributorHelper.getSearchClassNames()); } String[] entryClassNames = ArrayUtil.append( searchContextContributorHelper.getSearchClassNames(), fullQueryEntryClassNames); searchContext.setEntryClassNames(entryClassNames); }
searchContext.setAttribute( "searchPermissionContext", _NULL_SEARCH_PERMISSION_CONTEXT); searchContext.setAttribute( "searchPermissionContext", searchPermissionContext);
@Override public BooleanQuery getQuery(SearchContext searchContext) { searchContext.setSearchEngineId( _modelSearchSettings.getSearchEngineId()); _resetFullQuery(searchContext); String[] fullQueryEntryClassNames = searchContext.getFullQueryEntryClassNames(); if (ArrayUtil.isNotEmpty(fullQueryEntryClassNames)) { searchContext.setAttribute( "relatedEntryClassNames", _modelSearchSettings.getSearchClassNames()); } String[] entryClassNames = ArrayUtil.append( _modelSearchSettings.getSearchClassNames(), fullQueryEntryClassNames); searchContext.setEntryClassNames(entryClassNames); contributeSearchContext(searchContext); Map<String, Indexer<?>> entryClassNameIndexerMap = _getEntryClassNameIndexerMap( entryClassNames, searchContext.getSearchEngineId()); BooleanFilter booleanFilter = new BooleanFilter(); _addPreFilters(booleanFilter, entryClassNameIndexerMap, searchContext); BooleanQuery fullQuery = createFullQuery(booleanFilter, searchContext); fullQuery.setQueryConfig(searchContext.getQueryConfig()); return fullQuery; }
_request); searchContext.setAttribute("paginationType", "more"); searchContext.setCategoryIds(categoryIdsArray); searchContext.setEnd(searchContainer.getEnd());
_request); searchContext.setAttribute("paginationType", "more"); searchContext.setCategoryIds(categoryIdsArray); searchContext.setEnd(searchContainer.getEnd());