org.exist.storage
Class IndexSpec

java.lang.Object
  extended by org.exist.storage.IndexSpec

public class IndexSpec
extends Object

Top class for index definitions as specified in a collection configuration or the main configuration file. The IndexSpec for a given collection can be retrieved through method Collection.getIndexConfiguration(DBBroker). An index definition should have the following structure:

  <index index-depth="idx-depth">
      <fulltext default="all|none" attributes="true|false">
          <include path="node-path"/>
          <exclude path="node-path"/>
      </fulltext>
      <create path="node-path" type="schema-type">
  </index>
  

Author:
wolf

Constructor Summary
IndexSpec(DBBroker broker, Element index)
           
 
Method Summary
 Object getCustomIndexSpec(String id)
          Returns the configuration object registered for the non-core index identified by id.
 FulltextIndexSpec getFulltextIndexSpec()
          Returns the fulltext index configuration object for the current configuration.
 GeneralRangeIndexSpec getIndexByPath(NodePath path)
          Returns the GeneralRangeIndexSpec defined for the given node path or null if no index has been configured.
 QNameRangeIndexSpec getIndexByQName(QName name)
           
 List getIndexedQNames()
           
 boolean hasIndexesByPath()
           
 boolean hasIndexesByQName()
           
 void read(DBBroker broker, Element index)
          Read index configurations from an "index" element node.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IndexSpec

public IndexSpec(DBBroker broker,
                 Element index)
          throws DatabaseConfigurationException
Throws:
DatabaseConfigurationException
Method Detail

read

public void read(DBBroker broker,
                 Element index)
          throws DatabaseConfigurationException
Read index configurations from an "index" element node. The node should have exactly one "fulltext" child node and zero or more "create" nodes. The "fulltext" section is forwarded to class FulltextIndexSpec. The "create" elements add a GeneralRangeIndexSpec to the current configuration.

Parameters:
index -
Throws:
DatabaseConfigurationException

getFulltextIndexSpec

public FulltextIndexSpec getFulltextIndexSpec()
Returns the fulltext index configuration object for the current configuration.


getCustomIndexSpec

public Object getCustomIndexSpec(String id)
Returns the configuration object registered for the non-core index identified by id.

Parameters:
id - the id used to identify this index.
Returns:
the configuration object registered for the index or null.

getIndexByPath

public GeneralRangeIndexSpec getIndexByPath(NodePath path)
Returns the GeneralRangeIndexSpec defined for the given node path or null if no index has been configured.

Parameters:
path -

getIndexByQName

public QNameRangeIndexSpec getIndexByQName(QName name)

hasIndexesByPath

public boolean hasIndexesByPath()

hasIndexesByQName

public boolean hasIndexesByQName()

getIndexedQNames

public List getIndexedQNames()

toString

public String toString()
Overrides:
toString in class Object


Copyright (C) Wolfgang Meier. All rights reserved.