You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by "Kevin L. Cobb" <ke...@emergint.com> on 2005/10/26 18:28:50 UTC

Help with Search Java Code set up

I've been using Lucene happily for a couple of years now. But, this new
search functionality I'm trying to add is somewhat different that what
I'm used to doing. Would help if the smart folks on this list would
drive me in the right direction.
 
I have several "searchable" fields and one keyword field in my index. I
usually work with EITHER the keyword or the searchable (non-keyword)
fields at a time, but this time I want to deal with them together. I
need to be able to do a term search in the "searchable" fields but at
the same time apply another term to the keyword field.
 
At this point, I'm thinking that I'll need to do two distinct searches,
one using the search term in what I'm calling my searchable fields, and
the other using the other term in the keyword field. Then join the two
HIT lists together.
 
Looking for some advice. 
 
Thanks,
 
Kevin
 

 

Re: Help with Search Java Code set up

Posted by Yonik Seeley <ys...@gmail.com>.
Hi Kevin,
Your description is rather generic... could you be more specific why you
couldn't just create a BooleanQuery that searches across the searchable and
keyword fields at the same time?

-Yonik
Now hiring -- http://forms.cnet.com/slink?231706


On 10/26/05, Kevin L. Cobb <ke...@emergint.com> wrote:
>
> I've been using Lucene happily for a couple of years now. But, this new
> search functionality I'm trying to add is somewhat different that what
> I'm used to doing. Would help if the smart folks on this list would
> drive me in the right direction.
>
> I have several "searchable" fields and one keyword field in my index. I
> usually work with EITHER the keyword or the searchable (non-keyword)
> fields at a time, but this time I want to deal with them together. I
> need to be able to do a term search in the "searchable" fields but at
> the same time apply another term to the keyword field.
>
> At this point, I'm thinking that I'll need to do two distinct searches,
> one using the search term in what I'm calling my searchable fields, and
> the other using the other term in the keyword field. Then join the two
> HIT lists together.
>
> Looking for some advice.
>
> Thanks,
>
> Kevin
>

Re: Help with Search Java Code set up

Posted by Jeff Rodenburg <je...@gmail.com>.
Kevin -

Maybe I'm misunderstanding, but how is this not a BooleanQuery with two
clauses?

- j

On 10/26/05, Kevin L. Cobb <ke...@emergint.com> wrote:
>
> I've been using Lucene happily for a couple of years now. But, this new
> search functionality I'm trying to add is somewhat different that what
> I'm used to doing. Would help if the smart folks on this list would
> drive me in the right direction.
>
> I have several "searchable" fields and one keyword field in my index. I
> usually work with EITHER the keyword or the searchable (non-keyword)
> fields at a time, but this time I want to deal with them together. I
> need to be able to do a term search in the "searchable" fields but at
> the same time apply another term to the keyword field.
>
> At this point, I'm thinking that I'll need to do two distinct searches,
> one using the search term in what I'm calling my searchable fields, and
> the other using the other term in the keyword field. Then join the two
> HIT lists together.
>
> Looking for some advice.
>
> Thanks,
>
> Kevin
>
>
>
>
>

Re: Help with Search Java Code set up

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Are you simply looking to use multiple terms in your search?  In that
case, simply use BooleanQuery instead of TermQuery.  QueryParser will
recognize strings like    foo AND bar    or    +foo +bar    and turn
that into a BooleanQuery for you.

Otis

--- "Kevin L. Cobb" <ke...@emergint.com> wrote:

> I've been using Lucene happily for a couple of years now. But, this
> new
> search functionality I'm trying to add is somewhat different that
> what
> I'm used to doing. Would help if the smart folks on this list would
> drive me in the right direction.
>  
> I have several "searchable" fields and one keyword field in my index.
> I
> usually work with EITHER the keyword or the searchable (non-keyword)
> fields at a time, but this time I want to deal with them together. I
> need to be able to do a term search in the "searchable" fields but at
> the same time apply another term to the keyword field.
>  
> At this point, I'm thinking that I'll need to do two distinct
> searches,
> one using the search term in what I'm calling my searchable fields,
> and
> the other using the other term in the keyword field. Then join the
> two
> HIT lists together.
>  
> Looking for some advice. 
>  
> Thanks,
>  
> Kevin
>  
> 
>  
> 


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