org.apache.jackrabbit.oak.plugins.index.lucene

Class LuceneIndex

    • Method Detail

      • getIndexName

        public String getIndexName()
        Description copied from interface: QueryIndex
        Get the unique index name.
        Specified by:
        getIndexName in interface QueryIndex
        Returns:
        the index name
      • getCost

        public double getCost(Filter filter,
                     NodeState root)
        Description copied from interface: QueryIndex
        Estimate the worst-case cost to query with the given filter. The returned cost is a value between 1 (very fast; lookup of a unique node) and the estimated number of entries to traverse, if the cursor would be fully read, and if there could in theory be one network roundtrip or disk read operation per node (this method may return a lower number if the data is known to be fully in memory).

        The returned value is supposed to be an estimate and doesn't have to be very accurate. Please note this method is called on each index whenever a query is run, so the method should be reasonably fast (not read any data itself, or at least not read too much data).

        If an index implementation can not query the data, it has to return Double.MAX_VALUE.

        Specified by:
        getCost in interface QueryIndex
        Parameters:
        filter - the filter
        root - root state of the current repository snapshot
        Returns:
        the estimated cost in number of read nodes
      • getPlan

        public String getPlan(Filter filter,
                     NodeState root)
        Description copied from interface: QueryIndex
        Get the query plan for the given filter. This method is called when running an EXPLAIN SELECT query, or for logging purposes. The result should be human readable.
        Specified by:
        getPlan in interface QueryIndex
        Parameters:
        filter - the filter
        root - root state of the current repository snapshot
        Returns:
        the query plan
      • query

        public Cursor query(Filter filter,
                   NodeState root)
        Description copied from interface: QueryIndex
        Query the index. The returned cursor is supposed to return as few nodes as possible, but may return more nodes than necessary.

        An implementation should only filter the result if it can do so easily and efficiently; the query engine will verify the data again (in memory) and check for access rights.

        The method is only called if this index is used for the given query and selector, which is only the case if the given index implementation returned the lowest cost for the given filter. If the implementation returned Double.MAX_VALUE in the getCost method for the given filter, then this method is not called. If it is still called, then it is supposed to throw an exception (as it would be an internal error of the query engine).

        Specified by:
        query in interface QueryIndex
        Parameters:
        filter - the filter
        root - root state of the current repository snapshot
        Returns:
        a cursor to iterate over the result

"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"