lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerard Sychay" <Gerard.Syc...@cchmc.org>
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.

http://nagoya.apache.org/eyebrowse/ReadMsg?listName=lucene-user@jakarta.apache.org&msgNo=7737

>>> "Ryan Sonnek" <rsonnek@DigitalRiver.com> 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?

		//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


Mime
View raw message