code: protected Document createDocument(NodeDataIndexing node, NamespaceMappings nsMappings,
        IndexFormatVersion indexFormatVersion, boolean loadAllProperties, VolatileIndex volatileIndex) throws RepositoryException
     {
        NodeIndexer indexer =
           new NodeIndexer(node, getContext().getItemStateManager(), nsMappings, extractor);
        indexer.setSupportHighlighting(supportHighlighting);
        indexer.setIndexingConfiguration(indexingConfig);
        indexer.setIndexFormatVersion(indexFormatVersion);
        indexer.setLoadBatchingThreshold(indexingLoadBatchingThresholdProperty);
        indexer.setLoadPropertyByName(indexingLoadPropertyByName);
        indexer.setLoadAllProperties(loadAllProperties);
        Document doc = indexer.createDoc();
        mergeAggregatedNodeIndexes(node, doc, loadAllProperties, volatileIndex);
        return doc;
     }
docs: Creates a lucene <code>Document</code> for a node state using the
  namespace mappings <code>nsMappings</code>.
  
  @param node
  the node state to index.
  @param nsMappings
  the namespace mappings of the search index.
  @param indexFormatVersion
  the index format version that should be used to index the
  passed node state.
  @param loadAllProperties
  Indicates whether all the properties should be loaded using the method
  {@link ItemDataConsumer#getChildPropertiesData(org.exoplatform.services.jcr.datamodel.NodeData)}
  @return a lucene <code>Document</code> that contains all properties of
  <code>node</code>.
  @throws RepositoryException
  if an error occurs while indexing the <code>node</code>.