GeeCON Prague 2014*
The moose likes Other Open Source Projects and the fly likes Help needed on Lucene Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Help needed on Lucene" Watch "Help needed on Lucene" New topic
Author

Help needed on Lucene

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9398
    
    2

Hi Guys,

Does anyone know how to use Lucene for querrying a database based on some search criteria?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10426
    
    8

Originally posted by Jothi Shankar Kumar Sankararaj:
Hi Guys,

Does anyone know how to use Lucene for querrying a database based on some search criteria?


With Lucene you dont query a database or anything but the index.
If you want to query a database, you might as well use SQL or Hibernate or anything suitable.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42042
    
  64
Maybe Hibernate Search goes into the right direction? It integrates Lucene search with databases.


Ping & DNS - my free Android networking tools app
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9398
    
    2

Thanks guys!

But the problem is our persistence model uses EJB 2.x Entity beans. So any idea on how to use a search engine for my purpose?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42042
    
  64
Can you be more specific on what you're trying to do that SQL can't?

As Maneesh said, Lucene has no built-in capability to index a database. It can be used to search an index once it has been created, but you'd have to write the code to index a DB first. Not a big deal, but just be aware that's what you'll need to do.
[ August 07, 2008: Message edited by: Ulf Dittmer ]
 
GeeCON Prague 2014
 
subject: Help needed on Lucene