[ 
https://issues.apache.org/jira/browse/SOLR-2134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12915045#action_12915045
 ] 

Ryan McKinley commented on SOLR-2134:
-------------------------------------

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

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
{code:java}
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;
  }
{code}

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

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: https://issues.apache.org/jira/browse/SOLR-2134
>             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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to