/** * Creates a "dummy" search index that is not linked to the search manager and has * a <code>null</code> name property that will be used for being filled with * the widget bean technology. <p> * * @return a "dummy" search index that is not linked to the search manager and has * a <code>null</code> name property that will be used for being filled with * the widget bean technology */ private CmsSearchIndex createDummySearchIndex() { CmsSearchIndex result = new CmsSearchIndex(); result.setLocale(Locale.ENGLISH); result.setProject("Online"); result.setRebuildMode("auto"); // find default source Map<String, CmsSearchIndexSource> sources = m_searchManager.getSearchIndexSources(); if (sources.isEmpty()) { CmsSearchIndexSource source = createDummyIndexSource(); sources.put(source.getName(), source); } result.addSourceName(sources.keySet().iterator().next()); return result; } }
/** * Sets the rebuild mode for the requested index. Allowing to disable indexing during module import.<p> * This setting will not be written to the XML configuration file and will only take effect within the current shell instance.<p> * * @param searchIndex the search index * @param mode the rebuild mode to set */ public void setIndexRebuildMode(String searchIndex, String mode) { CmsSearchIndex index = OpenCms.getSearchManager().getIndex(searchIndex); if (index != null) { index.setRebuildMode(mode); // required for this setting to take effect OpenCms.getSearchManager().initOfflineIndexes(); } }
index.setRebuildMode(CmsSearchIndex.REBUILD_MODE_MANUAL); index.setRebuildMode(CmsSearchIndex.REBUILD_MODE_OFFLINE);
index.setRebuildMode(CmsSearchIndex.REBUILD_MODE_MANUAL); index.setRebuildMode(CmsSearchIndex.REBUILD_MODE_OFFLINE);