public ImmutableSearchFactory(SearchFactoryState state) {
    this.analyzers = state.getAnalyzers();
    this.cacheBitResultsSize = state.getCacheBitResultsSize();
    this.configurationProperties = state.getConfigurationProperties();
    this.indexBindingForEntities = state.getIndexBindings();
    this.documentBuildersContainedEntities = state.getDocumentBuildersContainedEntities();
    this.filterCachingStrategy = state.getFilterCachingStrategy();
    this.filterDefinitions = state.getFilterDefinitions();
    this.indexHierarchy = state.getIndexHierarchy();
    this.indexingMode = state.getIndexingMode();
    this.worker = state.getWorker();
    this.serviceManager = state.getServiceManager();
    this.transactionManagerExpected = state.isTransactionManagerExpected();
    this.allIndexesManager = state.getAllIndexesManager();
    this.errorHandler = state.getErrorHandler();
    this.instanceInitializer = state.getInstanceInitializer();
    this.timeoutExceptionFactory = state.getDefaultTimeoutExceptionFactory();
    this.timingSource = state.getTimingSource();
    this.mapping = state.getProgrammaticMapping();
    if (state.getStatistics() == null) {
      this.statistics = new StatisticsImpl(this);
      boolean statsEnabled =
          ConfigurationParseHelper.getBooleanValue(
              configurationProperties, Environment.GENERATE_STATS, false);
      this.statistics.setStatisticsEnabled(statsEnabled);
    } else {
      this.statistics = (StatisticsImpl) state.getStatistics();
    }
    this.indexMetadataIsComplete = state.isIndexMetadataComplete();
    this.isDeleteByTermEnforced = state.isDeleteByTermEnforced();
    this.isIdProvidedImplicit = state.isIdProvidedImplicit();
    this.indexManagerFactory = state.getIndexManagerFactory();

    this.enableDirtyChecks =
        ConfigurationParseHelper.getBooleanValue(
            configurationProperties, Environment.ENABLE_DIRTY_CHECK, true);

    if (isJMXEnabled()) {
      this.statisticsMBeanName = registerMBeans();
    } else {
      this.statisticsMBeanName = null;
    }

    this.indexReaderAccessor = new DefaultIndexReaderAccessor(this);
    this.indexedTypeDescriptors = new ConcurrentHashMap<>();

    this.defaultObjectLookupMethod = determineDefaultObjectLookupMethod();
    this.defaultDatabaseRetrievalMethod = determineDefaultDatabaseRetrievalMethod();
    this.enlistWorkerInTransaction =
        ConfigurationParseHelper.getBooleanValue(
            configurationProperties, Environment.WORKER_ENLIST_IN_TRANSACTION, false);

    this.indexUninvertingAllowed =
        ConfigurationParseHelper.getBooleanValue(
            configurationProperties, Environment.INDEX_UNINVERTING_ALLOWED, true);
  }
 @Override
 public void initialize(
     Properties props, WorkerBuildContext context, QueueingProcessor queueingProcessor) {
   this.queueingProcessor = queueingProcessor;
   this.factory = context.getUninitializedSearchIntegrator();
   this.transactionExpected = context.isTransactionManagerExpected();
   this.instanceInitializer = context.getInstanceInitializer();
   this.enlistInTransaction =
       ConfigurationParseHelper.getBooleanValue(
           props, Environment.WORKER_ENLIST_IN_TRANSACTION, false);
 }