FAQ
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.

Search Discussions

  • Bhavin Pandya at Mar 13, 2007 at 10:25 am
    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" <Sachin.Kainth@atkinsglobal.com>
    To: <java-user@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
  • Xiaocheng Luan at Mar 14, 2007 at 2:49 am
    Or, you may index the fields that you want "exact matches" as non-tokenized.
    Thanks,
    Xiaocheng

    Bhavin Pandya 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.
  • Doron Cohen at Mar 14, 2007 at 7:33 am
    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" <Sachin.Kainth@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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedMar 13, '07 at 10:19a
activeMar 14, '07 at 7:33a
posts4
users4
websitelucene.apache.org

People

Translate

site design / logo © 2021 Grokbase