Lucene - Core
  1. Lucene - Core
  2. LUCENE-4663

IndexSearcher.document() should not be final

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1, 6.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      IndexSearcher has 3 methods:

      StoredDocument doc(int)
      void doc(int, StoredFieldVisitor)
      final StoredDocument document(int, Set<String>)
      

      The last one is confusing for subclasses (e.g. SolrIndexSearcher) that override these methods. for example that one has its own StoredDocument doc(int, Set) method.

      But now this means a user could always call the wrong method (this final document() method) and get the wrong behavior (versus calling doc()).

      I think the name is also wrong. it should be doc() like the others.

        Activity

        Hide
        Robert Muir added a comment -

        Here's one possible patch: in 4.x we would just deprecate document(), with it still being final, just forwarding to the new non-final doc().

        Show
        Robert Muir added a comment - Here's one possible patch: in 4.x we would just deprecate document(), with it still being final, just forwarding to the new non-final doc().
        Hide
        Michael McCandless added a comment -

        +1

        Show
        Michael McCandless added a comment - +1
        Hide
        Commit Tag Bot added a comment -

        [trunk commit] Robert Muir
        http://svn.apache.org/viewvc?view=revision&revision=1429927

        LUCENE-4663: IndexSearcher.document should not be final

        Show
        Commit Tag Bot added a comment - [trunk commit] Robert Muir http://svn.apache.org/viewvc?view=revision&revision=1429927 LUCENE-4663 : IndexSearcher.document should not be final
        Hide
        Commit Tag Bot added a comment -

        [branch_4x commit] Robert Muir
        http://svn.apache.org/viewvc?view=revision&revision=1429928

        LUCENE-4663: IndexSearcher.document should not be final

        Show
        Commit Tag Bot added a comment - [branch_4x commit] Robert Muir http://svn.apache.org/viewvc?view=revision&revision=1429928 LUCENE-4663 : IndexSearcher.document should not be final

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development