public void execute ( IDocumentStore store , DocumentConventions conventions , String database ) { DocumentConventions oldConventions = getConventions ( ) ; try { setConventions ( ObjectUtils . firstNonNull ( conventions , getConventions ( ) , store . getConventions ( ) ) ) ; IndexDefinition indexDefinition = createIndexDefinition ( ) ; indexDefinition . setName ( getIndexName ( ) ) ; if ( lockMode != null ) { indexDefinition . setLockMode ( lockMode ) ; } if ( priority != null ) { indexDefinition . setPriority ( priority ) ; } store . maintenance ( ) . forDatabase ( ObjectUtils . firstNonNull ( database , store . getDatabase ( ) ) ) . send ( new PutIndexesOperation ( indexDefinition ) ) ; } finally { setConventions ( oldConventions ) ; } }
Executes the index creation against the specified document database using the specified conventions