lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <>
Subject Re: How do you check a field has been indexed correctly if not stored ?
Date Tue, 05 Jan 2010 16:24:19 GMT
One way to handle this is to run some searches and check to see
if the number of matched documents is what you expect.

You could also use some of the TermDocs to inspect your
index to see if things are what you expect.

You could knock yourself out and look at things like
TermPositionVector and TermFreqVector and see if the
terms you're interested in are in the positions you expect.

But I've been satisfied with just doing the first option, run a search
and see if you get exactly what you expect.....


On Tue, Jan 5, 2010 at 11:08 AM, Paul Taylor <> wrote:

> In my junittest code, I check the index has been created okay by checking
> the value of various fields that have been indexed (and stored)
>   i.e assertEquals("Farming Incident",
> doc.getField(ArtistIndexField.ARTIST.getName()).stringValue());
> But if I'm only indexing the field , but not storing it the value isnt
> held, what else could i check instead
> thanks Paul
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message