lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Terry Steichen" <te...@net-frame.com>
Subject Re: searching data indexed from database??
Date Sat, 31 May 2003 15:06:49 GMT
Shiv,

Searching in Lucene is field-based.  Thus you must specify the field to be
searched - the only 'exception' is that one field is defined as default.  If
you want to search across multiple fields, I believe you must create a
concatenation of the individual fields into a single one during the indexing
process (eg. productName+" "+productDesc), and then use that as the basis of
your subsequent searches.

HTH,

Terry

----- Original Message -----
From: "Venkatraman, Shiv" <Shiv.Venkatraman@broadvision.com>
To: <lucene-user@jakarta.apache.org>
Sent: Saturday, May 31, 2003 10:33 AM
Subject: searching data indexed from database??


> I have an indexer that reads data from database and indexes the data.
>   foreach(db_row) {
>       Document doc = new Document();
>       doc.add(Field.Text("Product", productName);
>       doc.add(Field.Text("Description", productDesc);
> ...
>       writer.addDocument(doc);
>   }
>
>
> Once indexed, I would like to do a search that spans across multiple
fields.
> i.e. the user may enter "lawnmower" and it should perform a search across
> all the indexed fields. Also, how do I pass user queries like  "lawnmower
> -grass" to the query API?
>
> ---------------------------------------------------------------------
> 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