lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan McKinley (JIRA)" <>
Subject [jira] Commented: (SOLR-2134) Trie* fields should support sortMissingLast=true, and deprecate Sortable* Field Types
Date Sun, 26 Sep 2010 21:35:32 GMT


Ryan McKinley commented on SOLR-2134:

bq.  If you pass null for the missing value then the bits are not loaded in the FieldCache

Passing null as the missing value indicates that the Comparator should not even try looking
for missing values.  Setting the missing value will turn on the 'CACHE_BITS' option
public SortField setMissingValue( Object v )
    missingValue = v;
    if( missingValue != null ) {
      if( this.creator == null ) {
        throw new IllegalArgumentException( "Missing value only works for sort fields with
a CachedArray" );

      // Set the flag to get bits 
      creator.setFlag( CachedArrayCreator.OPTION_CACHE_BITS );
    return this;

But the Comparators only actually set the bit if the bits are in the field cache:
    public void copy(int slot, int doc) {
      values[slot] = ( checkMissing && cached.valid != null && !cached.valid.get(doc)
        ? missingValue : cached.values[doc];

I will make a LUCENE jira issue for adding 'sort missing first/last' to SortField/XxxxComparator
-- and use this issue for the solr integration.

> Trie* fields should support sortMissingLast=true, and deprecate Sortable* Field Types
> -------------------------------------------------------------------------------------
>                 Key: SOLR-2134
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>          Components: Schema and Analysis
>            Reporter: Ryan McKinley
>         Attachments: SOLR-2134-SortMissingLast.patch
> With the changes in LUCENE-2649, the FieldCache also returns if the bit is valid or not.
 This is enough to support sortMissingLast=true with Trie* fields.  Then we can get rid of
the Sortable* fields

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message