Win a copy of Fixing your Scrum this week in the Agile 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
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Lucene: reload an index

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all.
I'm having a problem with my search engine which is build on lucene.
It's made of a crawler part and a search part.
When the engine starts, it load the index and the search part is available.
Then I start the crawl service which recreate the index.
At the end, I recreate the IndexReader object.
But it seems it doesn't "see" new indexed pages.
Only if I shutdown and restart the engine it can see new pages ...
Any idea ?
Thanks !!!
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't had that problem so can't say much about it. Here's my indexer method. Does it have anything you don't? Like the optimize and close calls?
 
Alex Donato
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the answer, James.
The code of my crawler seems like the one you've posted.
The only difference is about delete before re-create.
I cannot do the same: the search functionality must continues working during indexing so I cannot delete it before new index is complete.
So I create new index using a temp dir. When it finish, the engine stop search , delete old index directory and move temp dir with new indexed page to old dir. Now I try to force a reload of webapp using Tomcat manager ...
Thanks a lot.
If you have any other idea, please let me know!
Have a nice day.
Alex
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to Other Open Source Projects...
 
reply
    Bookmark Topic Watch Topic
  • New Topic