[hibernate-issues] [Hibernate-JIRA] Resolved: (HSEARCH-11) Provide access to IndexWriter.optimize()

Emmanuel Bernard (JIRA) noreply at atlassian.com
Tue Jun 5 17:01:04 EDT 2007


     [ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-11?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Bernard resolved HSEARCH-11.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 3.0.0.beta3

Hi Andrew,
I applied the first part of your patch (minus the concurrency issue).
I will apply the second part later on, I want to do it slightly differently. (HSEARCH-73)

Thanks for the patch

> Provide access to IndexWriter.optimize()
> ----------------------------------------
>
>                 Key: HSEARCH-11
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-11
>             Project: Hibernate Search
>          Issue Type: New Feature
>    Affects Versions: 3.0.0.beta3
>            Reporter: Emmanuel Bernard
>             Fix For: 3.0.0.beta3
>
>         Attachments: patch.txt
>
>
> The problem is not solved "automatically" yet. But here is the reason why.
> First of all, the elements are properly deleted, and the index file reflect that as soon as IndexReader.close() is called (which is done by Hibernate Search). However, the files containing the document data are not cleaned.
> Basically, to physically delete the elements, you need to optimize() your index, this operation typically takes more time and doing it for every single delete is not appropriate.
> I see 4 solutions:
>  1. let the user access the Directory and call the indexWriter.optimize() method. It works today but it sucks.
>  2. add an FullTextSession.optimize(Class) method, and the application is responsible for the method trigger. This is the easy solution but put more work on the user. And I'm not happy to push a maintenance API to the Session. Esp since this is more of a SessionFactory like API.
>  2bis. publish this API through JMX
>  3. optimize every N operations. It is trivial to add a counter per DirectoryProvider and trigger the optimization. N should be customizable
>  4. optimize every N seconds. either by setting a timer in an additional thread or wait for the next operation and compare the timestamp
> 2(bis or not) and 3 are my favorites. It's really 2 or 3 hours of work. If someone is interested, ping me.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list