Details

    • Type: Task Task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0-ALPHA
    • Fix Version/s: 4.0-ALPHA
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      implementations already have to return fieldInfos() [which can tell you this], and normValues() [which can also tell you this].

      So if we want to keep it, I think it should just have a final implementation and not be required for FilterReaders, etc.

      Or we can just nuke it... do we really need 3 ways to do the same thing?

      1. LUCENE-3859.patch
        17 kB
        Robert Muir
      2. LUCENE-3859.patch
        16 kB
        Robert Muir
      3. LUCENE-3859.patch
        6 kB
        Robert Muir

        Activity

        Hide
        Uwe Schindler added a comment -

        Hi Robert,
        thanks for opening this. String +1 for any solution.

        Show
        Uwe Schindler added a comment - Hi Robert, thanks for opening this. String +1 for any solution.
        Hide
        Robert Muir added a comment -

        Updated patch: same approach as before, except with some related cleanups.

        FieldInfos are now public from IndexReader in 4.0, but javadoc is sparse and some naming is inconsistent.

        Patch renames FieldInfos.anyDocValuesFields() to FieldInfos.hasDocValues(), consistent with hasProx(), hasNorms(), and hasFreq().

        Patch also renames FieldInfo.normsPresent() to FieldInfo.hasNorms(), consistent with hasDocValues(), and consistent with the naming in FieldInfoS.

        Also i added some additional javadoc.

        Show
        Robert Muir added a comment - Updated patch: same approach as before, except with some related cleanups. FieldInfos are now public from IndexReader in 4.0, but javadoc is sparse and some naming is inconsistent. Patch renames FieldInfos.anyDocValuesFields() to FieldInfos.hasDocValues(), consistent with hasProx(), hasNorms(), and hasFreq(). Patch also renames FieldInfo.normsPresent() to FieldInfo.hasNorms(), consistent with hasDocValues(), and consistent with the naming in FieldInfoS. Also i added some additional javadoc.
        Hide
        Michael McCandless added a comment -

        +1

        Show
        Michael McCandless added a comment - +1
        Hide
        Robert Muir added a comment -

        One thing about this patch: it removes the method but I am scared to backport the deprecation,
        because I'm not sure 3.x fieldinfos really "knows" this.

        So I think a good solution is to have a deprecated hasNorms sugar method in AtomicReader that is final,
        and sugar for fieldinfo.hasNorms(). This way we avoid a hard break, we can just remove this for the
        next major release.

        Show
        Robert Muir added a comment - One thing about this patch: it removes the method but I am scared to backport the deprecation, because I'm not sure 3.x fieldinfos really "knows" this. So I think a good solution is to have a deprecated hasNorms sugar method in AtomicReader that is final, and sugar for fieldinfo.hasNorms(). This way we avoid a hard break, we can just remove this for the next major release.
        Hide
        Robert Muir added a comment -

        Updated patch: keeps AtomicReader.hasNorms but changes its implementation to just check the fieldinfos (so it wont load anything/incur any i/o).

        its final and deprecated, as its basically just sugar for the fieldinfos check, which you can do yourself (and also allows you to get the type of the norms too).

        Show
        Robert Muir added a comment - Updated patch: keeps AtomicReader.hasNorms but changes its implementation to just check the fieldinfos (so it wont load anything/incur any i/o). its final and deprecated, as its basically just sugar for the fieldinfos check, which you can do yourself (and also allows you to get the type of the norms too).

          People

          • Assignee:
            Unassigned
            Reporter:
            Robert Muir
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development