lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <j...@apache.org>
Subject [jira] Reopened: (LUCENE-2671) Add sort missing first/last ability to SortField and ValueComparator
Date Fri, 01 Oct 2010 20:21:35 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-2671?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Uwe Schindler reopened LUCENE-2671:
-----------------------------------


Hi Ryan,

this patch causes tons of unchecked warnings, without it, Lucene compiles without any.

The generics policeman does not understand this code so he cannot fix:

{noformat}
    [javac] C:\Users\Uwe Schindler\Projects\lucene\trunk-solr\lucene\src\java\org\apache\lucene\search\FieldCacheImpl.java:209:
warning: [unchecked] unchecked cast
    [javac] found   : java.lang.Object
    [javac] required: T
    [javac]         key.creator.validate( (T)value, reader);
    [javac]                                  ^
    [javac] C:\Users\Uwe Schindler\Projects\lucene\trunk-solr\lucene\src\java\org\apache\lucene\search\FieldCacheImpl.java:278:
warning: [unchecked] unchecked call to Entry(java.lang.String,org.apache.lucene.search.cache.EntryCreator<T>)
as a member of the raw type org.apache.lucene.search.FieldCacheImpl.Entry
    [javac]     return (ByteValues)caches.get(Byte.TYPE).get(reader, new Entry(field, creator));
    [javac]                                                          ^
    [javac] C:\Users\Uwe Schindler\Projects\lucene\trunk-solr\lucene\src\java\org\apache\lucene\search\FieldCacheImpl.java:278:
warning: [unchecked] unchecked call to get(org.apache.lucene.index.IndexReader,org.apache.lucene.search.FieldCacheImpl.Entry<T>)
as a member of the raw type org.apache.lucene.search.FieldCacheImpl.Cache
    [javac]     return (ByteValues)caches.get(Byte.TYPE).get(reader, new Entry(field, creator));
    [javac]                                                 ^
    [javac] C:\Users\Uwe Schindler\Projects\lucene\trunk-solr\lucene\src\java\org\apache\lucene\search\FieldCacheImpl.java:293:
warning: [unchecked] unchecked call to Entry(java.lang.String,org.apache.lucene.search.cache.EntryCreator<T>)
as a member of the raw type org.apache.lucene.search.FieldCacheImpl.Entry
    [javac]     return (ShortValues)caches.get(Short.TYPE).get(reader, new Entry(field, creator));
    [javac]                                                            ^
    [javac] C:\Users\Uwe Schindler\Projects\lucene\trunk-solr\lucene\src\java\org\apache\lucene\search\FieldCacheImpl.java:293:
warning: [unchecked] unchecked call to get(org.apache.lucene.index.IndexReader,org.apache.lucene.search.FieldCacheImpl.Entry<T>)
as a member of the raw type org.apache.lucene.search.FieldCacheImpl.Cache
    [javac]     return (ShortValues)caches.get(Short.TYPE).get(reader, new Entry(field, creator));
    [javac]                                                   ^
    [javac] C:\Users\Uwe Schindler\Projects\lucene\trunk-solr\lucene\src\java\org\apache\lucene\search\FieldCacheImpl.java:308:
warning: [unchecked] unchecked call to Entry(java.lang.String,org.apache.lucene.search.cache.EntryCreator<T>)
as a member of the raw type org.apache.lucene.search.FieldCacheImpl.Entry
    [javac]     return (IntValues)caches.get(Integer.TYPE).get(reader, new Entry(field, creator));
    [javac]                                                            ^
    [javac] C:\Users\Uwe Schindler\Projects\lucene\trunk-solr\lucene\src\java\org\apache\lucene\search\FieldCacheImpl.java:308:
warning: [unchecked] unchecked call to get(org.apache.lucene.index.IndexReader,org.apache.lucene.search.FieldCacheImpl.Entry<T>)
as a member of the raw type org.apache.lucene.search.FieldCacheImpl.Cache
    [javac]     return (IntValues)caches.get(Integer.TYPE).get(reader, new Entry(field, creator));
    [javac]                                                   ^
    [javac] C:\Users\Uwe Schindler\Projects\lucene\trunk-solr\lucene\src\java\org\apache\lucene\search\FieldCacheImpl.java:323:
warning: [unchecked] unchecked call to Entry(java.lang.String,org.apache.lucene.search.cache.EntryCreator<T>)
as a member of the raw type org.apache.lucene.search.FieldCacheImpl.Entry
    [javac]     return (FloatValues)caches.get(Float.TYPE).get(reader, new Entry(field, creator));
    [javac]                                                            ^
    [javac] C:\Users\Uwe Schindler\Projects\lucene\trunk-solr\lucene\src\java\org\apache\lucene\search\FieldCacheImpl.java:323:
warning: [unchecked] unchecked call to get(org.apache.lucene.index.IndexReader,org.apache.lucene.search.FieldCacheImpl.Entry<T>)
as a member of the raw type org.apache.lucene.search.FieldCacheImpl.Cache
    [javac]     return (FloatValues)caches.get(Float.TYPE).get(reader, new Entry(field, creator));
    [javac]                                                   ^
    [javac] C:\Users\Uwe Schindler\Projects\lucene\trunk-solr\lucene\src\java\org\apache\lucene\search\FieldCacheImpl.java:337:
warning: [unchecked] unchecked call to Entry(java.lang.String,org.apache.lucene.search.cache.EntryCreator<T>)
as a member of the raw type org.apache.lucene.search.FieldCacheImpl.Entry
    [javac]     return (LongValues)caches.get(Long.TYPE).get(reader, new Entry(field, creator));
    [javac]                                                          ^
    [javac] C:\Users\Uwe Schindler\Projects\lucene\trunk-solr\lucene\src\java\org\apache\lucene\search\FieldCacheImpl.java:337:
warning: [unchecked] unchecked call to get(org.apache.lucene.index.IndexReader,org.apache.lucene.search.FieldCacheImpl.Entry<T>)
as a member of the raw type org.apache.lucene.search.FieldCacheImpl.Cache
    [javac]     return (LongValues)caches.get(Long.TYPE).get(reader, new Entry(field, creator));
    [javac]                                                 ^
    [javac] C:\Users\Uwe Schindler\Projects\lucene\trunk-solr\lucene\src\java\org\apache\lucene\search\FieldCacheImpl.java:352:
warning: [unchecked] unchecked call to Entry(java.lang.String,org.apache.lucene.search.cache.EntryCreator<T>)
as a member of the raw type org.apache.lucene.search.FieldCacheImpl.Entry
    [javac]     return (DoubleValues)caches.get(Double.TYPE).get(reader, new Entry(field,
creator));
    [javac]                                                              ^
    [javac] C:\Users\Uwe Schindler\Projects\lucene\trunk-solr\lucene\src\java\org\apache\lucene\search\FieldCacheImpl.java:352:
warning: [unchecked] unchecked call to get(org.apache.lucene.index.IndexReader,org.apache.lucene.search.FieldCacheImpl.Entry<T>)
as a member of the raw type org.apache.lucene.search.FieldCacheImpl.Cache
    [javac]     return (DoubleValues)caches.get(Double.TYPE).get(reader, new Entry(field,
creator));
    [javac]                                                     ^
    [javac] C:\Users\Uwe Schindler\Projects\lucene\trunk-solr\lucene\src\java\org\apache\lucene\search\FieldCacheImpl.java:366:
warning: [unchecked] unchecked call to Entry(java.lang.String,org.apache.lucene.search.cache.EntryCreator<T>)
as a member of the raw type org.apache.lucene.search.FieldCacheImpl.Entry
    [javac]     return (DocTermsIndex)caches.get(DocTermsIndex.class).get(reader, new Entry(field,
creator));
    [javac]                                                                       ^
    [javac] C:\Users\Uwe Schindler\Projects\lucene\trunk-solr\lucene\src\java\org\apache\lucene\search\FieldCacheImpl.java:366:
warning: [unchecked] unchecked call to get(org.apache.lucene.index.IndexReader,org.apache.lucene.search.FieldCacheImpl.Entry<T>)
as a member of the raw type org.apache.lucene.search.FieldCacheImpl.Cache
    [javac]     return (DocTermsIndex)caches.get(DocTermsIndex.class).get(reader, new Entry(field,
creator));
    [javac]                                                              ^
    [javac] C:\Users\Uwe Schindler\Projects\lucene\trunk-solr\lucene\src\java\org\apache\lucene\search\FieldCacheImpl.java:382:
warning: [unchecked] unchecked call to Entry(java.lang.String,org.apache.lucene.search.cache.EntryCreator<T>)
as a member of the raw type org.apache.lucene.search.FieldCacheImpl.Entry
    [javac]     return (DocTerms)caches.get(DocTerms.class).get(reader, new Entry(field, creator));
    [javac]                                                             ^
    [javac] C:\Users\Uwe Schindler\Projects\lucene\trunk-solr\lucene\src\java\org\apache\lucene\search\FieldCacheImpl.java:382:
warning: [unchecked] unchecked call to get(org.apache.lucene.index.IndexReader,org.apache.lucene.search.FieldCacheImpl.Entry<T>)
as a member of the raw type org.apache.lucene.search.FieldCacheImpl.Cache
    [javac]     return (DocTerms)caches.get(DocTerms.class).get(reader, new Entry(field, creator));
    [javac]                                                    ^
    [javac] C:\Users\Uwe Schindler\Projects\lucene\trunk-solr\lucene\src\java\org\apache\lucene\search\cache\DocTermsCreator.java:137:
warning: [unchecked] unchecked cast
    [javac] found   : org.apache.lucene.search.cache.DocTermsCreator.DocTermsImpl
    [javac] required: T
    [javac]     return (T)new DocTermsImpl(bytes.freeze(true), docToOffset.getMutable());
    [javac]               ^
    [javac] C:\Users\Uwe Schindler\Projects\lucene\trunk-solr\lucene\src\java\org\apache\lucene\search\cache\DocTermsIndexCreator.java:169:
warning: [unchecked] unchecked cast
    [javac] found   : org.apache.lucene.search.cache.DocTermsIndexCreator.DocTermsIndexImpl
    [javac] required: T
    [javac]     return (T)new DocTermsIndexImpl(bytes.freeze(true), termOrdToBytesOffset.getMutable(),
docToTermOrd.getMutable(), termOrd);
    [javac]               ^
{noformat}

> Add sort missing first/last ability to SortField and ValueComparator
> --------------------------------------------------------------------
>
>                 Key: LUCENE-2671
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2671
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: Search
>            Reporter: Ryan McKinley
>            Assignee: Ryan McKinley
>             Fix For: 4.0
>
>         Attachments: LUCENE-2671-SortMissingLast.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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message