Created
April 19, 2013 15:43
-
-
Save nshaw/5421190 to your computer and use it in GitHub Desktop.
List the indexers defined for the Document Library Portlet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.liferay.portal.kernel.search.Indexer | |
import com.liferay.portal.kernel.search.IndexerPostProcessor | |
import com.liferay.portal.model.Portlet | |
import com.liferay.portal.service.CompanyLocalServiceUtil | |
import com.liferay.portal.service.PortletLocalServiceUtil | |
try { | |
String portletId = "20"; //Document Library | |
long companyId = CompanyLocalServiceUtil.getCompanies().get(0).getCompanyId(); | |
Portlet portlet = PortletLocalServiceUtil.getPortletById( | |
companyId, portletId); | |
println "Portlet: " + portlet | |
List<Indexer> indexers = portlet.getIndexerInstances(); | |
for (Indexer indexer : indexers) { | |
println "Indexer: engineId:" + indexer.searchEngineId + ", " + indexer | |
IndexerPostProcessor[] processors = indexer.getIndexerPostProcessors() | |
for (IndexerPostProcessor processor : processors) { | |
println "Post processor: " + processor | |
} | |
} | |
} | |
catch (Exception e) { | |
println "Script failed " + e | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment