SimpleFacet binarysearch optimization -------------------------------------
Key: SOLR-569 URL: https://issues.apache.org/jira/browse/SOLR-569 Project: Solr Issue Type: Improvement Components: search Affects Versions: 1.3 Reporter: Jason Rutherglen Priority: Minor Looks like the SimpleFacets.getFieldCacheCounts could have small optimization: {noformat} startTermIndex = Arrays.binarySearch(terms,prefix,nullStrComparator); if (startTermIndex<0) startTermIndex=-startTermIndex-1; // find the end term. \uffff isn't a legal unicode char, but only compareTo // is used, so it should be fine, and is guaranteed to be bigger than legal chars. endTermIndex = Arrays.binarySearch(terms,prefix+"\uffff\uffff\uffff\uffff",nullStrComparator); endTermIndex = -endTermIndex-1; {noformat} to: {noformat} startTermIndex = Arrays.binarySearch(terms,prefix,nullStrComparator); if (startTermIndex<0) startTermIndex=-startTermIndex-1; // find the end term. \uffff isn't a legal unicode char, but only compareTo // is used, so it should be fine, and is guaranteed to be bigger than legal chars. endTermIndex = Arrays.binarySearch(terms, startTermIndex, terms.length, prefix+"\uffff\uffff\uffff\uffff",nullStrComparator); endTermIndex = -endTermIndex-1; {noformat} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.