Ben,

You do need to use a separate instance of those 3 classes for each
index yes.  But this is really something like:

IndexWriter writer = new IndexWriter(....);

So it's normal code-writing process.... you don't really have to create
anything new, just use existing Lucene API.  As for locking, again you
don't need to create anything.  Lucene does have a locking mechanism,
but most of it should be completely invisible to you if you follow the
concurrency rules.

I hope this helps.

Otis

--- Ben <[EMAIL PROTECTED]> wrote:

> Is it true that for each index I have to create a seperate instance
> for FSDirectory, IndexWriter and IndexReader? Do I need to create a
> seperate locking mechanism as well?
> 
> I have already implemented a program using just one index.
> 
> Thanks,
> Ben
> 
> On Tue, 1 Mar 2005 22:09:05 -0500, Erik Hatcher
> <[EMAIL PROTECTED]> wrote:
> > It's hard to answer such a general question with anything very
> precise,
> > so sorry if this doesn't hit the mark.  Come back with more details
> and
> > we'll gladly assist though.
> > 
> > First, certainly do not copy/paste code.  Use standard reuse
> practices,
> > perhaps the same program can build the two different indexes if
> passed
> > different parameters, or share code between two different programs
> as a
> > JAR.
> > 
> > What specifically are the issues you're encountering?
> > 
> >         Erik
> > 
> > 
> > On Mar 1, 2005, at 8:06 PM, Ben wrote:
> > 
> > > Hi
> > >
> > > My site has two types of documents with different structure. I
> would
> > > like to create an index for each type of document. What is the
> best
> > > way to implement this?
> > >
> > > I have been trying to implement this but found out that 90% of
> the
> > > code is the same.
> > >
> > > In Lucene in Action book, there is a case study on jGuru, it just
> > > mentions them using multiple indexes. I would like to do
> something
> > > like them.
> > >
> > > Any resources on the Internet that I can learn from?
> > >
> > > Thanks,
> > > Ben
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > 
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to