This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Lucene in Action: integration with db?

 
blacksmith
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Lucene can perform searches using indexes stored
on the file system.

Is it possible to integrate this functionality with
database searches as well?

Is this what Hibernate search does?

Cheers,

Gian

 
Sheriff
Posts: 9643
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes hibernate search uses Lucene. Since hibernate does it, we can do it ourselves as well
 
Gian Franco
blacksmith
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ankit Garg wrote:Yes hibernate search uses Lucene. Since hibernate does it, we can do it ourselves as well



So Lucene search integrates with the SQL used under the hood for querying the database?
 
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Gian Franco wrote:So Lucene search integrates with the SQL used under the hood for querying the database?


No, Hibernate Search -which uses Lucene under the hood- does that: http://www.hibernate.org/subprojects/search.html
 
Ankit Garg
Sheriff
Posts: 9643
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I know, hibernate uses lucene to create index of the database. That index is then used during searching not the actual database...
 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Is it possible to integrate this functionality with
database searches as well?


The answer is "Directly No" and "Indirectly Yes"

Lucene works in a different way when compared to database.

Lucene uses its own Indexes within which it searches, ranks and fetches the results.

You should/could add the DB values to the Lucene index for Lucene to search. You could write custom jobs for that (Which would ab a kind a crawler).


http://wiki.apache.org/lucene-java/LuceneFAQ#How_can_I_use_Lucene_to_index_a_database.3F

Cheers
Aneesh
 
Ranch Hand
Posts: 8934
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
does lucene use db index ?
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Pradeep bhatt wrote:does lucene use db index ?


Not unless you write indexing (or search) code to make it do so.
 
Ankit Garg
Sheriff
Posts: 9643
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are asking for Hibernate Search, it doesn't use db index (that's what I can say by looking docs).

Lucene also doesn't use db index automatically, you can however make lucene use db index, check this...
 
Gian Franco
blacksmith
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Pradeep bhatt wrote:does lucene use db index ?



...what are you thinking of when you say db index?

Lucene will not use the database's own indexes, those db data structures that help speed up retrieval of data,
since they are the database's own...

Lucene's own indexes could be stored in a database, but I don't think this is something provided out of
the box...you'd have to have some additional code taking care of that...

Cheers,

Gian
 
I am a man of mystery. Mostly because of this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!