lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan Sonnek" <rson...@DigitalRiver.com>
Subject RE: multivalue fields
Date Tue, 11 May 2004 16:40:36 GMT
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?

		//indexing
	      Document doc = new Document();

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


> -----Original Message-----
> From: Otis Gospodnetic [mailto:otis_gospodnetic@yahoo.com]
> 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 <rsonnek@DigitalRiver.com> 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 values
> > 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: lucene-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 
> 

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


Mime
View raw message