Lucene - Core
  1. Lucene - Core
  2. LUCENE-2671

Add sort missing first/last ability to SortField and ValueComparator

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0-ALPHA
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      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.

      1. LUCENE-2671-SortMissingLast.patch
        35 kB
        Ryan McKinley
      2. LUCENE-2671-suppress-unchecked.patch
        4 kB
        Ryan McKinley
      3. LUCENE-2671-caches.patch
        13 kB
        Ryan McKinley
      4. LUCENE-2671-caches.patch
        9 kB
        Ryan McKinley
      5. LUCENE-2671.patch
        12 kB
        Yonik Seeley

        Issue Links

          Activity

          Hide
          Ryan McKinley added a comment -

          in r1065093, i deprecated the sortable* fields and noted they will be removed in 5.x (seems so far away!)

          Show
          Ryan McKinley added a comment - in r1065093, i deprecated the sortable* fields and noted they will be removed in 5.x (seems so far away!)
          Hide
          Yonik Seeley added a comment -

          Does this mean we should now deprecate: org.apache.solr.schema.Sortable*

          Sure - I already removed references to those classes from the example schema.

          Show
          Yonik Seeley added a comment - Does this mean we should now deprecate: org.apache.solr.schema.Sortable* Sure - I already removed references to those classes from the example schema.
          Hide
          Ryan McKinley added a comment -

          This was fixed a while ago – i think it fixes all concerns...

          Does this mean we should now deprecate:
          org.apache.solr.schema.Sortable*
          ?

          Show
          Ryan McKinley added a comment - This was fixed a while ago – i think it fixes all concerns... Does this mean we should now deprecate: org.apache.solr.schema.Sortable* ?
          Hide
          Ryan McKinley added a comment -

          Looks good – should we also get rid of the lazy initialization that then allocates at the end anyway (with FloatValuesCreator, LongValuesCreator, and DoubleValuesCreator)?

          Show
          Ryan McKinley added a comment - Looks good – should we also get rid of the lazy initialization that then allocates at the end anyway (with FloatValuesCreator, LongValuesCreator, and DoubleValuesCreator)?
          Hide
          Yonik Seeley added a comment -

          OK, here's a patch that caches the typed array as "docValues"
          and moves the ShortComparator next to the other numeric comparators (since it wasn't next to the others, I actually missed it in my first patch).

          Show
          Yonik Seeley added a comment - OK, here's a patch that caches the typed array as "docValues" and moves the ShortComparator next to the other numeric comparators (since it wasn't next to the others, I actually missed it in my first patch).
          Hide
          Yonik Seeley added a comment -

          (carried over from LUCENE-2649... I guess my last patch should have been here.)

          Actually, looking a bit further at these comparators, it seems like we have an unnecessary cast in the inner-loop method compareBottom (because of type erasure)?
          Seems like we should just cache the int[] or whatever to avoid that.
          I'll work up another patch for consideration.

          Show
          Yonik Seeley added a comment - (carried over from LUCENE-2649 ... I guess my last patch should have been here.) Actually, looking a bit further at these comparators, it seems like we have an unnecessary cast in the inner-loop method compareBottom (because of type erasure)? Seems like we should just cache the int[] or whatever to avoid that. I'll work up another patch for consideration.
          Hide
          Ryan McKinley added a comment -

          here is a new patch that applies cleanly.

          I could go either way for – keep it as it is, vs drop the first layer generic map

          Show
          Ryan McKinley added a comment - here is a new patch that applies cleanly. I could go either way for – keep it as it is, vs drop the first layer generic map
          Hide
          Robert Muir added a comment -

          in #1023379 I changed DocTermsCreator and DocTermsIndexCreator to bind directly to the class (rather then T extends XXX) This is a bit more clear, but does not let you extend the generic API (not that you need to)

          thanks Ryan!

          Show
          Robert Muir added a comment - in #1023379 I changed DocTermsCreator and DocTermsIndexCreator to bind directly to the class (rather then T extends XXX) This is a bit more clear, but does not let you extend the generic API (not that you need to) thanks Ryan!
          Hide
          Ryan McKinley added a comment -

          This is not true, it returns DocTermCreator.DocTermsImpl and gives an ugly cast

          DocTermCreator.DocTermsImpl (a private class only accessible within DocTermCreator) extends DocTerms and so it is true.

          I won't argue about the ugly cast.

          in #1023379 I changed DocTermsCreator and DocTermsIndexCreator to bind directly to the class (rather then T extends XXX) This is a bit more clear, but does not let you extend the generic API (not that you need to)

          Show
          Ryan McKinley added a comment - This is not true, it returns DocTermCreator.DocTermsImpl and gives an ugly cast DocTermCreator.DocTermsImpl (a private class only accessible within DocTermCreator) extends DocTerms and so it is true. I won't argue about the ugly cast. in #1023379 I changed DocTermsCreator and DocTermsIndexCreator to bind directly to the class (rather then T extends XXX) This is a bit more clear, but does not let you extend the generic API (not that you need to)
          Hide
          Robert Muir added a comment -

          What part of the API is broken?

          DocTermsCreator

          The assumptions about what is in the Map are are internal to a private member that can not be touched outside this ugly class.

          This is a public class.

          It is parameterized as T extends DocTerms, but

            @Override
            public T create(IndexReader reader) throws IOException {
          

          This is not true, it returns DocTermCreator.DocTermsImpl and gives an ugly cast

              final T t =
                (T)new DocTermsImpl(bytes.freeze(true), docToOffset.getMutable());
              return t;
          

          The api doesn't look extensible to me, I'm surprised it works. I guess this is why the compiler complains.

          Granted i didnt take a lot of time to look it over, but the compiler warnings speak loudly enough in my favor.

          Show
          Robert Muir added a comment - What part of the API is broken? DocTermsCreator The assumptions about what is in the Map are are internal to a private member that can not be touched outside this ugly class. This is a public class. It is parameterized as T extends DocTerms, but @Override public T create(IndexReader reader) throws IOException { This is not true, it returns DocTermCreator.DocTermsImpl and gives an ugly cast final T t = (T)new DocTermsImpl(bytes.freeze(true), docToOffset.getMutable()); return t; The api doesn't look extensible to me, I'm surprised it works. I guess this is why the compiler complains. Granted i didnt take a lot of time to look it over, but the compiler warnings speak loudly enough in my favor.
          Hide
          Ryan McKinley added a comment -

          Hopefully if/when this cache moves to IndexReader, we will still be able to cache arbitrary stuff on the reader?

          Ya, the ReaderCache proposed in LUCENE-2665 simply uses the key from EntryCreator.getCacheKey().

          Show
          Ryan McKinley added a comment - Hopefully if/when this cache moves to IndexReader, we will still be able to cache arbitrary stuff on the reader? Ya, the ReaderCache proposed in LUCENE-2665 simply uses the key from EntryCreator.getCacheKey().
          Hide
          Yonik Seeley added a comment -

          Hopefully if/when this cache moves to IndexReader, we will still be able to cache arbitrary stuff on the reader?

          Show
          Yonik Seeley added a comment - Hopefully if/when this cache moves to IndexReader, we will still be able to cache arbitrary stuff on the reader?
          Hide
          Ryan McKinley added a comment -

          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

          Show
          Ryan McKinley added a comment - 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
          Hide
          Ryan McKinley added a comment -

          I don't think we should leave the API broken pending some massive "rework fieldcache" issue, which it appears has been attempted before...

          What part of the API is broken? The assumptions about what is in the Map are are internal to a private member that can not be touched outside this ugly class. My reference to

          To avoid the compiler warning, we could do something like:

            public DoubleValues getDoubles(IndexReader reader, String field, EntryCreator<DoubleValues> creator ) throws IOException {
              Object v = caches.get(Double.TYPE).get(reader, new Entry(field, creator));
              if( v instanceof DoubleValues ) {
                return (DoubleValues)v;
              }
              throw new RuntimeException( "should be of type DoubleValues rather then: "+v.getClass() );
            }
          

          But this is more complex and equivalent to the ClassCastException that would be thrown with the original code.

          Another option is to drop the caches Map<Class,Cache> since that is where we lose what type the output should be. I will post a patch with this option

          Show
          Ryan McKinley added a comment - I don't think we should leave the API broken pending some massive "rework fieldcache" issue, which it appears has been attempted before... What part of the API is broken? The assumptions about what is in the Map are are internal to a private member that can not be touched outside this ugly class. My reference to To avoid the compiler warning, we could do something like: public DoubleValues getDoubles(IndexReader reader, String field, EntryCreator<DoubleValues> creator ) throws IOException { Object v = caches.get( Double .TYPE).get(reader, new Entry(field, creator)); if ( v instanceof DoubleValues ) { return (DoubleValues)v; } throw new RuntimeException( "should be of type DoubleValues rather then: " +v.getClass() ); } But this is more complex and equivalent to the ClassCastException that would be thrown with the original code. Another option is to drop the caches Map<Class,Cache> since that is where we lose what type the output should be. I will post a patch with this option
          Hide
          Robert Muir added a comment -

          I am concerned about the @SuppressWarnings here, for two reasons:

          1. I don't think we should use this except in limited circumstances where its not our fault (see below)
          2. I don't think we should leave the API broken pending some massive "rework fieldcache" issue, which it appears has been attempted before...
          3. I don't understand the generics in the current API at all

          In general with SuppressWarnings, i think we should limit our uses to cases where its really a false warning

          • generic collections/array problems
          • documenting intentional fallthroughs in switch statements
          • possibly autogenerated code from something else like javacc/jflex

          I'd like for us to remove the SuppressWarnings and look at what we can do to fix the API right now as-is.

          Show
          Robert Muir added a comment - I am concerned about the @SuppressWarnings here, for two reasons: I don't think we should use this except in limited circumstances where its not our fault (see below) I don't think we should leave the API broken pending some massive "rework fieldcache" issue, which it appears has been attempted before... I don't understand the generics in the current API at all In general with SuppressWarnings, i think we should limit our uses to cases where its really a false warning generic collections/array problems documenting intentional fallthroughs in switch statements possibly autogenerated code from something else like javacc/jflex I'd like for us to remove the SuppressWarnings and look at what we can do to fix the API right now as-is.
          Hide
          Ryan McKinley added a comment -

          here is a patch that ignores all the unchecked casts

           @SuppressWarnings("unchecked")
          

          I don't think there is any way around this for the current design – in LUCENE-2665, the cache would directly use the generic map, but for the baby step it needs a cast.

          The issues is that we have:

          private Map<Class<?>,Cache> caches;
          

          and really need to be able to define something like:

          private Map<Class<X>,Cache<? extends X>> caches;
          

          where X depends on what you put into the map... but that is not possible as far as I know.

          • - -

          I would commit this, but the build is failing for other reasons....

          Show
          Ryan McKinley added a comment - here is a patch that ignores all the unchecked casts @SuppressWarnings( "unchecked" ) I don't think there is any way around this for the current design – in LUCENE-2665 , the cache would directly use the generic map, but for the baby step it needs a cast. The issues is that we have: private Map< Class <?>,Cache> caches; and really need to be able to define something like: private Map< Class <X>,Cache<? extends X>> caches; where X depends on what you put into the map... but that is not possible as far as I know. - - I would commit this, but the build is failing for other reasons....
          Hide
          Uwe Schindler added a comment -

          Additionally, the source code formatting is not Lucene-conform (should be no newline before {, no extra space around method parameters).

          Show
          Uwe Schindler added a comment - Additionally, the source code formatting is not Lucene-conform (should be no newline before {, no extra space around method parameters).
          Hide
          Uwe Schindler added a comment -

          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:

              [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]               ^
          
          Show
          Uwe Schindler added a comment - 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: [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] ^
          Hide
          Ryan McKinley added a comment -

          Note, this solution does not (yet) address Uwe's concern about sorting NaN and real POSITIVE_INFINITY/NEGATIVE_INFINITY values.

          I'm going to punt that to a different issues since it preexisted this one

          Show
          Ryan McKinley added a comment - Note, this solution does not (yet) address Uwe's concern about sorting NaN and real POSITIVE_INFINITY/NEGATIVE_INFINITY values. I'm going to punt that to a different issues since it preexisted this one
          Hide
          Ryan McKinley added a comment -

          added in #1002460 – this can be backported to 3.x when LUCENE-2665 is stabalized

          Show
          Ryan McKinley added a comment - added in #1002460 – this can be backported to 3.x when LUCENE-2665 is stabalized
          Hide
          Yonik Seeley added a comment - - edited

          Ah - I was just about to report "hmmm, doesn't seem to be working". But then I realized you separated them out and this is the lucene part only.

          IMO - if you're working on these together (and esp if the original motivation was to ultimately get the functionallity into Solr, it's simpler to keep it as a single issue / single patch).

          edit: and two patches are tougher to deal with - in fact, I can't apply the solr one either with or without this patch... not sure what's up.

          Show
          Yonik Seeley added a comment - - edited Ah - I was just about to report "hmmm, doesn't seem to be working". But then I realized you separated them out and this is the lucene part only. IMO - if you're working on these together (and esp if the original motivation was to ultimately get the functionallity into Solr, it's simpler to keep it as a single issue / single patch). edit: and two patches are tougher to deal with - in fact, I can't apply the solr one either with or without this patch... not sure what's up.
          Hide
          Ryan McKinley added a comment -

          This is the lucene only parts of SOLR-2134

          Show
          Ryan McKinley added a comment - This is the lucene only parts of SOLR-2134

            People

            • Assignee:
              Ryan McKinley
              Reporter:
              Ryan McKinley
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development