public void updateIndex ( ) { if ( ! isEnabled ( ) ) { return ; } final IndexWriterConfig indexWriterConfig = new IndexWriterConfig ( new StandardAnalyzer ( ) ) ; indexWriterConfig . setCommitOnClose ( true ) . setOpenMode ( IndexWriterConfig . OpenMode . CREATE_OR_APPEND ) ; try ( IndexWriter indexWriter = new IndexWriter ( directory , indexWriterConfig ) ) { final List < IPortletDefinition > portlets = portletRegistry . getAllPortletDefinitions ( ) ; portlets . forEach ( portlet -> indexPortlet ( portlet , indexWriter ) ) ; } catch ( Exception e ) { logger . error ( "Unable to update index" , e ) ; } }
Called by Quatrz .