lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Harvey <char...@knightridder.com>
Subject Re: Searching multiple fields in one Index of Documents
Date Tue, 12 Feb 2002 18:06:13 GMT
Good idea, I had not though to delimit any of the params. I can operate in 
that fashion, but it present a few problems:
All fields would have to be concatenated.
Date (Search by date < or >) would have to be pulled out to java
All IS queries would have to be pulled by java.

This means that I would have to get the entire result set back based only 
on the actual word query, and then sort through the documents turning those 
params into date object, etc - performing an entire extra set of search and 
elimination operations... doubtlessly slowing the whole efficient process 
down to a crawl.

However, if it is the only way...

I looked at the MultiSearcher, but that only seemed to possess the ability 
to search multiple indexes, not fields. I also look at the multi-term 
query, but the constructor for that only takes one term, not an array of 
terms, and I don't see that a term can be constructed that contains 
multiple terms !? I'm a bit lost as to why it should be called multi 
anything in the first place.



At 03:50 PM 2/11/2002 -0600, you wrote:
>I have a bunch of html text boxes on a page to represent database fields and
>then programmatically add the field name and a colon in front of each value
>before sending it on to the QueryParser--like--> description:harley
>keyword:jacket
>
>When I need to search for the same thing across multiple fields I added a
>field to the document when I indexed that had the values from ALL of the
>fields, a bit redundant but I can't find a better way.  I have 8 fields
>indexed of 1.2 million documents for a grand total of 600MB and I still get
>good search times.
>
>Jonathan Pace
>Sr Programmer Analyst
>FedEx Services
>
>
>----- Original Message -----
>From: "Charles Harvey" <charvey@knightridder.com>
>To: <lucene-user@jakarta.apache.org>
>Sent: Monday, February 11, 2002 6:39 PM
>Subject: Searching multiple fields in one Index of Documents
>
>
> > I have a working installation of Lucene running against indexes created by
> > a database query.
> > Each Document in the Index contains fifteen or twenty fields. I am
> > currently searching only one field (that contains concatenated database
> > columns) because I cannot figure out how to search multiple fields. So:
> >
> > How can I use Lucene to search more than one field in an Index of
>Documents?
> >
> > eg:
> > field CATEGORY is(or contains) 'bar'
> > AND
> > field BODY contains 'foo'
> >
> >
> >
> >
> > _________________
> >
> > "The trouble with the rat-race is that even if you win you're still a
>rat."
> > --Lily Tomlin
> > _________________
> > Charles Harvey
> > Developer
> > http://www.philly.com
> > Wk: 215 789 6057
> > Cell: 215 588 0851
> >
> >
> > --
> > To unsubscribe, e-mail:
><mailto:lucene-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
><mailto:lucene-user-help@jakarta.apache.org>
> >
>
>
>--
>To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>

_________________

"The trouble with the rat-race is that even if you win you're still a rat."
--Lily Tomlin
_________________
Charles Harvey
Developer
http://www.philly.com
Wk: 215 789 6057
Cell: 215 588 0851


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


Mime
View raw message