Nice article - We do this in our application, too (use Lucene to allow funky searches of domain objects).
"Aside from wanting to provide more functionality in search, users are expecting it. Google seems simple, doesn't it !" That was pretty much our spec : "I want to be able to search for clients by name, address, debtor's name, account number, their accountant's name or their bank account number - just like Google". I just thought I'd mention that there are two other ways add that another way of ensuring that the index stays up to date, without using aspects : a) Implement org.apache.ojb.broker.PersistenceBrokerAware on the domain object : the domain object knows when it is being modified, and so can add itself to the index. Not such a good idea for many people, as your domain object is reliant on both Lucene && OJB, although perfectly feasible for a small project. b) Implement a org.apache.ojb.broker.PBLifeCycleListener, and add them to the PersistenceBroker through a PersistenceBrokerFactory. In the afterUpdate/afterInsert/afterDelete methods, we check to see whether the class being updated should be updated in the index - and if so, does so : this is how we do it, although for us it's a bit more complex than that - the names of the classes and properties that should be indexed are stored as metadata in a file somewhere, and we actually queue up indexing operations as we frequently update lots of objects together. Cheers, Charles. > -----Original Message----- > From: Brian McCallister [mailto:[EMAIL PROTECTED] > Sent: 11 September 2004 23:17 > To: OJB Users List > Subject: Lucene and OJB > > > A while back I promised a howto/sample code for using OJB with Lucene > for full text searches. Recently posted an article on just that: > > http://kasparov.skife.org/blog/src/java/ojb#lucene-ojb > > Thought I'd share, > > Brian > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > ___________________________________________________________ HPD Software Ltd. - Helping Business Finance Business Email terms and conditions: www.hpdsoftware.com/disclaimer --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
