Skip to content

Commit

Permalink
Add SortedNumericSortField
Browse files Browse the repository at this point in the history
  • Loading branch information
bbimber committed Feb 4, 2024
1 parent 6690bda commit 0a3c642
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jbrowse/src/org/labkey/jbrowse/JBrowseLuceneSearch.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.Sort;
import org.apache.lucene.search.SortField;
import org.apache.lucene.search.SortedNumericSortField;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
Expand Down Expand Up @@ -231,7 +232,7 @@ else if (numericQueryParserFields.contains(fieldName))

// TODO: if the index is generated with a sort on genomicPosition, maybe we just use Sort.INDEXORDER?
// Sort sort = Sort.INDEXORDER;
Sort sort = new Sort(new SortField("genomicPosition", SortField.Type.INT, false));
Sort sort = new Sort(new SortedNumericSortField("genomicPosition", SortField.Type.INT, false));

// Get chunks of size {pageSize}. Default to 1 chunk -- add to the offset to get more.
// We then iterate over the range of documents we want based on the offset. This does grow in memory
Expand Down

0 comments on commit 0a3c642

Please sign in to comment.