[Yanel-dev] lucene index

Balz Schreier balz.schreier at gmail.com
Thu Dec 9 15:31:16 CET 2010


Hi,
my experience is the following:
If you delete the index (e.g. the parent folder of "fulltext" and
"properties") and you do a query right after the delete, it just does not
find anything anymore (no results).
But if you edit a content item (controlled via resource), the item gets
indexed again.
The same applies for NEW items. But all the items that were in the index
before the deletion, they are gone.

I use the indexRepository() method mentioned by Michi, but slightly
customized:
- I wrote a subclass of the original reindexer class which takes a data
repository xml as argument. This way you can build a new index in parallel
to the existing one. The advantage is that your site can continue to run
while the index gets built (with more than 1 Mio items it can take
hours...). Once the new index has been built, you can swap it (stop app,
swap index, start app).

Cheers
Balz

On Thu, Dec 9, 2010 at 3:20 PM, Michael Wechner
<michael.wechner at wyona.com>wrote:

> Hi Paul
>
>
> On 12/9/10 3:00 PM, Paul Bakker wrote:
>
>> Hi,
>>
>> Can somebody tell me what will happen if I delete the lucene index from =
my
>> realm?
>> Will it get rebuilt somehow?
>>
>
> yes, but only incrementally, whereas IIRC the searcher will throw an
> exception if no index exists yet, hence
> if you delete the index and search right away, then you will receive an
> error, whereas if you delete the index, modify some data and then search =
you
> will be fine.
>
> But I guess you are rather looking for something like
>
>
> src/core/java/org/wyona/yarep/util/YarepUtil.java#indexRepository(Reposit=
ory)
>
> ?
>
> HTH
>
> Michael
>
>>
>> Thanks,
>> Paul
>>
>
> --
> Yanel-development mailing list Yanel-development at wyona.com
> http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wyona.org/pipermail/yanel-development/attachments/2010120=
9/2647e79c/attachment.htm


More information about the Yanel-development mailing list