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 Doug Kirk <do...@dougandalli.com> on 2003/05/22 19:30:56 UTC

Why would a searcher not find an added document?

After deleting a document from the index, and then adding a document to 
the index (same doc with updated info), it seems that the IndexSearcher 
doesn't find the updated document.

Whether I specify no limiting criteria (to find all docs), or specific 
criteria to find just the doc I'm interested in, the new doc is never 
found. I'm not caching anything, so each time a search is done a new 
IndexSearcher is created. Additionally, when I delete I use a new 
IndexReader, and to add I use a new IndexWriter.

I'm using 1.3-RC1, but the same issue occurs on 1.2.

What the heck could I be doing wrong??

P.S.  I know that the document is in the index, because I wrote a Swing 
Lucene browser that lets me view the index and its docs using a 
TreePane and an EditorPane (which I'd be happy to contribute if 
somebody would like it).


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


Re: Why would a searcher not find an added document?

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Hm, it's ahrd to help without seeing any of the code.
I suggest you create a small 'add a document, search the index' test
case that demonstrates the problem.
My guess is that you'll figure out what you are doing wrong while
writing this class :)

Otis

--- Doug Kirk <do...@dougandalli.com> wrote:
> > Also make sure that you use the same analyzer during indexing and 
> > searching.
> 
> I use the same analyzer class (StandardAnalyzer), but a new instance 
> for each search, and each document addition. Is that causing a
> problem?
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

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


Re: Why would a searcher not find an added document?

Posted by Doug Kirk <do...@dougandalli.com>.
> Also make sure that you use the same analyzer during indexing and 
> searching.

I use the same analyzer class (StandardAnalyzer), but a new instance 
for each search, and each document addition. Is that causing a problem?


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


Re: Why would a searcher not find an added document?

Posted by ne...@hotu.com.
Doug Kirk wrote:

>> Doug,
>>
>> Close IndexWriter and open a new IndexReader/Searcher.
>> For some people lots of people asked this same question this week :)
>
>
> Yes, I'm already doing that and still the document isn't found!


Also make sure that you use the same analyzer during indexing and 
searching.


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


Re: Why would a searcher not find an added document?

Posted by Doug Kirk <do...@dougandalli.com>.
> Doug,
>
> Close IndexWriter and open a new IndexReader/Searcher.
> For some people lots of people asked this same question this week :)

Yes, I'm already doing that and still the document isn't found!


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


Re: Why would a searcher not find an added document?

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Doug,

Close IndexWriter and open a new IndexReader/Searcher.
For some people lots of people asked this same question this week :)

Regarding the Swing app, yes, that would be nice to see, and if you
want to contribute it, we can put it in Lucene Sandbox.

Thanks,
Otis


--- Doug Kirk <do...@dougandalli.com> wrote:
> After deleting a document from the index, and then adding a document
> to 
> the index (same doc with updated info), it seems that the
> IndexSearcher 
> doesn't find the updated document.
> 
> Whether I specify no limiting criteria (to find all docs), or
> specific 
> criteria to find just the doc I'm interested in, the new doc is never
> 
> found. I'm not caching anything, so each time a search is done a new 
> IndexSearcher is created. Additionally, when I delete I use a new 
> IndexReader, and to add I use a new IndexWriter.
> 
> I'm using 1.3-RC1, but the same issue occurs on 1.2.
> 
> What the heck could I be doing wrong??
> 
> P.S.  I know that the document is in the index, because I wrote a
> Swing 
> Lucene browser that lets me view the index and its docs using a 
> TreePane and an EditorPane (which I'd be happy to contribute if 
> somebody would like it).
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

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