code: function(graph, options) {
    options = options || {};
  
    this.graph = graph;
  
    this.nodes = {};
    this.scopes = {};
  
    if (options.filter) {
      this.filter = options.filter;
    } else if (options.types) {
      this.filter = Index.typeFilter(graph.schema, options.types);
    }
  
    if (options.property) {
      this.property = options.property;
    }
  
    this.createIndex();
  }
docs: Creates an index for the document applying a given node filter function and grouping using a given key function --------  - document: a document instance - filter: a function that takes a node and returns true if the node should be indexed - key: a function that provides a path for scoped indexing (default: returns empty path)