private static IndexingMode defineIndexingMode(SearchConfiguration cfg) { String indexingStrategy = cfg.getProperties().getProperty( Environment.INDEXING_STRATEGY, IndexingMode.EVENT.toExternalRepresentation() ); return IndexingMode.fromExternalRepresentation( indexingStrategy ); }
/** * Returns the {@link IndexingMode} matching the given external representation as specified via * {@link org.hibernate.search.cfg.Environment#INDEXING_STRATEGY} * @param indexingMode the indexing mode external representation * @return the {@link IndexingMode} */ public static IndexingMode fromExternalRepresentation(String indexingMode) { if ( EVENT.toExternalRepresentation().equals( indexingMode ) ) { return IndexingMode.EVENT; } else if ( MANUAL.toExternalRepresentation().equals( indexingMode ) ) { return IndexingMode.MANUAL; } else { throw LOG.unknownIndexingMode( indexingMode ); } }
/** * Returns the {@link IndexingMode} matching the given external representation as specified via * {@link org.hibernate.search.cfg.Environment#INDEXING_STRATEGY} * @param indexingMode the indexing mode external representation * @return the {@link IndexingMode} */ public static IndexingMode fromExternalRepresentation(String indexingMode) { if ( EVENT.toExternalRepresentation().equals( indexingMode ) ) { return IndexingMode.EVENT; } else if ( MANUAL.toExternalRepresentation().equals( indexingMode ) ) { return IndexingMode.MANUAL; } else { throw LOG.unknownIndexingMode( indexingMode ); } }
private static IndexingMode defineIndexingMode(SearchConfiguration cfg) { String indexingStrategy = cfg.getProperties().getProperty( Environment.INDEXING_STRATEGY, IndexingMode.EVENT.toExternalRepresentation() ); return IndexingMode.fromExternalRepresentation( indexingStrategy ); }
@Override public void configure(Map<String,Object> cfg) { // See createObject() cfg.put( Environment.INDEXING_STRATEGY, IndexingMode.MANUAL.toExternalRepresentation() ); // explicitly set the backend even though local is default. cfg.put( "hibernate.search.default." + Environment.WORKER_BACKEND, "local" ); }
@Override public void configure(Map<String,Object> cfg) { // See createObject() cfg.put( Environment.INDEXING_STRATEGY, IndexingMode.MANUAL.toExternalRepresentation() ); // JGroups configuration for master node cfg.put( "hibernate.search.default." + Environment.WORKER_BACKEND, "jgroupsMaster" ); cfg.put( DispatchMessageSender.CLUSTER_NAME, CHANNEL_NAME ); cfg.put( DispatchMessageSender.CONFIGURATION_FILE, "testing-flush-loopback.xml" ); }