You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Hayri <vo...@gmail.com> on 2010/02/01 14:17:23 UTC
How to use search index while indexing
Hi,
I want to search an index and at the same time continue to my indexing.
ParallelReader doesn't solve my problem.
It is obvious that I am not searching multiple indexes at the same time.
How can I build a document based lock, more over
I don't want to open and close and index every time while writing.
Merging new index with the old one seems really time
consuming and also I want to search the new index.
Is it possible? Please give hints...
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: How to use search index while indexing
Posted by Ian Lea <ia...@gmail.com>.
I'm not sure that I understand the question. Can you not use a
searcher based on the reader returned by IndexWriter.getReader() to
determine if the doc is already in the index?
Or just use IndexWriter.updateDocument to save or replace as appropriate.
--
Ian.
On Tue, Feb 2, 2010 at 12:21 PM, Hayri <vo...@gmail.com> wrote:
> Ian Lea wrote:
>>
>> Sounds like a job for near realtime search aka NRT.
>>
>> Take a look at IndexWriter.getReader().
>>
>> http://wiki.apache.org/lucene-java/NearRealtimeSearch
>>
>> http://www.lucidimagination.com/blog/2009/04/10/real-time-search-with-lucene/
>>
>> And more with the help of your favourite search engine.
>>
>>
>> --
>> Ian.
>>
>> On Mon, Feb 1, 2010 at 1:17 PM, Hayri <vo...@gmail.com> wrote:
>>
>>>
>>> Hi,
>>>
>>> I want to search an index and at the same time continue to my indexing.
>>> ParallelReader doesn't solve my problem.
>>> It is obvious that I am not searching multiple indexes at the same time.
>>> How
>>> can I build a document based lock, more over
>>> I don't want to open and close and index every time while writing.
>>> Merging
>>> new index with the old one seems really time
>>> consuming and also I want to search the new index.
>>>
>>> Is it possible? Please give hints...
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>>
>
> Hi Thanks,
>
> I have another related question. I want to decide whether I can index the
> document,
> so basically when a new document comes I need to make a search in a specific
> field in index.
> The problem is I don't need to create a IndexSearcher to search for every
> document to find if it indexed or not.
> I can gather and index the documents to RAM for example. But after certain #
> of documents ?? I have to decide to
> merge the index except the documents that are already in file index (for
> specific fields like unique).
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: How to use search index while indexing
Posted by Hayri <vo...@gmail.com>.
Ian Lea wrote:
> Sounds like a job for near realtime search aka NRT.
>
> Take a look at IndexWriter.getReader().
>
> http://wiki.apache.org/lucene-java/NearRealtimeSearch
> http://www.lucidimagination.com/blog/2009/04/10/real-time-search-with-lucene/
>
> And more with the help of your favourite search engine.
>
>
> --
> Ian.
>
> On Mon, Feb 1, 2010 at 1:17 PM, Hayri <vo...@gmail.com> wrote:
>
>> Hi,
>>
>> I want to search an index and at the same time continue to my indexing.
>> ParallelReader doesn't solve my problem.
>> It is obvious that I am not searching multiple indexes at the same time. How
>> can I build a document based lock, more over
>> I don't want to open and close and index every time while writing. Merging
>> new index with the old one seems really time
>> consuming and also I want to search the new index.
>>
>> Is it possible? Please give hints...
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
>
Hi Thanks,
I have another related question. I want to decide whether I can index
the document,
so basically when a new document comes I need to make a search in a
specific field in index.
The problem is I don't need to create a IndexSearcher to search for
every document to find if it indexed or not.
I can gather and index the documents to RAM for example. But after
certain # of documents ?? I have to decide to
merge the index except the documents that are already in file index (for
specific fields like unique).
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: How to use search index while indexing
Posted by Ian Lea <ia...@gmail.com>.
Sounds like a job for near realtime search aka NRT.
Take a look at IndexWriter.getReader().
http://wiki.apache.org/lucene-java/NearRealtimeSearch
http://www.lucidimagination.com/blog/2009/04/10/real-time-search-with-lucene/
And more with the help of your favourite search engine.
--
Ian.
On Mon, Feb 1, 2010 at 1:17 PM, Hayri <vo...@gmail.com> wrote:
> Hi,
>
> I want to search an index and at the same time continue to my indexing.
> ParallelReader doesn't solve my problem.
> It is obvious that I am not searching multiple indexes at the same time. How
> can I build a document based lock, more over
> I don't want to open and close and index every time while writing. Merging
> new index with the old one seems really time
> consuming and also I want to search the new index.
>
> Is it possible? Please give hints...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org