lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: repeating fields
Date Wed, 07 Dec 2005 13:22:33 GMT

On Dec 7, 2005, at 3:49 AM, Reza Ghaffaripour wrote:

> hi all,
> im new to lucene. i have an xml with repeating tags.something like :
> <a>
> <p>x</p>
> <p>xx</p>
> <p>xxx</p>
> <p>xxxx</p>
> </a>
>
> I add the "p" field as follows:
> myDocument.add(Field.Text("p", "x"));
> myDocument.add(Field.Text("p", "xx"));
>
> but when i search for "x" it returns the first hit only.
> what should i do ? i want to search for "x" and get all the 4 hits.

Hits return Documents.  You indexed only a single document, not 4.   
If you would like each <p> element to be a separate hit then index  
each as a separate Document.

	Erik


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


Mime
View raw message