[ https://issues.apache.org/jira/browse/LUCENE-778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12478316 ]
Nicolas Lalevée commented on LUCENE-778: ---------------------------------------- Hoss> OK I got it. In fact my concern was about "semantic". I agree with you that the API make the Lucene user think that every index data are retrieved while doing reader.doc(int i) (as I thought the first days using Lucene). But here you are proposing to completely separate the indexing from the retrieving, saying that they are not compatible with each other. I think this is wrong because basically you can retrieve a document and repushed the same in the index, even if it has no sense. But this was pure semantic concerns. Now looking at the implementation you are proposing of a "YourDocumentWraper", we can make it work correctly without any performance issue. So I won't make a war is a such design is implemented ;) Grant>In fact the discussion derived from the original issue. BTW, this would be nice ! > Allow overriding a Document > --------------------------- > > Key: LUCENE-778 > URL: https://issues.apache.org/jira/browse/LUCENE-778 > Project: Lucene - Java > Issue Type: New Feature > Affects Versions: 2.0.0 > Reporter: Nicolas Lalevée > Priority: Trivial > > 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. -- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]