lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: DO NOT REPLY [Bug 34995] - Contribution: LuceneIndexAccessor
Date Wed, 25 May 2005 19:00:44 GMT
What I described is really nothing more than a few methods like this:

    public void index(Indexable data)
        throws IOException
    {
        synchronized(_directory)
        {
            IndexWriter writer = getFSWriter();
            try
            {
                Document doc = createDocument(
                    data.getUnStoredFields(),
                    data.getTextFields(),
                    data.getKeywordFields());
                writer.addDocument(doc);
            }
            finally
            {
                writer.close();
            }
        }
    }

Maik's contribution sounds better, and I'll likely adopt it in my
projects.

Otis


--- Daniel Naber <lucenelist@danielnaber.de> wrote:
> On Sunday 22 May 2005 20:17, Otis Gospodnetic wrote:
> 
> > To deal with managing index-modifying access to the index I often
> use
> > code that acts as a facade to IndexReader/Writer and provides
> methods
> > such as index(....), optimize(), and delete(....).  All of these
> > methods have index-modifying code inside a "synchronized
> > (_myDirInstanceHere)" block.
> 
> That sounds quite useful. Any chance you can contribute this to
> Lucene?
> 
> Regards
>  Daniel
> 
> -- 
> http://www.danielnaber.de
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message