Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-27989

SAP Lucene Sorting Optimization - IndexReader

    XMLWordPrintable

Details

    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    Description

      NOTE: This suggestion is for JIRA Server. Using JIRA Cloud? See the corresponding suggestion.

      Current Implementation: For each IndexReader (setNextReader) all Lucene index documents are read and the values of the corresponding Lucene field is extracted. In our case these are around 700.000 Lucene document accesses and field value extractions.

      One Alternative Implementation: Only read the document that are actually found after filtering.

      // First remember the reader in method setNextReader. 
      private IndexReader reader;public void setNextReader(IndexReader reader, int docBase) throws IOException{  … this.reader = reader;}
      
      // In the copy method the document value must be retrieved.
      public void copy(int slot, int doc)
      {
        ...
        values.set(slot, getValueFromDoc(doc));
      }
      
      public Object getValueFromDoc(int doc)
      {
      ...
        try 
        { 
          Document document = reader.document(doc, fieldSelector);    
          return sorter.getValueFromLuceneField(document.get(field));
        } 
        catch (Exception e) 
         {
         }        
         return null;
      }
      

      Attachments

        Issue Links

          Activity

            People

              tcampbell Trevor Campbell (Inactive)
              rbal Rick
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: