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 "Kainth, Sachin" <Sa...@atkinsglobal.com> on 2007/03/13 11:18:50 UTC

Complete field search

Hi all,

Is it possible to search whether a term is equal to the entire contents
of a field rather than that the field contains a term?

So for example if I have a field with this text: "world cup" and I do a
search for "cup" I want it to return false but for another field that
contains exactly the text "cup" I want the result to be true.

Thanks in advance


This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.

The ultimate parent company of the Atkins Group is WS Atkins plc.  Registered in England No. 1885586.  Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.

Consider the environment. Please don't print this e-mail unless you really need to. 

Re: Complete field search

Posted by Xiaocheng Luan <je...@yahoo.com>.
Or, you may index the fields that you want "exact matches" as non-tokenized.
Thanks,
Xiaocheng

Bhavin Pandya <bh...@rediff.co.in> wrote: Hi kainth,

>So for example if I have a field with this text: "world cup" and I do a
>search for "cup" I want it to return false but for another field that
>contains exactly the text "cup" I want the result to be true.

You fire only phrase query on the first field where you want only "world 
cup" as a result
while on second field fire Phrase query as well as term query...Or only term 
query depends on your need.

Thanks.
Bhavin pandya

----- Original Message ----- 
From: "Kainth, Sachin" 
To: 
Sent: Tuesday, March 13, 2007 3:48 PM
Subject: Complete field search


Hi all,

Is it possible to search whether a term is equal to the entire contents
of a field rather than that the field contains a term?

So for example if I have a field with this text: "world cup" and I do a
search for "cup" I want it to return false but for another field that
contains exactly the text "cup" I want the result to be true.

Thanks in advance


This email and any attached files are confidential and copyright protected. 
If you are not the addressee, any dissemination of this communication is 
strictly prohibited. Unless otherwise expressly agreed in writing, nothing 
stated in this communication shall be legally binding.

The ultimate parent company of the Atkins Group is WS Atkins plc. 
Registered in England No. 1885586.  Registered Office Woodcote Grove, Ashley 
Road, Epsom, Surrey KT18 5BW.

Consider the environment. Please don't print this e-mail unless you really 
need to.


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



 
---------------------------------
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.

Re: Complete field search

Posted by Bhavin Pandya <bh...@rediff.co.in>.
Hi kainth,

>So for example if I have a field with this text: "world cup" and I do a
>search for "cup" I want it to return false but for another field that
>contains exactly the text "cup" I want the result to be true.

You fire only phrase query on the first field where you want only "world 
cup" as a result
while on second field fire Phrase query as well as term query...Or only term 
query depends on your need.

Thanks.
Bhavin pandya

----- Original Message ----- 
From: "Kainth, Sachin" <Sa...@atkinsglobal.com>
To: <ja...@lucene.apache.org>
Sent: Tuesday, March 13, 2007 3:48 PM
Subject: Complete field search


Hi all,

Is it possible to search whether a term is equal to the entire contents
of a field rather than that the field contains a term?

So for example if I have a field with this text: "world cup" and I do a
search for "cup" I want it to return false but for another field that
contains exactly the text "cup" I want the result to be true.

Thanks in advance


This email and any attached files are confidential and copyright protected. 
If you are not the addressee, any dissemination of this communication is 
strictly prohibited. Unless otherwise expressly agreed in writing, nothing 
stated in this communication shall be legally binding.

The ultimate parent company of the Atkins Group is WS Atkins plc. 
Registered in England No. 1885586.  Registered Office Woodcote Grove, Ashley 
Road, Epsom, Surrey KT18 5BW.

Consider the environment. Please don't print this e-mail unless you really 
need to.


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


Re: Complete field search

Posted by Doron Cohen <DO...@il.ibm.com>.
This came up in the list with several solutions - look for:
  Asserting that a value must match the entire content of a field

Doron

"Kainth, Sachin" <Sa...@atkinsglobal.com> wrote on 13/03/2007
03:18:50:

> Hi all,
>
> Is it possible to search whether a term is equal to the entire contents
> of a field rather than that the field contains a term?
>
> So for example if I have a field with this text: "world cup" and I do a
> search for "cup" I want it to return false but for another field that
> contains exactly the text "cup" I want the result to be true.
>
> Thanks in advance
>
>
> This email and any attached files are confidential and copyright
> protected. If you are not the addressee, any dissemination of this
> communication is strictly prohibited. Unless otherwise expressly
> agreed in writing, nothing stated in this communication shall be
> legally binding.
>
> The ultimate parent company of the Atkins Group is WS Atkins plc.
> Registered in England No. 1885586.  Registered Office Woodcote
> Grove, Ashley Road, Epsom, Surrey KT18 5BW.
>
> Consider the environment. Please don't print this e-mail unless you
> really need to.


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