FAQ
Hi,
What is the optimum way in which I can find all the document which has particular field in it.

Example
I want to find all the document in which the field text is not null.

Regards,
Allahbaksh

Allahbaksh Mohammedali Asadullah,
Software Engineering & Technology Labs,
Infosys Technolgies Limited, Electronics City,
Hosur Road, Bangalore 560 100, India.
*Board: +91-80-28520261 | Extn: 53915 | Direct: 41173915.
Fax: +91-80-28520362 | Mobile: +91-9845505322.
http://setlabs/slim/
http://allahbaksh.blogspot.com<http://allahbaksh.blogspot.com/>





**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
for the use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further, you are not
to copy, disclose, or distribute this e-mail or its contents to any other person and
any such actions are unlawful. This e-mail may contain viruses. Infosys has taken
every reasonable precaution to minimize this risk, but is not liable for any damage
you may sustain as a result of any virus in this e-mail. You should carry out your
own virus checks before opening the e-mail or attachment. Infosys reserves the
right to monitor and review the content of all messages sent to or from this e-mail
address. Messages sent to or from this e-mail address may be stored on the
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

Search Discussions

  • Zhaoxueqing at Mar 4, 2009 at 5:52 am
    all the document?

    how about to create a new index which hold the field all which you want to find.?

    like database

    every document like a table

    you can not search a field from all table directly.

    but

    you can build a view use union. or a new table hold the field you need only.



    ----- Original Message -----
    From: "Allahbaksh Mohammedali Asadullah" <Allahbaksh_Asadullah@infosys.com>
    To: <java-user@lucene.apache.org>
    Sent: Wednesday, March 04, 2009 1:42 PM
    Subject: Optimum way to find all document without particular field


    Hi,
    What is the optimum way in which I can find all the document which has particular field in it.

    Example
    I want to find all the document in which the field text is not null.

    Regards,
    Allahbaksh

    Allahbaksh Mohammedali Asadullah,
    Software Engineering & Technology Labs,
    Infosys Technolgies Limited, Electronics City,
    Hosur Road, Bangalore 560 100, India.
    *Board: +91-80-28520261 | Extn: 53915 | Direct: 41173915.
    Fax: +91-80-28520362 | Mobile: +91-9845505322.
    http://setlabs/slim/
    http://allahbaksh.blogspot.com<http://allahbaksh.blogspot.com/>





    **************** CAUTION - Disclaimer *****************
    This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
    for the use of the addressee(s). If you are not the intended recipient, please
    notify the sender by e-mail and delete the original message. Further, you are not
    to copy, disclose, or distribute this e-mail or its contents to any other person and
    any such actions are unlawful. This e-mail may contain viruses. Infosys has taken
    every reasonable precaution to minimize this risk, but is not liable for any damage
    you may sustain as a result of any virus in this e-mail. You should carry out your
    own virus checks before opening the e-mail or attachment. Infosys reserves the
    right to monitor and review the content of all messages sent to or from this e-mail
    address. Messages sent to or from this e-mail address may be stored on the
    Infosys e-mail system.
    ***INFOSYS******** End of Disclaimer ********INFOSYS***
  • Ganesh at Mar 4, 2009 at 6:36 am
    Allahbaksh,

    I don't think, Lucene could filter out Null and Not null values.

    In case if the field value is Null, index the field with value <<NULL>>. To
    find all the documents which the field is not null, Search the field, which
    does not contain the value <<NULL>>.

    Regards
    Ganesh

    ----- Original Message -----
    From: "Allahbaksh Mohammedali Asadullah" <Allahbaksh_Asadullah@infosys.com>
    To: <java-user@lucene.apache.org>
    Sent: Wednesday, March 04, 2009 11:12 AM
    Subject: Optimum way to find all document without particular field


    Hi,
    What is the optimum way in which I can find all the document which has
    particular field in it.

    Example
    I want to find all the document in which the field text is not null.

    Regards,
    Allahbaksh

    Allahbaksh Mohammedali Asadullah,
    Software Engineering & Technology Labs,
    Infosys Technolgies Limited, Electronics City,
    Hosur Road, Bangalore 560 100, India.
    *Board: +91-80-28520261 | Extn: 53915 | Direct: 41173915.
    Fax: +91-80-28520362 | Mobile: +91-9845505322.
    http://setlabs/slim/
    http://allahbaksh.blogspot.com<http://allahbaksh.blogspot.com/>





    **************** CAUTION - Disclaimer *****************
    This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
    for the use of the addressee(s). If you are not the intended recipient,
    please
    notify the sender by e-mail and delete the original message. Further, you
    are not
    to copy, disclose, or distribute this e-mail or its contents to any other
    person and
    any such actions are unlawful. This e-mail may contain viruses. Infosys has
    taken
    every reasonable precaution to minimize this risk, but is not liable for any
    damage
    you may sustain as a result of any virus in this e-mail. You should carry
    out your
    own virus checks before opening the e-mail or attachment. Infosys reserves
    the
    right to monitor and review the content of all messages sent to or from this
    e-mail
    address. Messages sent to or from this e-mail address may be stored on the
    Infosys e-mail system.
    ***INFOSYS******** End of Disclaimer ********INFOSYS***

    Send instant messages to your online friends http://in.messenger.yahoo.com

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Ganesh at Mar 4, 2009 at 12:45 pm
    ----- Original Message -----
    From: "Ganesh" <emailgane@yahoo.co.in>
    To: <java-user@lucene.apache.org>
    Sent: Wednesday, March 04, 2009 12:05 PM
    Subject: Re: Optimum way to find all document without particular field

    Allahbaksh,

    I don't think, Lucene could filter out Null and Not null values.

    In case if the field value is Null, index the field with value <<NULL>>.
    To find all the documents which the field is not null, Search the field,
    which does not contain the value <<NULL>>.

    Regards
    Ganesh

    ----- Original Message -----
    From: "Allahbaksh Mohammedali Asadullah"
    <Allahbaksh_Asadullah@infosys.com>
    To: <java-user@lucene.apache.org>
    Sent: Wednesday, March 04, 2009 11:12 AM
    Subject: Optimum way to find all document without particular field


    Hi,
    What is the optimum way in which I can find all the document which has
    particular field in it.

    Example
    I want to find all the document in which the field text is not null.

    Regards,
    Allahbaksh

    Allahbaksh Mohammedali Asadullah,
    Software Engineering & Technology Labs,
    Infosys Technolgies Limited, Electronics City,
    Hosur Road, Bangalore 560 100, India.
    *Board: +91-80-28520261 | Extn: 53915 | Direct: 41173915.
    Fax: +91-80-28520362 | Mobile: +91-9845505322.
    http://setlabs/slim/
    http://allahbaksh.blogspot.com<http://allahbaksh.blogspot.com/>





    **************** CAUTION - Disclaimer *****************
    This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
    solely
    for the use of the addressee(s). If you are not the intended recipient,
    please
    notify the sender by e-mail and delete the original message. Further, you
    are not
    to copy, disclose, or distribute this e-mail or its contents to any other
    person and
    any such actions are unlawful. This e-mail may contain viruses. Infosys
    has taken
    every reasonable precaution to minimize this risk, but is not liable for
    any damage
    you may sustain as a result of any virus in this e-mail. You should carry
    out your
    own virus checks before opening the e-mail or attachment. Infosys reserves
    the
    right to monitor and review the content of all messages sent to or from
    this e-mail
    address. Messages sent to or from this e-mail address may be stored on the
    Infosys e-mail system.
    ***INFOSYS******** End of Disclaimer ********INFOSYS***
    Send instant messages to your online friends http://in.messenger.yahoo.com

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Chris Lu at Mar 4, 2009 at 6:27 pm
    Allahbaksh,

    If you ONLY want to find all document with a particular field that is
    not null, you can loop through the TermEnum and TermDocs to find all the
    document ids.
    But this can not easily be combined with other queries.

    --

    Chris Lu

    -------------------------

    Instant Scalable Full-Text Search On Any Database/Application

    site: http://www.dbsight.net

    demo: http://search.dbsight.com

    Lucene Database Search in 3 minutes: http://wiki.dbsight.com/index.php?title=Create_Lucene_Database_Search_in_3_minutes

    DBSight customer, a shopping comparison site, (anonymous per request) got 2.6 Million Euro funding!



    Allahbaksh Mohammedali Asadullah wrote:
    Hi,
    What is the optimum way in which I can find all the document which has particular field in it.

    Example
    I want to find all the document in which the field text is not null.

    Regards,
    Allahbaksh

    Allahbaksh Mohammedali Asadullah,
    Software Engineering & Technology Labs,
    Infosys Technolgies Limited, Electronics City,
    Hosur Road, Bangalore 560 100, India.
    *Board: +91-80-28520261 | Extn: 53915 | Direct: 41173915.
    Fax: +91-80-28520362 | Mobile: +91-9845505322.
    http://setlabs/slim/
    http://allahbaksh.blogspot.com<http://allahbaksh.blogspot.com/>





    **************** CAUTION - Disclaimer *****************
    This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
    for the use of the addressee(s). If you are not the intended recipient, please
    notify the sender by e-mail and delete the original message. Further, you are not
    to copy, disclose, or distribute this e-mail or its contents to any other person and
    any such actions are unlawful. This e-mail may contain viruses. Infosys has taken
    every reasonable precaution to minimize this risk, but is not liable for any damage
    you may sustain as a result of any virus in this e-mail. You should carry out your
    own virus checks before opening the e-mail or attachment. Infosys reserves the
    right to monitor and review the content of all messages sent to or from this e-mail
    address. Messages sent to or from this e-mail address may be stored on the
    Infosys e-mail system.
    ***INFOSYS******** End of Disclaimer ********INFOSYS***
  • Erick Erickson at Mar 4, 2009 at 6:47 pm
    Well, you could construct a Filter as you were looping and use
    the Filter with your queries....



    Erick
    On Wed, Mar 4, 2009 at 1:26 PM, Chris Lu wrote:

    Allahbaksh,

    If you ONLY want to find all document with a particular field that is not
    null, you can loop through the TermEnum and TermDocs to find all the
    document ids.
    But this can not easily be combined with other queries.

    --

    Chris Lu

    -------------------------

    Instant Scalable Full-Text Search On Any Database/Application

    site: http://www.dbsight.net

    demo: http://search.dbsight.com

    Lucene Database Search in 3 minutes:
    http://wiki.dbsight.com/index.php?title=Create_Lucene_Database_Search_in_3_minutes

    DBSight customer, a shopping comparison site, (anonymous per request) got
    2.6 Million Euro funding!




    Allahbaksh Mohammedali Asadullah wrote:
    Hi,
    What is the optimum way in which I can find all the document which has
    particular field in it.

    Example
    I want to find all the document in which the field text is not null.

    Regards,
    Allahbaksh

    Allahbaksh Mohammedali Asadullah,
    Software Engineering & Technology Labs,
    Infosys Technolgies Limited, Electronics City,
    Hosur Road, Bangalore 560 100, India.
    *Board: +91-80-28520261 | Extn: 53915 | Direct: 41173915.
    Fax: +91-80-28520362 | Mobile: +91-9845505322.
    http://setlabs/slim/
    http://allahbaksh.blogspot.com<http://allahbaksh.blogspot.com/>





    **************** CAUTION - Disclaimer *****************
    This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
    solely for the use of the addressee(s). If you are not the intended
    recipient, please notify the sender by e-mail and delete the original
    message. Further, you are not to copy, disclose, or distribute this e-mail
    or its contents to any other person and any such actions are unlawful. This
    e-mail may contain viruses. Infosys has taken every reasonable precaution to
    minimize this risk, but is not liable for any damage you may sustain as a
    result of any virus in this e-mail. You should carry out your own virus
    checks before opening the e-mail or attachment. Infosys reserves the right
    to monitor and review the content of all messages sent to or from this
    e-mail address. Messages sent to or from this e-mail address may be stored
    on the Infosys e-mail system.
    ***INFOSYS******** End of Disclaimer ********INFOSYS***

  • Shashi Kant at Mar 4, 2009 at 7:04 pm
    A simple solution would be to store the string "NULL" instead of null and
    then query.

    On Wed, Mar 4, 2009 at 1:26 PM, Chris Lu wrote:

    Allahbaksh,

    If you ONLY want to find all document with a particular field that is not
    null, you can loop through the TermEnum and TermDocs to find all the
    document ids.
    But this can not easily be combined with other queries.

    --

    Chris Lu

    -------------------------

    Instant Scalable Full-Text Search On Any Database/Application

    site: http://www.dbsight.net

    demo: http://search.dbsight.com

    Lucene Database Search in 3 minutes:
    http://wiki.dbsight.com/index.php?title=Create_Lucene_Database_Search_in_3_minutes

    DBSight customer, a shopping comparison site, (anonymous per request) got
    2.6 Million Euro funding!




    Allahbaksh Mohammedali Asadullah wrote:
    Hi,
    What is the optimum way in which I can find all the document which has
    particular field in it.

    Example
    I want to find all the document in which the field text is not null.

    Regards,
    Allahbaksh

    Allahbaksh Mohammedali Asadullah,
    Software Engineering & Technology Labs,
    Infosys Technolgies Limited, Electronics City,
    Hosur Road, Bangalore 560 100, India.
    *Board: +91-80-28520261 | Extn: 53915 | Direct: 41173915.
    Fax: +91-80-28520362 | Mobile: +91-9845505322.
    http://setlabs/slim/
    http://allahbaksh.blogspot.com<http://allahbaksh.blogspot.com/>





    **************** CAUTION - Disclaimer *****************
    This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
    solely for the use of the addressee(s). If you are not the intended
    recipient, please notify the sender by e-mail and delete the original
    message. Further, you are not to copy, disclose, or distribute this e-mail
    or its contents to any other person and any such actions are unlawful. This
    e-mail may contain viruses. Infosys has taken every reasonable precaution to
    minimize this risk, but is not liable for any damage you may sustain as a
    result of any virus in this e-mail. You should carry out your own virus
    checks before opening the e-mail or attachment. Infosys reserves the right
    to monitor and review the content of all messages sent to or from this
    e-mail address. Messages sent to or from this e-mail address may be stored
    on the Infosys e-mail system.
    ***INFOSYS******** End of Disclaimer ********INFOSYS***

  • Uwe Schindler at Mar 4, 2009 at 7:10 pm
    To find all document, that not contain a term, you can combine a
    MatchAllDocsQuery with BooleanClause.Occur.MUST, combined with one or more
    TermQueries with BooleanClause.Occur.MUST_NOT (the terms you do not want in
    the documents).

    -----
    Uwe Schindler
    H.-H.-Meier-Allee 63, D-28213 Bremen
    http://www.thetaphi.de
    eMail: uwe@thetaphi.de
    -----Original Message-----
    From: shashi.mit@gmail.com On Behalf Of
    Shashi Kant
    Sent: Wednesday, March 04, 2009 7:31 PM
    To: java-user@lucene.apache.org
    Subject: Re: Optimum way to find all document without particular field

    A simple solution would be to store the string "NULL" instead of null and
    then query.

    On Wed, Mar 4, 2009 at 1:26 PM, Chris Lu wrote:

    Allahbaksh,

    If you ONLY want to find all document with a particular field that is not
    null, you can loop through the TermEnum and TermDocs to find all the
    document ids.
    But this can not easily be combined with other queries.

    --

    Chris Lu

    -------------------------

    Instant Scalable Full-Text Search On Any Database/Application

    site: http://www.dbsight.net

    demo: http://search.dbsight.com

    Lucene Database Search in 3 minutes:
    http://wiki.dbsight.com/index.php?title=Create_Lucene_Database_Search_in_3
    _minutes
    DBSight customer, a shopping comparison site, (anonymous per request) got
    2.6 Million Euro funding!




    Allahbaksh Mohammedali Asadullah wrote:
    Hi,
    What is the optimum way in which I can find all the document which has
    particular field in it.

    Example
    I want to find all the document in which the field text is not null.

    Regards,
    Allahbaksh

    Allahbaksh Mohammedali Asadullah,
    Software Engineering & Technology Labs,
    Infosys Technolgies Limited, Electronics City,
    Hosur Road, Bangalore 560 100, India.
    *Board: +91-80-28520261 | Extn: 53915 | Direct: 41173915.
    Fax: +91-80-28520362 | Mobile: +91-9845505322.
    http://setlabs/slim/
    http://allahbaksh.blogspot.com<http://allahbaksh.blogspot.com/>





    **************** CAUTION - Disclaimer *****************
    This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
    solely for the use of the addressee(s). If you are not the intended
    recipient, please notify the sender by e-mail and delete the original
    message. Further, you are not to copy, disclose, or distribute this e-
    mail
    or its contents to any other person and any such actions are unlawful.
    This
    e-mail may contain viruses. Infosys has taken every reasonable
    precaution to
    minimize this risk, but is not liable for any damage you may sustain as
    a
    result of any virus in this e-mail. You should carry out your own virus
    checks before opening the e-mail or attachment. Infosys reserves the
    right
    to monitor and review the content of all messages sent to or from this
    e-mail address. Messages sent to or from this e-mail address may be
    stored
    on the Infosys e-mail system.
    ***INFOSYS******** End of Disclaimer ********INFOSYS***


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Erick Erickson at Mar 4, 2009 at 7:52 pm
    Remember, though, that this won't work *unless* there is
    a value to exclude, thus several of the suggestions to
    index a special token in the relevant field that's guaranteed
    to not be something you ever want to legitimately
    search on.

    Erick
    On Wed, Mar 4, 2009 at 2:10 PM, Uwe Schindler wrote:

    To find all document, that not contain a term, you can combine a
    MatchAllDocsQuery with BooleanClause.Occur.MUST, combined with one or more
    TermQueries with BooleanClause.Occur.MUST_NOT (the terms you do not want in
    the documents).

    -----
    Uwe Schindler
    H.-H.-Meier-Allee 63, D-28213 Bremen
    http://www.thetaphi.de
    eMail: uwe@thetaphi.de
    -----Original Message-----
    From: shashi.mit@gmail.com On Behalf Of
    Shashi Kant
    Sent: Wednesday, March 04, 2009 7:31 PM
    To: java-user@lucene.apache.org
    Subject: Re: Optimum way to find all document without particular field

    A simple solution would be to store the string "NULL" instead of null and
    then query.

    On Wed, Mar 4, 2009 at 1:26 PM, Chris Lu wrote:

    Allahbaksh,

    If you ONLY want to find all document with a particular field that is not
    null, you can loop through the TermEnum and TermDocs to find all the
    document ids.
    But this can not easily be combined with other queries.

    --

    Chris Lu

    -------------------------

    Instant Scalable Full-Text Search On Any Database/Application

    site: http://www.dbsight.net

    demo: http://search.dbsight.com

    Lucene Database Search in 3 minutes:
    http://wiki.dbsight.com/index.php?title=Create_Lucene_Database_Search_in_3
    _minutes
    DBSight customer, a shopping comparison site, (anonymous per request) got
    2.6 Million Euro funding!




    Allahbaksh Mohammedali Asadullah wrote:
    Hi,
    What is the optimum way in which I can find all the document which has
    particular field in it.

    Example
    I want to find all the document in which the field text is not null.

    Regards,
    Allahbaksh

    Allahbaksh Mohammedali Asadullah,
    Software Engineering & Technology Labs,
    Infosys Technolgies Limited, Electronics City,
    Hosur Road, Bangalore 560 100, India.
    *Board: +91-80-28520261 | Extn: 53915 | Direct: 41173915.
    Fax: +91-80-28520362 | Mobile: +91-9845505322.
    http://setlabs/slim/
    http://allahbaksh.blogspot.com<http://allahbaksh.blogspot.com/>





    **************** CAUTION - Disclaimer *****************
    This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
    solely for the use of the addressee(s). If you are not the intended
    recipient, please notify the sender by e-mail and delete the original
    message. Further, you are not to copy, disclose, or distribute this e-
    mail
    or its contents to any other person and any such actions are unlawful.
    This
    e-mail may contain viruses. Infosys has taken every reasonable
    precaution to
    minimize this risk, but is not liable for any damage you may sustain
    as
    a
    result of any virus in this e-mail. You should carry out your own
    virus
    checks before opening the e-mail or attachment. Infosys reserves the
    right
    to monitor and review the content of all messages sent to or from this
    e-mail address. Messages sent to or from this e-mail address may be
    stored
    on the Infosys e-mail system.
    ***INFOSYS******** End of Disclaimer ********INFOSYS***


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Daniel Noll at Mar 5, 2009 at 1:26 am

    Chris Lu wrote:
    Allahbaksh,

    If you ONLY want to find all document with a particular field that is
    not null, you can loop through the TermEnum and TermDocs to find all the
    document ids.
    But this can not easily be combined with other queries.
    Surely this would be equivalent to a PrefixQuery with a prefix of "".
    Assuming the query parser is well behaved (I can no longer remember
    whether the default one is or not), field:* should create one.

    This is assuming you have already indexed the data. If you can reindex
    then clearly adding a placeholder value for "no content" is more efficient.

    Daniel



    --
    Daniel Noll Forensic and eDiscovery Software
    Senior Developer The world's most advanced
    Nuix email data analysis
    http://nuix.com/ and eDiscovery software

    ---------------------------------------------------------------------
    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 4, '09 at 5:43a
activeMar 5, '09 at 1:26a
posts10
users8
websitelucene.apache.org

People

Translate

site design / logo © 2021 Grokbase