This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer (Exam 1Z0-830) Java SE 17 Developer (Exam 1Z0-829) Programmer’s Guide and have Khalid Mughal and Vasily Strelnikov on-line!
See this thread for details.
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

How to rebuild Hibernate Search index to sync with database

 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

I accidentally deleted my Hibernate Search index file on my local server. So, I'm wondering how I can rebuild index to sync with the data in the database?

Here's a sample of my entity annotation:


Please ...HeLP!!!
 
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Nina Anderson:
Hi guys,

I accidentally deleted my Hibernate Search index file on my local server. So, I'm wondering how I can rebuild index to sync with the data in the database?

Here's a sample of my entity annotation:


Please ...HeLP!!!



First Write an Hibernate Code to retrieve all the Data you want indexed next instantiate a FullTextSession and Iterate through the retrieved Set ...

FullTextSession fullTextSession = Search.createFullTextSession(session);
Transaction tx = fullTextSession.beginTransaction();
List<AbstractBusinessCbo > abstractBusinessCboS = jAbstractBusinessCbo DAO.findAllData();

for (AbstractBusinessCbo abstractBusinessCbo : abstractBusinessCboS ) {
fullTextSession.index(abstractBusinessCbo );
}
}
 
reply
    Bookmark Topic Watch Topic
  • New Topic