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 "Robert A. Decker" <de...@robdecker.com> on 2002/08/01 02:07:13 UTC

is this possible in a query?

I have a Text Field named product. Two of the products are:
Cathflo OrthoMed
OrthoMed

When I search for "Cathflo OrthoMed", I correctly only get items that have
the product "Cathflo OrthoMed". However, when I search for "OrthoMed", not
only do I get all "OrthoMed" products, but I also get all "Cathflo
OrthoMed" products.

Is there a way, when searching on a Field.Text type, to limit the above
"OrthoMed" search to only "OrthoMed", and to exclude "Cathflo
OrthoMed"? The solution has to be generic enough to work with any
combination of product names.

thanks,
rob

http://www.robdecker.com/
http://www.planetside.com/


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: is this possible in a query?

Posted by Terry Steichen <te...@net-frame.com>.
I assume that "OrthoMed NOT Cathflo" (or OrthoMed NOT "Cathflow OrthoMed")
doesn't work for you?  I'm not clear what you mean when you specify it must
be generic to work with all products.

Regards,

Terry

----- Original Message -----
From: "Robert A. Decker" <de...@robdecker.com>
To: "Lucene Users List" <lu...@jakarta.apache.org>
Sent: Wednesday, July 31, 2002 8:07 PM
Subject: is this possible in a query?


> I have a Text Field named product. Two of the products are:
> Cathflo OrthoMed
> OrthoMed
>
> When I search for "Cathflo OrthoMed", I correctly only get items that have
> the product "Cathflo OrthoMed". However, when I search for "OrthoMed", not
> only do I get all "OrthoMed" products, but I also get all "Cathflo
> OrthoMed" products.
>
> Is there a way, when searching on a Field.Text type, to limit the above
> "OrthoMed" search to only "OrthoMed", and to exclude "Cathflo
> OrthoMed"? The solution has to be generic enough to work with any
> combination of product names.
>
> thanks,
> rob
>
> http://www.robdecker.com/
> http://www.planetside.com/
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: is this possible in a query?

Posted by Peter Carlson <ca...@bookandhammer.com>.
This depends on your analyzer. Currently it splits on words.

How do you want it to split? Is there other text around this? I guess you
could write your own analyzer that if it finds a special phrase it would add
it as a phrase. If you did it this way, you would have to use similar
methodology to parse the query string itself.


Another option I can think of if you are just indexing text is to have
something that filters out your product names that looks for such things.

So if only OrthoMed is in the query string and not Cathflo then add the
query clause 

NOT Cathflo.

This seems like it might get very complicated though.

I hope someone else comes up with more elegant solutions.

--Peter

On 7/31/02 5:07 PM, "Robert A. Decker" <de...@robdecker.com> wrote:

> I have a Text Field named product. Two of the products are:
> Cathflo OrthoMed
> OrthoMed
> 
> When I search for "Cathflo OrthoMed", I correctly only get items that have
> the product "Cathflo OrthoMed". However, when I search for "OrthoMed", not
> only do I get all "OrthoMed" products, but I also get all "Cathflo
> OrthoMed" products.
> 
> Is there a way, when searching on a Field.Text type, to limit the above
> "OrthoMed" search to only "OrthoMed", and to exclude "Cathflo
> OrthoMed"? The solution has to be generic enough to work with any
> combination of product names.
> 
> thanks,
> rob
> 
> http://www.robdecker.com/
> http://www.planetside.com/
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>