Makes sense...

On Jan 19, 2007, at 3:14 PM, Chris Hostetter wrote:


: statements, etc.) behind the scene. When you go to add Fieldables to
: your document, you would just construct the appropriate DBFieldable
: and pass it to add.  I think this would solve a lot of people's
: issues with combining DB's and Lucene, or at least the ability to
: index the contents of a DB w/o having to first extract the content to : some intermediate form and also to search and get back things tied to
: the DB.  And I think it would give a nice, seamless connection
: between Lucene and a DB.

sure ... you can do that right now can't you? ... it's not something i
would personally use because any DB errors would occur in the
DocumentWriter and it would be hard for your app to manage them cleanly
(ie: retry or what not) but i'm sure other people then you would be
interested in it (basically it would have the same issues that the Reader
backed fields have if the Reader isn't garunteed to work perfectly)


Right.  Good points

: However, one of my sticking points is on how to recreate the Document : on the search side and have it still be backed by the DB with a valid
: connection.  I could do this by hooking in more to the FieldsWriter/

: Also, why couldn't we add a
: doc(int n, FieldSelector fieldSelector, Document doc);  to the
: IndexReader/FieldsReader? The FieldsReader currently just does a new
: Document() and then calls addField on it.

we could ... although with Document being final right now that wouldn't gain you much ... with the "ReturnableDocument" idea i mentioned though it
would work: just write your own subclass that knows about your special
fields and whern the FieldsReader calls AddField use the value it gives
you to do your DB lookup.

an approach i'd probably be more in favor of is having a "ResultDocument" interface implimented by ReturnableDocument and making all public methods in IndexReader/IndexSearch/Hits declare that they return that method ...
then you could just decorate the ResultDocument you get back from them
with your own proxy imple that does the DB lookup when asked for certain
fields.

Yes, I was suggesting this in light of your suggestions :-) Document would have to be non-final for this to work.


: > One approach off the top of my head: make an IndexableDocument
: > interface
: > for clients to pass to IndexWriter and a "ReturnableDocument" class
: > for
: > IndexReader/IndexSearcher to return ... the existing Document class
: > can
: > subclass ReturnableDocument and impliment IndexableDocument, the
: > existing
: > methods with Document in their sig would be deprecated and replaced
: > with
: > methods using one of these new class names



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


------------------------------------------------------
Grant Ingersoll
http://www.grantingersoll.com/
http://www.paperoftheweek.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to