List of usage examples for com.liferay.portal.kernel.search SearchContext setLike
public void setLike(boolean like)
From source file:com.liferay.asset.internal.util.AssetHelperImpl.java
License:Open Source License
private AssetSearcher _getAssetSearcher(SearchContext searchContext, AssetEntryQuery assetEntryQuery, int start, int end) throws Exception { Indexer<?> searcher = AssetSearcher.getInstance(); AssetSearcher assetSearcher = (AssetSearcher) searcher; assetSearcher.setAssetEntryQuery(assetEntryQuery); Layout layout = assetEntryQuery.getLayout(); if (layout != null) { searchContext.setAttribute(Field.LAYOUT_UUID, layout.getUuid()); }//from w ww. j av a 2 s . com String ddmStructureFieldName = (String) assetEntryQuery.getAttribute("ddmStructureFieldName"); Serializable ddmStructureFieldValue = assetEntryQuery.getAttribute("ddmStructureFieldValue"); if (Validator.isNotNull(ddmStructureFieldName) && Validator.isNotNull(ddmStructureFieldValue)) { searchContext.setAttribute("ddmStructureFieldName", ddmStructureFieldName); searchContext.setAttribute("ddmStructureFieldValue", ddmStructureFieldValue); } String paginationType = GetterUtil.getString(assetEntryQuery.getPaginationType(), "more"); if (!paginationType.equals("none") && !paginationType.equals("simple")) { searchContext.setAttribute("paginationType", paginationType); } searchContext.setClassTypeIds(assetEntryQuery.getClassTypeIds()); searchContext.setEnd(end); searchContext.setGroupIds(assetEntryQuery.getGroupIds()); if (Validator.isNull(assetEntryQuery.getKeywords())) { QueryConfig queryConfig = searchContext.getQueryConfig(); queryConfig.setScoreEnabled(false); } else { searchContext.setLike(true); } searchContext.setSorts(_getSorts(assetEntryQuery, searchContext.getLocale())); searchContext.setStart(start); return assetSearcher; }