code: private IndexingRule getApplicableIndexingRule(NodeData state)
     {
        List<IndexingRule> rules = null;
        List<IndexingRule> r = configElements.get(state.getPrimaryTypeName());
        if (r != null)
        {
           rules = new ArrayList<IndexingRule>();
           rules.addAll(r);
        }
  
        InternalQName[] mixTypes = state.getMixinTypeNames();
        for (InternalQName mixType : mixTypes)
        {
           r = configElements.get(mixType);
           if (r != null)
           {
              if (rules == null)
              {
                 rules = new ArrayList<IndexingRule>();
              }
              rules.addAll(r);
           }
        }
  
        if (rules != null)
        {
           for (IndexingRule ir : rules)
           {
              if (ir.appliesTo(state))
              {
                 return ir;
              }
           }
        }
  
        // no applicable rule
        return null;
     }
docs: Returns the first indexing rule that applies to the given node
  <code>state</code>.
  
  @param state
  a node state.
  @return the indexing rule or <code>null</code> if none applies.