lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerard Sychay" <>
Subject RE: multivalue fields
Date Wed, 12 May 2004 17:51:50 GMT
I don't know if it will help, but take a look at the following email and
enclosing thread from a few weeks ago.

>>> "Ryan Sonnek" <> 05/11/04 12:40PM >>>
using lucene 1.3-final, it appears to only search the first field with
that name.  here's the code i'm using to construct the index, and I'm
using Luke to check that the index is created correctly.  Everything
looks fine, but my search returns empty.  do i have to use a special
query to work with multivalue fields?  is there a testcase in the source
that performs this kind of work that I could look at?

	      Document doc = new Document();

            Iterator values = myValues.iterator();
            while (values.hasNext()) {
                Object value =;
                doc.add(Field.Keyword("test", value.toString()));
           BooleanQuery query = new BooleanQuery();
           Query fieldQuery = QueryParser.parse("searchValue", "test",
           query.add(fieldQuery, true, false);

> -----Original Message-----
> From: Otis Gospodnetic [] 
> Sent: Tuesday, May 11, 2004 11:31 AM
> To: Lucene Users List
> Subject: Re: multivalue fields
> Just add multiple Fields with the exact same name.
> Otis
> --- Ryan Sonnek <> wrote:
> > How can I construct a document that has multiple values for 
> one field
> > (ex: locale en_US, de_DE, etc).  I've been concatonating the
> > into one string and storing them in one field, but I think this
> > affects the search rankings (more text to search produces lower
> > score).  is it possible to append the seperate values to the same
> > field without concatonating them together?
> > 
> > Ryan
> > 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message