Details
-
Suggestion
-
Resolution: Fixed
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
- relates to
-
JRACLOUD-27989 SAP Lucene Sorting Optimization - IndexReader
- Closed
-
JRASERVER-27990 SAP Lucene Sorting Optimization - readCounter for Full Table Scans
- Closed