Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-9457

Lucene index is always used over ES index when the cost is minimal

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.40.0
    • 1.42.0
    • indexing
    • None

    Description

      In case of suggestions and spellcheck i.e. native queries. The cost evaluation for using index comes out to be 2.0 which is smaller than even minimum cost of the indexes.

      This leads to non-evaluation of further index types. In this case elastic.

       

      Minimum cost for indexes are as follows:

      Index Type min cost
      reference index 1.0
      property index 2.0
      nodetype 2.05
      luceneproperty index 2.1
      elastic index: 2.2
      Lucene Aggregate Index 2.2
      Solr Aggegate Index 2.3

       

      Formulation for cost evaluation is :

      double c = p.getCostPerExecution() + entryCount * p.getCostPerEntry(); 

      Which for native queries is equivalent to 1.0 + 1.0 * 1.0 i.e 2.0.

      So make sure that index evaluation is not stopped at lucene indexes we are going to change EstimatedEntryCount to 2 from 1 which will return cost for suggestions and spellcheck as 3.0

       

      Attachments

        Issue Links

          Activity

            People

              mkataria Mohit Kataria
              mkataria Mohit Kataria
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: