This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques and have Mario Casciaro & Luciano Mammino on-line!
See this thread for details.
Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Lucene in Action: integration with db?

 
blacksmith
Posts: 979
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9690
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9690
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
does lucene use db index ?
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9690
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic