lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan McKinley (JIRA)" <>
Subject [jira] Updated: (LUCENE-2671) Add sort missing first/last ability to SortField and ValueComparator
Date Sat, 16 Oct 2010 18:24:22 GMT


Ryan McKinley updated LUCENE-2671:

    Attachment: LUCENE-2671-caches.patch

This patch reduces the number of compiler warnings by removing a Map and replacing it with
specific classes.  That is rather then:
private Map<Class<?>,Cache> caches;
we would have
  private Cache<ByteValues> byteCache;
  private Cache<ShortValues> shortCache;
  private Cache<IntValues> intCache;
  private Cache<FloatValues> floatCache;
  private Cache<LongValues> longCache;
  private Cache<DoubleValues> doubleCache;
  private Cache<DocTermsIndex> docTermsIndexCache;
  private Cache<DocTerms> docTermsCache;
  private final List<Cache<?>> caches = new ArrayList<Cache<?>>();

and then each type looks up its values directly:
  public IntValues getInts(IndexReader reader, String field, EntryCreator<IntValues>
creator ) throws IOException {
    return intCache.get(reader, new Entry<IntValues>(field, creator));

However, this approach still leaves one place that has class cast.  since the Cache holds
a CreationPlaceholder while it is making the object, we can not use a simple generic Map.
 Again, we could add some extra instanceof checks, but I don't think that adds anything

> Add sort missing first/last ability to SortField and ValueComparator
> --------------------------------------------------------------------
>                 Key: LUCENE-2671
>                 URL:
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: Search
>            Reporter: Ryan McKinley
>            Assignee: Ryan McKinley
>             Fix For: 4.0
>         Attachments: LUCENE-2671-caches.patch, LUCENE-2671-SortMissingLast.patch, LUCENE-2671-suppress-unchecked.patch
> When SortField and ValueComparator use EntryCreators (from LUCENE-2649) they use a special
sort value when the field is missing.
> This enables lucene to implement 'sort missing last' or 'sort missing first' for numeric
values from the FieldCache.

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