}
private void createCleanFactoryState(SearchConfiguration cfg, BuildContext buildContext) {
if ( rootFactory == null ) {
//set the mutable structure of factory state
rootFactory = new MutableSearchFactory();
factoryState.setDocumentBuildersIndexedEntities( new ConcurrentHashMap<Class<?>, EntityIndexBinding>() );
factoryState.setDocumentBuildersContainedEntities( new ConcurrentHashMap<Class<?>, DocumentBuilderContainedEntity<?>>() );
factoryState.setFilterDefinitions( new ConcurrentHashMap<String, FilterDef>() );
factoryState.setIndexHierarchy( new PolymorphicIndexHierarchy() );
factoryState.setConfigurationProperties( cfg.getProperties() );