search/indexer/mmm-search-indexer-api/src/main/java/net/sf/mmm/search/indexer/base/strategy/AbstractSearchIndexerUpdateStrategy.java
/**
   * This method starts the indexing from the given <code>directory</code>
   * adding the given <code>source</code> as metadata.
   * 
   * @see net.sf.mmm.search.api.SearchEntry#getSource()
   * 
   * @param arguments are the {@link UpdateStrategyArguments}.
   * @param location is the {@link SearchIndexerDataLocation}.
   * @param resource is the {@link BrowsableResource resource} (directory) to
   *        index recursively.
   * @param visitedResources is the {@link Set} with the
   *        {@link net.sf.mmm.util.resource.api.DataResource#getUri() URIs} of
   *        the {@link BrowsableResource resources} that have already been
   *        crawled.
   * @param entryUpdateVisitor is the {@link EntryUpdateVisitor}.
   * @param locationResource is the {@link BrowsableResource resource} for
   *        {@link SearchIndexerDataLocation#getLocationUri()} of the given
   *        <code>location</code>.
   */
This method starts the indexing from the given directory
adding the given source as metadata.



@param arguments are the  UpdateStrategyArguments.
@param location is the  SearchIndexerDataLocation.
@param resource is the  BrowsableResource resource (directory) to
index recursively.
@param visitedResources is the  Set with the
net.sf.mmm.util.resource.api.DataResource#getUri() URIs of
the  BrowsableResource resources that have already been
crawled.
This method starts the indexing from the given directory adding the given source as metadata . @param arguments are the UpdateStrategyArguments . @param location is the SearchIndexerDataLocation . @param resource is the BrowsableResource resource ( directory ) to index recursively . @param visitedResources is the Set with the net . sf . mmm . util . resource . api . DataResource#getUri () URIs of the BrowsableResource resources that have already been crawled .
public void indexRecursive(UpdateStrategyArguments arguments, SearchIndexerDataLocation location,
      BrowsableResource resource, Set<String> visitedResources,
      EntryUpdateVisitor entryUpdateVisitor, BrowsableResource locationResource) {
    String uri = resource.getUri();
    if (!visitedResources.contains(uri)) {
      visitedResources.add(uri);
      if (resource.isData()) {
        ChangeType changeType;
        if (isFullIndexing(arguments)) {
          changeType = ChangeType.ADD;
        } else {
          changeType = getChangeType(resource, arguments);
        }
        ResourceSearchIndexer resourceSearchIndexer = getIndexerDependencies()
            .getResourceSearchIndexer();
        resourceSearchIndexer.index(arguments.getIndexer(), resource, changeType, location,
            entryUpdateVisitor, locationResource, arguments.getOptions().getNonUtfEncoding());
      }
      for (BrowsableResource child : resource.getChildResources()) {
        String childUri = child.getUri().replace('\\', '/');
        if (location.getFilter().accept(childUri)) {
          indexRecursive(arguments, location, child, visitedResources, entryUpdateVisitor,
              locationResource);
        } else {
          if (getLogger().isTraceEnabled()) {
            getLogger().trace("Filtered " + childUri);
          }
        }
      }
    }
  }
public void indexRecursive ( UpdateStrategyArguments arguments , SearchIndexerDataLocation location , BrowsableResource resource , Set < String > visitedResources , EntryUpdateVisitor entryUpdateVisitor , BrowsableResource locationResource ) { String uri = resource . getUri ( ) ; if ( ! visitedResources . contains ( uri ) ) { visitedResources . add ( uri ) ; if ( resource . isData ( ) ) { ChangeType changeType ; if ( isFullIndexing ( arguments ) ) { changeType = ChangeType . ADD ; } else { changeType = getChangeType ( resource , arguments ) ; } ResourceSearchIndexer resourceSearchIndexer = getIndexerDependencies ( ) . getResourceSearchIndexer ( ) ; resourceSearchIndexer . index ( arguments . getIndexer ( ) , resource , changeType , location , entryUpdateVisitor , locationResource , arguments . getOptions ( ) . getNonUtfEncoding ( ) ) ; } for ( BrowsableResource child : resource . getChildResources ( ) ) { String childUri = child . getUri ( ) . replace ( '\\' , '/' ) ; if ( location . getFilter ( ) . accept ( childUri ) ) { indexRecursive ( arguments , location , child , visitedResources , entryUpdateVisitor , locationResource ) ; } else { if ( getLogger ( ) . isTraceEnabled ( ) ) { getLogger ( ) . trace ( "Filtered " + childUri ) ; } } } } }
This method starts the indexing from the given <code>directory</code>
 adding the given <code>source</code> as metadata.
This method starts the indexing from the given <code > directory< / code > adding the given <code > source< / code > as metadata .