Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-User

Re: Multiple-field queries

 

 

Lucene java-user RSS feed   Index | Next | Previous | View Threaded


otis_gospodnetic at yahoo

Oct 14, 2006, 9:29 PM

Post #1 of 1 (393 views)
Permalink
Re: Multiple-field queries

Redirecting to java-user.
I wouldn't worry too much about complexity of option 1, unless you know that's just the nature of your app.
Note that going with option one you benefit from the ability to assign different boosts to different fields, length norm comes into play when scoring, etc.

Otis

----- Original Message ----
From: Enzo Michelangeli <enzomich[at]gmail.com>
To: java-dev[at]lucene.apache.org
Sent: Sunday, October 15, 2006 12:14:51 AM
Subject: Multiple-field queries

I need to be able to search over multiple fields at the same time. The
suggestions I have seen so far to solve this problem are either:

1. Use a boolean query, or
2. During indexing, create an extra "all" field and add it every time
another field is added to the document.

However, 1. may make the query very large and inefficient, and 2. is
problematic with fields built from a Reader, because the Reader gets closed
after the first field is indexed (and using a cloned Reader would require
running a text extractor twice, which sounds wasteful of CPU cycles).

Would it be possible to add to the API some method to add in on stroke
multiple fields that share a same Reader, while using that Reader only once,
or to define fields with an array of names (such as Field f = new
Field(String[], Reader) ) rather than a single name?

If not, are there alternative ways to achieve my goal, other than
pre-reading the data into a String, which is obviously dangerous because it
can cause a memory allocation failure if the end of file doesn't arrive soon
enough?

Thanks --

Enzo


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe[at]lucene.apache.org
For additional commands, e-mail: java-dev-help[at]lucene.apache.org





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

Lucene java-user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.