Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-778

Allow overriding a Document

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Trivial
    • Resolution: Won't Fix
    • 2.0.0
    • None
    • core/index
    • None
    • New

    Description

      In our application, we have some kind of generic API that is handling how we are using Lucene. The different other applications are using this API with different semantics, and are using the Lucene fields quite differently. We wrote some usefull functions to do this mapping. Today, as the Document class cannot be overriden, we are obliged to make a document wrapper by application, ie some MyAppDocument and MyOtherAppDocument which have a property holding a real Lucene Document. Then, when MyApp or MyOtherApp want to use our generic lucene API, we have to "get out" the Lucene document, ie do some genericLuceneAPI.writeDoc(myAppDoc.getLuceneDocument()). This work fine, but it becomes quite tricky to use the other function of our generic API which is genericLuceneAPI.writeDocs(Collection<Document> docs).

      I don't know the rational behind making final Document, but removing it will allow more object-oriented code.

      Attachments

        Activity

          People

            Unassigned Unassigned
            hibou Nicolas Lalevée
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: