Re: Concurrent Indexing + Searching

2008-02-05 Thread ajay_garg
Thanks a ton Mark. I am really obliged to interact with you, who is never hesistant to reply on the slightest of queries. Thanks again. Ajay Garg markrmiller wrote: > > >> Again, if the >> indexerThreads are bombarding the writer continuously, then the moment, >> when >> no indexer is accessi

Re: Concurrent Indexing + Searching

2008-02-05 Thread Mark Miller
Again, if the indexerThreads are bombarding the writer continuously, then the moment, when no indexer is accessing the writer, may never come. Thus, I invested some of my time, and wrote my own code, to control the sleeping of indexerThreads. I don't know how much of a concern this is. All y

Re: Concurrent Indexing + Searching

2008-02-05 Thread ajay_garg
Thanks Mark. Just one last thing, this issue seems to be similar to the case, where the Lucene source code says, that if an explicit "flush" method is called on an IndexWriter instance, then again, it will wait for all the indexerThreads to release the writer, and only then will the flush happen

Re: Concurrent Indexing + Searching

2008-02-05 Thread Mark Miller
P.S. About that write bombardment...its still very difficult for that to be a problem. Take a look at the tests. I start a bunch of threads searching as fast as they can, and a bunch of threads writing as fast as they can - nonstop. And still there are plenty of moments where the references h

Re: Concurrent Indexing + Searching

2008-02-05 Thread Mark Miller
ajay_garg wrote: Thanks Mark. Ok, I got your point. So it happens like this : a) If it is me, who is re-opening an IndxReader, at any time, but "manually-programmatically". That is, I don't want a-sort-of-automatic-reopening-of-IndexWriter, then I am fine. Sure...your kind of doing what In

Re: Concurrent Indexing + Searching

2008-02-05 Thread ajay_garg
Thanks Mark. Ok, I got your point. So it happens like this : a) If it is me, who is re-opening an IndxReader, at any time, but "manually-programmatically". That is, I don't want a-sort-of-automatic-reopening-of-IndexWriter, then I am fine. b) If I do wish this automatic-reopening of index (usin

Re: Concurrent Indexing + Searching

2008-02-04 Thread Mark Miller
You are right that if auto-commit=true and a user reopens an IndexReader, the docs will absolutely be visible as they are flushed. I think the part you are missing is that you need to be cooperating with the IndexAccessor: a user should not be reopening an IndexReader. The whole point of IndexA

Re: Concurrent Indexing + Searching

2008-02-03 Thread ajay_garg
@Mark. I am sorry, but I need a bit more of explanation. So you mean to say :: "If auto-commit is false, then of course, docs will not be visible in the index, until all the threads release themselves out of a particular IndexWriter instance, and close() the IndexWriter instance. If auto-commit

Re: Concurrent Indexing + Searching

2008-02-03 Thread Mark Miller
You are correct that autocommit=false means that docs will be in the index before the last thread releases its concurrent hold on a Writer, *but because IndexAccessor controls* *when the IndexSearchers are reopened*, those docs will still not be visible until the last thread holding a Writer re

Re: Concurrent Indexing + Searching

2008-02-03 Thread ajay_garg
Hi. Sorry if I seem a stranger in this thread, but there is something that I can't resist clearing myself on. Mark, you say that the additional documents added to a index, won't show up until the # of threads accessing the index hits 0; and subsequently the indexwriter instance is closed. But I

Re: Concurrent Indexing + Searching

2008-02-01 Thread Mark Miller
1) I should be calling release of writer and searcher after every call. Is it always mandatory in cases like searcher, when I am sure that I havn't written anything since the last search ? You have to be careful here. It works like this: a single searcher is cached and returned every time. O

Re: Concurrent Indexing + Searching

2008-02-01 Thread Infinite Tester
Thanks Mark! Option D looks great. Regarding that option, I have couple of questions based on my first glance at the code ( more specifically SimpleSearchServer ) 1) I should be calling release of writer and searcher after every call. Is it always mandatory in cases like searcher, when I am sure

Re: Concurrent Indexing + Searching

2008-02-01 Thread Mark Miller
You are not seeing the doc because you need to close the IndexWriter first. To have an interactive index you can: A: roll your own. B: use Solr. C: use the original LuceneIndexAccessor https://issues.apache.org/jira/browse/LUCENE-390 D: use my updated IndexAccessor https://issues.apache.org/ji

Concurrent Indexing + Searching

2008-02-01 Thread codetester
Hi All, A newbie out here I am using lucene 2.3.0. I need to use lucene to perform live searching and indexing. To achieve that, I tried the following FSDirectory directory = FSDirectory.getDirectory(location); IndexReader reader = IndexReader.open(directory ); IndexWriter writer = new Index