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 Aditi Goyal <ad...@gmail.com> on 2008/06/23 08:21:17 UTC

lucene search options

Hi All,

I am using Lucene for creating indexes. There is one field as "email" which
stored the email id.
I have few queries regarding searching:
1. I want to search for all the records having domain as "gmail.com" . So,
is there a way by which I can do a partial search on "email" field such that
I get the records matching only the domain name.
I think wildcard (*) cannot be used in the beginning :(

2. If I just want to search for the records which are not matching email as
"abc@xyz.com"
How can I search for it. Here, MUST_NOT cannot be used alone. Is there a way
out?


Please help.

Thanks,
Aditi

Re: lucene search options

Posted by saikrishna venkata pendyala <pv...@gmail.com>.
Hi Aditi,

As Rohit said, the best way to solve this problem is to have two fields for
indexing an email-id, one for the username and another for domain name.

Having two fields and using a Boolean Query with MUST condition should solve
your problem. You can also perform restricted search with the above
architecture, like search for user "x" with in the domain "gmail.com"

--Sai Krishna.

On Mon, Jun 23, 2008 at 2:37 PM, rohit saini <mr...@gmail.com> wrote:

> Hi aditi,
>
> U can have a field corresponding to this domain....It will solve ur
> problem......
>
> bye
>
> Rohit
> Impetus technologies- noida
> mob. 09910220475
>
>
> On 6/23/08, Aditi Goyal <ad...@gmail.com> wrote:
> >
> > Hi All,
> >
> > I am using Lucene for creating indexes. There is one field as "email"
> which
> > stored the email id.
> > I have few queries regarding searching:
> > 1. I want to search for all the records having domain as "gmail.com" .
> So,
> > is there a way by which I can do a partial search on "email" field such
> > that
> > I get the records matching only the domain name.
> > I think wildcard (*) cannot be used in the beginning :(
> >
> > 2. If I just want to search for the records which are not matching email
> as
> > "abc@xyz.com"
> > How can I search for it. Here, MUST_NOT cannot be used alone. Is there a
> > way
> > out?
> >
> >
> > Please help.
> >
> > Thanks,
> > Aditi
> >
>
>
>
> --
> VANDE - MATRAM
>

Re: lucene search options

Posted by rohit saini <mr...@gmail.com>.
Hi aditi,

U can have a field corresponding to this domain....It will solve ur
problem......

bye

Rohit
Impetus technologies- noida
mob. 09910220475


On 6/23/08, Aditi Goyal <ad...@gmail.com> wrote:
>
> Hi All,
>
> I am using Lucene for creating indexes. There is one field as "email" which
> stored the email id.
> I have few queries regarding searching:
> 1. I want to search for all the records having domain as "gmail.com" . So,
> is there a way by which I can do a partial search on "email" field such
> that
> I get the records matching only the domain name.
> I think wildcard (*) cannot be used in the beginning :(
>
> 2. If I just want to search for the records which are not matching email as
> "abc@xyz.com"
> How can I search for it. Here, MUST_NOT cannot be used alone. Is there a
> way
> out?
>
>
> Please help.
>
> Thanks,
> Aditi
>



-- 
VANDE - MATRAM

Re: lucene search options

Posted by Daniel Noll <da...@nuix.com>.
On Monday 23 June 2008 18:08:29 Aditi Goyal wrote:
> Oh. For one moment I was elated to hear the news. :(
> Is there any way out?

*:* -"jakarta apache"

Or subclass QueryParser and override the getBooleanQuery() method to do this 
behind the scenes using MatchAllDocsQuery.

Daniel

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


Re: lucene search options

Posted by Chris Hostetter <ho...@fucit.org>.
: I am using MultiFieldQueryParser. Can I use setAllowLeadingWildCard with
: MultiFieldQueryParser?I am doing the following:
: 
:             parser = lucene.MultiFieldQueryParser(fields, analyzer )
:             parser.setAllowLeadingWildcard(True)
:             query = parser.parse(command)
: 
: And I am getting this error:
: 
:  ERROR (<type 'exceptions.TypeError'>, TypeError("descriptor 'parse'
: requires a 'QueryParser' object but received a 'str'",), <traceback object
: at 0x02DFA800>)

the sample code you posted doesn't look like java, and this is not an 
error message you would get form java, so i'm guessing you are using a 
port (.Net maybe?) ... the error message seems langauge specific (related 
to the way the "parse" method is dispatched on a "QueryParser" object) so 
you should consult the user communityfor the port you are using.


-Hoss


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


Re: lucene search options

Posted by Aditi Goyal <ad...@gmail.com>.
I am using MultiFieldQueryParser. Can I use setAllowLeadingWildCard with
MultiFieldQueryParser?I am doing the following:

            parser = lucene.MultiFieldQueryParser(fields, analyzer )
            parser.setAllowLeadingWildcard(True)
            query = parser.parse(command)

And I am getting this error:

 ERROR (<type 'exceptions.TypeError'>, TypeError("descriptor 'parse'
requires a 'QueryParser' object but received a 'str'",), <traceback object
at 0x02DFA800>)

Thanks a lot

Aditi



> On Mon, Jun 23, 2008 at 1:33 PM, Allahbaksh Mohammedali Asadullah <
> Allahbaksh_Asadullah@infosys.com> wrote:
>
>> Hi Aditi,
>> Sorry for typo. You cannot edit it alone.
>> Warm 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
>>
>>
>> -----Original Message-----
>> From: Allahbaksh Mohammedali Asadullah [mailto:
>> Allahbaksh_Asadullah@infosys.com]
>> Sent: Monday, June 23, 2008 1:25 PM
>> To: java-user@lucene.apache.org
>> Subject: RE: lucene search options
>>
>> Yes Aditi You can use it alone.
>> Warm 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
>>
>>
>> -----Original Message-----
>> From: Aditi Goyal [mailto:aditigupta20@gmail.com]
>> Sent: Monday, June 23, 2008 1:24 PM
>> To: java-user@lucene.apache.org
>> Subject: Re: lucene search options
>>
>> Thank you Allahbaksh for taking so much pains. The link says it cannot be
>> used alone.
>>
>> Note: The NOT operator cannot be used with just one term. For example, the
>> following search will return no results:
>>
>> NOT "jakarta apache"
>> Thanks,
>> Aditi
>>
>>
>> On Mon, Jun 23, 2008 at 1:10 PM, Allahbaksh Mohammedali Asadullah <
>> Allahbaksh_Asadullah@infosys.com> wrote:
>>
>> > Hi Aditi,
>> > You can search using NOT operator. You can go through below link for
>> Query
>> > details http://lucene.apache.org/java/docs/queryparsersyntax.html
>> > Warm 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
>> >
>> >
>> > -----Original Message-----
>> > From: Aditi Goyal [mailto:aditigupta20@gmail.com]
>> > Sent: Monday, June 23, 2008 12:06 PM
>> > To: java-user@lucene.apache.org
>> > Subject: Re: lucene search options
>> >
>> > Thanks a lot Daniel, I will try this option. :)
>> > Is there a way to search for not equal to query alone?
>> >
>> > On Mon, Jun 23, 2008 at 12:03 PM, Daniel Noll <da...@nuix.com> wrote:
>> >
>> > > On Monday 23 June 2008 16:21:17 Aditi Goyal wrote:
>> > > > I think wildcard (*) cannot be used in the beginning :(
>> > >
>> > > Wrong:
>> > >
>> > >
>> > >
>> >
>> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard(boolean)<http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29>
>> <
>> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29
>> >
>> > <
>> >
>> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29
>> > >
>> > >
>> > > Daniel
>> > >
>> > > ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> > > For additional commands, e-mail: java-user-help@lucene.apache.org
>> > >
>> > >
>> >
>> > **************** 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
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>

Re: lucene search options

Posted by Aditi Goyal <ad...@gmail.com>.
Oh. For one moment I was elated to hear the news. :(
Is there any way out?

Thanks,
Aditi

On Mon, Jun 23, 2008 at 1:33 PM, Allahbaksh Mohammedali Asadullah <
Allahbaksh_Asadullah@infosys.com> wrote:

> Hi Aditi,
> Sorry for typo. You cannot edit it alone.
> Warm 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
>
>
> -----Original Message-----
> From: Allahbaksh Mohammedali Asadullah [mailto:
> Allahbaksh_Asadullah@infosys.com]
> Sent: Monday, June 23, 2008 1:25 PM
> To: java-user@lucene.apache.org
> Subject: RE: lucene search options
>
> Yes Aditi You can use it alone.
> Warm 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
>
>
> -----Original Message-----
> From: Aditi Goyal [mailto:aditigupta20@gmail.com]
> Sent: Monday, June 23, 2008 1:24 PM
> To: java-user@lucene.apache.org
> Subject: Re: lucene search options
>
> Thank you Allahbaksh for taking so much pains. The link says it cannot be
> used alone.
>
> Note: The NOT operator cannot be used with just one term. For example, the
> following search will return no results:
>
> NOT "jakarta apache"
> Thanks,
> Aditi
>
>
> On Mon, Jun 23, 2008 at 1:10 PM, Allahbaksh Mohammedali Asadullah <
> Allahbaksh_Asadullah@infosys.com> wrote:
>
> > Hi Aditi,
> > You can search using NOT operator. You can go through below link for
> Query
> > details http://lucene.apache.org/java/docs/queryparsersyntax.html
> > Warm 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
> >
> >
> > -----Original Message-----
> > From: Aditi Goyal [mailto:aditigupta20@gmail.com]
> > Sent: Monday, June 23, 2008 12:06 PM
> > To: java-user@lucene.apache.org
> > Subject: Re: lucene search options
> >
> > Thanks a lot Daniel, I will try this option. :)
> > Is there a way to search for not equal to query alone?
> >
> > On Mon, Jun 23, 2008 at 12:03 PM, Daniel Noll <da...@nuix.com> wrote:
> >
> > > On Monday 23 June 2008 16:21:17 Aditi Goyal wrote:
> > > > I think wildcard (*) cannot be used in the beginning :(
> > >
> > > Wrong:
> > >
> > >
> > >
> >
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard(boolean)<http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29>
> <
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29
> >
> > <
> >
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29
> > >
> > >
> > > Daniel
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > > For additional commands, e-mail: java-user-help@lucene.apache.org
> > >
> > >
> >
> > **************** 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
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

RE: lucene search options

Posted by Allahbaksh Mohammedali Asadullah <Al...@infosys.com>.
Hi Aditi,
Sorry for typo. You cannot edit it alone.
Warm 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


-----Original Message-----
From: Allahbaksh Mohammedali Asadullah [mailto:Allahbaksh_Asadullah@infosys.com]
Sent: Monday, June 23, 2008 1:25 PM
To: java-user@lucene.apache.org
Subject: RE: lucene search options

Yes Aditi You can use it alone.
Warm 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


-----Original Message-----
From: Aditi Goyal [mailto:aditigupta20@gmail.com]
Sent: Monday, June 23, 2008 1:24 PM
To: java-user@lucene.apache.org
Subject: Re: lucene search options

Thank you Allahbaksh for taking so much pains. The link says it cannot be
used alone.

Note: The NOT operator cannot be used with just one term. For example, the
following search will return no results:

NOT "jakarta apache"
Thanks,
Aditi


On Mon, Jun 23, 2008 at 1:10 PM, Allahbaksh Mohammedali Asadullah <
Allahbaksh_Asadullah@infosys.com> wrote:

> Hi Aditi,
> You can search using NOT operator. You can go through below link for Query
> details http://lucene.apache.org/java/docs/queryparsersyntax.html
> Warm 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
>
>
> -----Original Message-----
> From: Aditi Goyal [mailto:aditigupta20@gmail.com]
> Sent: Monday, June 23, 2008 12:06 PM
> To: java-user@lucene.apache.org
> Subject: Re: lucene search options
>
> Thanks a lot Daniel, I will try this option. :)
> Is there a way to search for not equal to query alone?
>
> On Mon, Jun 23, 2008 at 12:03 PM, Daniel Noll <da...@nuix.com> wrote:
>
> > On Monday 23 June 2008 16:21:17 Aditi Goyal wrote:
> > > I think wildcard (*) cannot be used in the beginning :(
> >
> > Wrong:
> >
> >
> >
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard(boolean)<http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29>
> <
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29
> >
> >
> > Daniel
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> >
>
> **************** 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
>
>

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


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


RE: lucene search options

Posted by Allahbaksh Mohammedali Asadullah <Al...@infosys.com>.
Yes Aditi You can use it alone.
Warm 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


-----Original Message-----
From: Aditi Goyal [mailto:aditigupta20@gmail.com]
Sent: Monday, June 23, 2008 1:24 PM
To: java-user@lucene.apache.org
Subject: Re: lucene search options

Thank you Allahbaksh for taking so much pains. The link says it cannot be
used alone.

Note: The NOT operator cannot be used with just one term. For example, the
following search will return no results:

NOT "jakarta apache"
Thanks,
Aditi


On Mon, Jun 23, 2008 at 1:10 PM, Allahbaksh Mohammedali Asadullah <
Allahbaksh_Asadullah@infosys.com> wrote:

> Hi Aditi,
> You can search using NOT operator. You can go through below link for Query
> details http://lucene.apache.org/java/docs/queryparsersyntax.html
> Warm 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
>
>
> -----Original Message-----
> From: Aditi Goyal [mailto:aditigupta20@gmail.com]
> Sent: Monday, June 23, 2008 12:06 PM
> To: java-user@lucene.apache.org
> Subject: Re: lucene search options
>
> Thanks a lot Daniel, I will try this option. :)
> Is there a way to search for not equal to query alone?
>
> On Mon, Jun 23, 2008 at 12:03 PM, Daniel Noll <da...@nuix.com> wrote:
>
> > On Monday 23 June 2008 16:21:17 Aditi Goyal wrote:
> > > I think wildcard (*) cannot be used in the beginning :(
> >
> > Wrong:
> >
> >
> >
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard(boolean)<http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29>
> <
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29
> >
> >
> > Daniel
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> >
>
> **************** 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
>
>

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


Re: lucene search options

Posted by no spam <mr...@gmail.com>.
Yes that is set.  It works if I do a query like this:

status:* -reporter:*mark*

The status field only has a few possible values.

On Mon, Dec 8, 2008 at 10:54 AM, Erick Erickson <er...@gmail.com>wrote:

> Have you enabled leading wildcards? They are not (or at least weren't
> last I knew) enabled by default....
>
> <<<QueryParser.setAllowLeadingWildcard( true )>>>
>
> from
>
>
>
> http://wiki.apache.org/jakarta-lucene/LuceneFAQ#head-4d62118417eaef0dcb87f4370583f809848ea695
>
> Best
> Erick
>
> On Mon, Dec 8, 2008 at 10:24 AM, no spam <mr...@gmail.com> wrote:
>
> > The reason our users want to do this is because they want to search for
> > instances where certain negative conditions are true.  My client is the
> > news
> > industry and this is metadata for things like reporter, type, etc.
> >  Sometimes you want -reporter:mark for example and this is the only
> > criteria
> > to search against the index.
> >
> > Am I thinking about this wrong?
> >
> > I did try using the MatchAllDocsQuery class and it expands to something
> > like
> > this:
> >
> > summary:matchalldocsquery -reporter:*mark*
> >
> > but I don't get any results which is not what I expect for my does not
> > contain query above.
> >
> > On Sat, Dec 6, 2008 at 11:06 PM, Anshum <an...@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > An easy way to do that would be to index a particular term with all
> docs
> > > e.g. "dummyword" could be indexed for all documents as a value for a
> > > dummyfield or an existing field.
> > > This way lets assume you want to fetch results for -filed1:jakarta
> > > You could search for dummyfield:"dummyword" AND NOT filed1:jakarta
> > >
> > > This is just one of the solution, though I still would not understand
> if
> > > there's a logical reason for fetching such results.:)
> > >
> > > --
> >
>

Re: lucene search options

Posted by Erick Erickson <er...@gmail.com>.
Have you enabled leading wildcards? They are not (or at least weren't
last I knew) enabled by default....

<<<QueryParser.setAllowLeadingWildcard( true )>>>

from


http://wiki.apache.org/jakarta-lucene/LuceneFAQ#head-4d62118417eaef0dcb87f4370583f809848ea695

Best
Erick

On Mon, Dec 8, 2008 at 10:24 AM, no spam <mr...@gmail.com> wrote:

> The reason our users want to do this is because they want to search for
> instances where certain negative conditions are true.  My client is the
> news
> industry and this is metadata for things like reporter, type, etc.
>  Sometimes you want -reporter:mark for example and this is the only
> criteria
> to search against the index.
>
> Am I thinking about this wrong?
>
> I did try using the MatchAllDocsQuery class and it expands to something
> like
> this:
>
> summary:matchalldocsquery -reporter:*mark*
>
> but I don't get any results which is not what I expect for my does not
> contain query above.
>
> On Sat, Dec 6, 2008 at 11:06 PM, Anshum <an...@gmail.com> wrote:
>
> > Hi,
> >
> > An easy way to do that would be to index a particular term with all docs
> > e.g. "dummyword" could be indexed for all documents as a value for a
> > dummyfield or an existing field.
> > This way lets assume you want to fetch results for -filed1:jakarta
> > You could search for dummyfield:"dummyword" AND NOT filed1:jakarta
> >
> > This is just one of the solution, though I still would not understand if
> > there's a logical reason for fetching such results.:)
> >
> > --
>

Re: lucene search options

Posted by no spam <mr...@gmail.com>.
Yes I've seen that syntax too used to search for null values.  You can do
-(reporter:* AND -reporter:[* to *]) which says all values minus docs with a
value.

Your suggestion did the trick, thanks!
On Mon, Dec 8, 2008 at 11:40 AM, Erick Erickson <er...@gmail.com>wrote:

> That'll teach me to scan e-mail. You can't use MatchAllDocsQuery
> that way.
> What you're actually searching for is the word "matchalldocsquery"
> in the field "summary". Which returns nothing. Then you're subtracting
> any documents with reporter *mark*. That isn't what you're after at all.
>
> If you're doing this programmatically, you want something in the
> Lucene code like:
>
> BooleanQuery bq = new BooleanQuery()
> bq.add(new MatchAllDocsQuery(), BooleanClause.occur.MUST)
> bq.add(<parsed *mark* query here>, BooleanClause.occur.MUST_NOT)
>
>
> now pass bq to the search method. This will require some work on your
> part to detect when it's appropriate and when it's not. But presumably you
> have the ability to know that.
>
> I've seen referenced (but haven't used) something like
> reporter:(* TO *) -reporter:*mark*
>
> WARNING: I've seen this referenced in, I believe, the SOLR mailing
> list. I don't know how it plays in straight Lucene,and I have no idea
> what the gotcha's are, nor what version of Lucene supports this syntax
> efficiently. Furthermore I'm unclear what the behavior for
> a document without the reporter field is......
>
> But I do know that you can't do what your example does....
>
> FWIW
> Erick
>
>
> On Mon, Dec 8, 2008 at 10:24 AM, no spam <mr...@gmail.com> wrote:
>
> > The reason our users want to do this is because they want to search for
> > instances where certain negative conditions are true.  My client is the
> > news
> > industry and this is metadata for things like reporter, type, etc.
> >  Sometimes you want -reporter:mark for example and this is the only
> > criteria
> > to search against the index.
> >
> > Am I thinking about this wrong?
> >
> > I did try using the MatchAllDocsQuery class and it expands to something
> > like
> > this:
> >
> > summary:matchalldocsquery -reporter:*mark*
> >
> > but I don't get any results which is not what I expect for my does not
> > contain query above.
> >
> > On Sat, Dec 6, 2008 at 11:06 PM, Anshum <an...@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > An easy way to do that would be to index a particular term with all
> docs
> > > e.g. "dummyword" could be indexed for all documents as a value for a
> > > dummyfield or an existing field.
> > > This way lets assume you want to fetch results for -filed1:jakarta
> > > You could search for dummyfield:"dummyword" AND NOT filed1:jakarta
> > >
> > > This is just one of the solution, though I still would not understand
> if
> > > there's a logical reason for fetching such results.:)
> > >
> > > --
> >
>

Re: lucene search options

Posted by no spam <mr...@gmail.com>.
The way I got that query was doing:

new MatchAllDocsQuery().toString().   I thought the "matchalldocsquery" part
was a bit odd but figured it might be a known keyword with lucene.

Thanks for the help!

On Mon, Dec 8, 2008 at 11:40 AM, Erick Erickson <er...@gmail.com>wrote:

> That'll teach me to scan e-mail. You can't use MatchAllDocsQuery
> that way.
> What you're actually searching for is the word "matchalldocsquery"
> in the field "summary". Which returns nothing. Then you're subtracting
> any documents with reporter *mark*. That isn't what you're after at all.
>
> If you're doing this programmatically, you want something in the
> Lucene code like:
>
> BooleanQuery bq = new BooleanQuery()
> bq.add(new MatchAllDocsQuery(), BooleanClause.occur.MUST)
> bq.add(<parsed *mark* query here>, BooleanClause.occur.MUST_NOT)
>
>
> now pass bq to the search method. This will require some work on your
> part to detect when it's appropriate and when it's not. But presumably you
> have the ability to know that.
>
> I've seen referenced (but haven't used) something like
> reporter:(* TO *) -reporter:*mark*
>
> WARNING: I've seen this referenced in, I believe, the SOLR mailing
> list. I don't know how it plays in straight Lucene,and I have no idea
> what the gotcha's are, nor what version of Lucene supports this syntax
> efficiently. Furthermore I'm unclear what the behavior for
> a document without the reporter field is......
>
> But I do know that you can't do what your example does....
>
> FWIW
> Erick
>
>
> On Mon, Dec 8, 2008 at 10:24 AM, no spam <mr...@gmail.com> wrote:
>
> > The reason our users want to do this is because they want to search for
> > instances where certain negative conditions are true.  My client is the
> > news
> > industry and this is metadata for things like reporter, type, etc.
> >  Sometimes you want -reporter:mark for example and this is the only
> > criteria
> > to search against the index.
> >
> > Am I thinking about this wrong?
> >
> > I did try using the MatchAllDocsQuery class and it expands to something
> > like
> > this:
> >
> > summary:matchalldocsquery -reporter:*mark*
> >
> > but I don't get any results which is not what I expect for my does not
> > contain query above.
> >
> > On Sat, Dec 6, 2008 at 11:06 PM, Anshum <an...@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > An easy way to do that would be to index a particular term with all
> docs
> > > e.g. "dummyword" could be indexed for all documents as a value for a
> > > dummyfield or an existing field.
> > > This way lets assume you want to fetch results for -filed1:jakarta
> > > You could search for dummyfield:"dummyword" AND NOT filed1:jakarta
> > >
> > > This is just one of the solution, though I still would not understand
> if
> > > there's a logical reason for fetching such results.:)
> > >
> > > --
> >
>

Re: lucene search options

Posted by Erick Erickson <er...@gmail.com>.
That'll teach me to scan e-mail. You can't use MatchAllDocsQuery
that way.
What you're actually searching for is the word "matchalldocsquery"
in the field "summary". Which returns nothing. Then you're subtracting
any documents with reporter *mark*. That isn't what you're after at all.

If you're doing this programmatically, you want something in the
Lucene code like:

BooleanQuery bq = new BooleanQuery()
bq.add(new MatchAllDocsQuery(), BooleanClause.occur.MUST)
bq.add(<parsed *mark* query here>, BooleanClause.occur.MUST_NOT)


now pass bq to the search method. This will require some work on your
part to detect when it's appropriate and when it's not. But presumably you
have the ability to know that.

I've seen referenced (but haven't used) something like
reporter:(* TO *) -reporter:*mark*

WARNING: I've seen this referenced in, I believe, the SOLR mailing
list. I don't know how it plays in straight Lucene,and I have no idea
what the gotcha's are, nor what version of Lucene supports this syntax
efficiently. Furthermore I'm unclear what the behavior for
a document without the reporter field is......

But I do know that you can't do what your example does....

FWIW
Erick


On Mon, Dec 8, 2008 at 10:24 AM, no spam <mr...@gmail.com> wrote:

> The reason our users want to do this is because they want to search for
> instances where certain negative conditions are true.  My client is the
> news
> industry and this is metadata for things like reporter, type, etc.
>  Sometimes you want -reporter:mark for example and this is the only
> criteria
> to search against the index.
>
> Am I thinking about this wrong?
>
> I did try using the MatchAllDocsQuery class and it expands to something
> like
> this:
>
> summary:matchalldocsquery -reporter:*mark*
>
> but I don't get any results which is not what I expect for my does not
> contain query above.
>
> On Sat, Dec 6, 2008 at 11:06 PM, Anshum <an...@gmail.com> wrote:
>
> > Hi,
> >
> > An easy way to do that would be to index a particular term with all docs
> > e.g. "dummyword" could be indexed for all documents as a value for a
> > dummyfield or an existing field.
> > This way lets assume you want to fetch results for -filed1:jakarta
> > You could search for dummyfield:"dummyword" AND NOT filed1:jakarta
> >
> > This is just one of the solution, though I still would not understand if
> > there's a logical reason for fetching such results.:)
> >
> > --
>

Re: lucene search options

Posted by no spam <mr...@gmail.com>.
The reason our users want to do this is because they want to search for
instances where certain negative conditions are true.  My client is the news
industry and this is metadata for things like reporter, type, etc.
 Sometimes you want -reporter:mark for example and this is the only criteria
to search against the index.

Am I thinking about this wrong?

I did try using the MatchAllDocsQuery class and it expands to something like
this:

summary:matchalldocsquery -reporter:*mark*

but I don't get any results which is not what I expect for my does not
contain query above.

On Sat, Dec 6, 2008 at 11:06 PM, Anshum <an...@gmail.com> wrote:

> Hi,
>
> An easy way to do that would be to index a particular term with all docs
> e.g. "dummyword" could be indexed for all documents as a value for a
> dummyfield or an existing field.
> This way lets assume you want to fetch results for -filed1:jakarta
> You could search for dummyfield:"dummyword" AND NOT filed1:jakarta
>
> This is just one of the solution, though I still would not understand if
> there's a logical reason for fetching such results.:)
>
> --

Re: lucene search options

Posted by Erick Erickson <er...@gmail.com>.
You can also synthesize a clause that matches all documents and then
add the NOT to it. I haven't tried it, but you might be able to combine,
say,
MatchAllDocsQuery with your NOT query as part of a BooleanQuery...

Best
Erick

On Sat, Dec 6, 2008 at 11:06 PM, Anshum <an...@gmail.com> wrote:

> Hi,
>
> An easy way to do that would be to index a particular term with all docs
> e.g. "dummyword" could be indexed for all documents as a value for a
> dummyfield or an existing field.
> This way lets assume you want to fetch results for -filed1:jakarta
> You could search for dummyfield:"dummyword" AND NOT filed1:jakarta
>
> This is just one of the solution, though I still would not understand if
> there's a logical reason for fetching such results.:)
>
> --
> Anshum Gupta
> Naukri Labs!
> http://ai-cafe.blogspot.com
>
> The facts expressed here belong to everybody, the opinions to me. The
> distinction is yours to draw............
>
>
> On Sat, Dec 6, 2008 at 10:49 PM, no spam <mr...@gmail.com> wrote:
>
> > We are converting a User Interface query to lucene on the back end. It
> has
> > recently come up that users want to do some negative only queries like
> NOT
> > "jakarta apache". What is an efficient way to do this? We do know what
> > field
> > they are specifying, ie -field1:jakarta
> >
> > On Mon, Jun 23, 2008 at 2:53 AM, Aditi Goyal <ad...@gmail.com>
> > wrote:
> >
> > > Thank you Allahbaksh for taking so much pains. The link says it cannot
> be
> > > used alone.
> > >
> > > Note: The NOT operator cannot be used with just one term. For example,
> > the
> > > following search will return no results:
> > >
> > > NOT "jakarta apache"
> > > Thanks,
> > > Aditi
> > >
> > >
> > > On Mon, Jun 23, 2008 at 1:10 PM, Allahbaksh Mohammedali Asadullah <
> > > Allahbaksh_Asadullah@infosys.com> wrote:
> > >
> > > > Hi Aditi,
> > > > You can search using NOT operator. You can go through below link for
> > > Query
> > > > details http://lucene.apache.org/java/docs/queryparsersyntax.html
> > > > Warm 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
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: Aditi Goyal [mailto:aditigupta20@gmail.com]
> > > > Sent: Monday, June 23, 2008 12:06 PM
> > > > To: java-user@lucene.apache.org
> > > > Subject: Re: lucene search options
> > > >
> > > > Thanks a lot Daniel, I will try this option. :)
> > > > Is there a way to search for not equal to query alone?
> > > >
> > > > On Mon, Jun 23, 2008 at 12:03 PM, Daniel Noll <da...@nuix.com>
> wrote:
> > > >
> > > > > On Monday 23 June 2008 16:21:17 Aditi Goyal wrote:
> > > > > > I think wildcard (*) cannot be used in the beginning :(
> > > > >
> > > > > Wrong:
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard(boolean)<http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29>
> <
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29
> >
> > > <
> > >
> >
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29
> > > >
> > > > <
> > > >
> > >
> >
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29
> > > > >
> > > > >
> > > > > Daniel
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > > > > For additional commands, e-mail: java-user-help@lucene.apache.org
> > > > >
> > > > >
> > > >
> > > > **************** 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
> > > >
> > > >
> > >
> >
>

Re: lucene search options

Posted by Anshum <an...@gmail.com>.
Hi,

An easy way to do that would be to index a particular term with all docs
e.g. "dummyword" could be indexed for all documents as a value for a
dummyfield or an existing field.
This way lets assume you want to fetch results for -filed1:jakarta
You could search for dummyfield:"dummyword" AND NOT filed1:jakarta

This is just one of the solution, though I still would not understand if
there's a logical reason for fetching such results.:)

--
Anshum Gupta
Naukri Labs!
http://ai-cafe.blogspot.com

The facts expressed here belong to everybody, the opinions to me. The
distinction is yours to draw............


On Sat, Dec 6, 2008 at 10:49 PM, no spam <mr...@gmail.com> wrote:

> We are converting a User Interface query to lucene on the back end. It has
> recently come up that users want to do some negative only queries like NOT
> "jakarta apache". What is an efficient way to do this? We do know what
> field
> they are specifying, ie -field1:jakarta
>
> On Mon, Jun 23, 2008 at 2:53 AM, Aditi Goyal <ad...@gmail.com>
> wrote:
>
> > Thank you Allahbaksh for taking so much pains. The link says it cannot be
> > used alone.
> >
> > Note: The NOT operator cannot be used with just one term. For example,
> the
> > following search will return no results:
> >
> > NOT "jakarta apache"
> > Thanks,
> > Aditi
> >
> >
> > On Mon, Jun 23, 2008 at 1:10 PM, Allahbaksh Mohammedali Asadullah <
> > Allahbaksh_Asadullah@infosys.com> wrote:
> >
> > > Hi Aditi,
> > > You can search using NOT operator. You can go through below link for
> > Query
> > > details http://lucene.apache.org/java/docs/queryparsersyntax.html
> > > Warm 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
> > >
> > >
> > > -----Original Message-----
> > > From: Aditi Goyal [mailto:aditigupta20@gmail.com]
> > > Sent: Monday, June 23, 2008 12:06 PM
> > > To: java-user@lucene.apache.org
> > > Subject: Re: lucene search options
> > >
> > > Thanks a lot Daniel, I will try this option. :)
> > > Is there a way to search for not equal to query alone?
> > >
> > > On Mon, Jun 23, 2008 at 12:03 PM, Daniel Noll <da...@nuix.com> wrote:
> > >
> > > > On Monday 23 June 2008 16:21:17 Aditi Goyal wrote:
> > > > > I think wildcard (*) cannot be used in the beginning :(
> > > >
> > > > Wrong:
> > > >
> > > >
> > > >
> > >
> >
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard(boolean)<http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29>
> > <
> >
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29
> > >
> > > <
> > >
> >
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29
> > > >
> > > >
> > > > Daniel
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > > > For additional commands, e-mail: java-user-help@lucene.apache.org
> > > >
> > > >
> > >
> > > **************** 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
> > >
> > >
> >
>

Re: lucene search options

Posted by no spam <mr...@gmail.com>.
We are converting a User Interface query to lucene on the back end. It has
recently come up that users want to do some negative only queries like NOT
"jakarta apache". What is an efficient way to do this? We do know what field
they are specifying, ie -field1:jakarta

On Mon, Jun 23, 2008 at 2:53 AM, Aditi Goyal <ad...@gmail.com> wrote:

> Thank you Allahbaksh for taking so much pains. The link says it cannot be
> used alone.
>
> Note: The NOT operator cannot be used with just one term. For example, the
> following search will return no results:
>
> NOT "jakarta apache"
> Thanks,
> Aditi
>
>
> On Mon, Jun 23, 2008 at 1:10 PM, Allahbaksh Mohammedali Asadullah <
> Allahbaksh_Asadullah@infosys.com> wrote:
>
> > Hi Aditi,
> > You can search using NOT operator. You can go through below link for
> Query
> > details http://lucene.apache.org/java/docs/queryparsersyntax.html
> > Warm 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
> >
> >
> > -----Original Message-----
> > From: Aditi Goyal [mailto:aditigupta20@gmail.com]
> > Sent: Monday, June 23, 2008 12:06 PM
> > To: java-user@lucene.apache.org
> > Subject: Re: lucene search options
> >
> > Thanks a lot Daniel, I will try this option. :)
> > Is there a way to search for not equal to query alone?
> >
> > On Mon, Jun 23, 2008 at 12:03 PM, Daniel Noll <da...@nuix.com> wrote:
> >
> > > On Monday 23 June 2008 16:21:17 Aditi Goyal wrote:
> > > > I think wildcard (*) cannot be used in the beginning :(
> > >
> > > Wrong:
> > >
> > >
> > >
> >
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard(boolean)
> <
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29
> >
> > <
> >
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29
> > >
> > >
> > > Daniel
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > > For additional commands, e-mail: java-user-help@lucene.apache.org
> > >
> > >
> >
> > **************** 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
> >
> >
>

Re: lucene search options

Posted by no spam <mr...@gmail.com>.
We are converting a User Interface query to lucene on the back end.  It has
recently come up that users want to do some negative only queries like NOT
"jakarta apache".  What is an efficient way to do this?  We do know what
field they are specifying, ie   -field1:jakarta

On Mon, Jun 23, 2008 at 2:53 AM, Aditi Goyal <ad...@gmail.com> wrote:

> Thank you Allahbaksh for taking so much pains. The link says it cannot be
> used alone.
>
> Note: The NOT operator cannot be used with just one term. For example, the
> following search will return no results:
>
> NOT "jakarta apache"
> Thanks,
> Aditi
>
>
> On Mon, Jun 23, 2008 at 1:10 PM, Allahbaksh Mohammedali Asadullah <
> Allahbaksh_Asadullah@infosys.com> wrote:
>
> > Hi Aditi,
> > You can search using NOT operator. You can go through below link for
> Query
> > details http://lucene.apache.org/java/docs/queryparsersyntax.html
> > Warm 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
> >
> >
> > -----Original Message-----
> > From: Aditi Goyal [mailto:aditigupta20@gmail.com]
> > Sent: Monday, June 23, 2008 12:06 PM
> > To: java-user@lucene.apache.org
> > Subject: Re: lucene search options
> >
> > Thanks a lot Daniel, I will try this option. :)
> > Is there a way to search for not equal to query alone?
> >
> > On Mon, Jun 23, 2008 at 12:03 PM, Daniel Noll <da...@nuix.com> wrote:
> >
> > > On Monday 23 June 2008 16:21:17 Aditi Goyal wrote:
> > > > I think wildcard (*) cannot be used in the beginning :(
> > >
> > > Wrong:
> > >
> > >
> > >
> >
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard(boolean)
> <
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29
> >
> > <
> >
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29
> > >
> > >
> > > Daniel
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > > For additional commands, e-mail: java-user-help@lucene.apache.org
> > >
> > >
> >
> > **************** 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
> >
> >
>

Re: lucene search options

Posted by Aditi Goyal <ad...@gmail.com>.
Thank you Allahbaksh for taking so much pains. The link says it cannot be
used alone.

Note: The NOT operator cannot be used with just one term. For example, the
following search will return no results:

NOT "jakarta apache"
Thanks,
Aditi


On Mon, Jun 23, 2008 at 1:10 PM, Allahbaksh Mohammedali Asadullah <
Allahbaksh_Asadullah@infosys.com> wrote:

> Hi Aditi,
> You can search using NOT operator. You can go through below link for Query
> details http://lucene.apache.org/java/docs/queryparsersyntax.html
> Warm 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
>
>
> -----Original Message-----
> From: Aditi Goyal [mailto:aditigupta20@gmail.com]
> Sent: Monday, June 23, 2008 12:06 PM
> To: java-user@lucene.apache.org
> Subject: Re: lucene search options
>
> Thanks a lot Daniel, I will try this option. :)
> Is there a way to search for not equal to query alone?
>
> On Mon, Jun 23, 2008 at 12:03 PM, Daniel Noll <da...@nuix.com> wrote:
>
> > On Monday 23 June 2008 16:21:17 Aditi Goyal wrote:
> > > I think wildcard (*) cannot be used in the beginning :(
> >
> > Wrong:
> >
> >
> >
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard(boolean)<http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29>
> <
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29
> >
> >
> > Daniel
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> >
>
> **************** 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
>
>

RE: lucene search options

Posted by Allahbaksh Mohammedali Asadullah <Al...@infosys.com>.
Hi Aditi,
You can search using NOT operator. You can go through below link for Query details http://lucene.apache.org/java/docs/queryparsersyntax.html
Warm 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


-----Original Message-----
From: Aditi Goyal [mailto:aditigupta20@gmail.com]
Sent: Monday, June 23, 2008 12:06 PM
To: java-user@lucene.apache.org
Subject: Re: lucene search options

Thanks a lot Daniel, I will try this option. :)
Is there a way to search for not equal to query alone?

On Mon, Jun 23, 2008 at 12:03 PM, Daniel Noll <da...@nuix.com> wrote:

> On Monday 23 June 2008 16:21:17 Aditi Goyal wrote:
> > I think wildcard (*) cannot be used in the beginning :(
>
> Wrong:
>
>
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard(boolean)<http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29>
>
> Daniel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

**************** 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


Re: lucene search options

Posted by Aditi Goyal <ad...@gmail.com>.
Thanks a lot Daniel, I will try this option. :)
Is there a way to search for not equal to query alone?

On Mon, Jun 23, 2008 at 12:03 PM, Daniel Noll <da...@nuix.com> wrote:

> On Monday 23 June 2008 16:21:17 Aditi Goyal wrote:
> > I think wildcard (*) cannot be used in the beginning :(
>
> Wrong:
>
>
> http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard(boolean)<http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard%28boolean%29>
>
> Daniel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

RE: lucene search options

Posted by Allahbaksh Mohammedali Asadullah <Al...@infosys.com>.
Hi Daniel,
You are right earlier the wild card character were not supported but now they are supported.
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


-----Original Message-----
From: Daniel Noll [mailto:daniel@nuix.com]
Sent: Monday, June 23, 2008 12:03 PM
To: java-user@lucene.apache.org
Subject: Re: lucene search options

On Monday 23 June 2008 16:21:17 Aditi Goyal wrote:
> I think wildcard (*) cannot be used in the beginning :(

Wrong:

http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard(boolean)

Daniel

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


**************** 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


Re: lucene search options

Posted by Daniel Noll <da...@nuix.com>.
On Monday 23 June 2008 16:21:17 Aditi Goyal wrote:
> I think wildcard (*) cannot be used in the beginning :(

Wrong:

http://lucene.apache.org/java/2_3_0/api/core/org/apache/lucene/queryParser/QueryParser.html#setAllowLeadingWildcard(boolean)

Daniel

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


RE: lucene search options

Posted by Allahbaksh Mohammedali Asadullah <Al...@infosys.com>.
Usually if you negate the keyword then that document will be skipped. So what else you want to search. Design of fields is very important.
Warm 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


-----Original Message-----
From: Aditi Goyal [mailto:aditigupta20@gmail.com]
Sent: Monday, June 23, 2008 12:01 PM
To: java-user@lucene.apache.org
Subject: Re: lucene search options

Thanks Allahbaksh, But this was just an example. I want to search for lot
more fields like this.


On Mon, Jun 23, 2008 at 11:55 AM, Allahbaksh Mohammedali Asadullah <
Allahbaksh_Asadullah@infosys.com> wrote:

> One way of doing it is while parsing email if it has .gmail.com add it to
> different field also.
> Warm 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://allahbaksh.blogspot.com
>
>
> -----Original Message-----
> From: Aditi Goyal [mailto:aditigupta20@gmail.com]
> Sent: Monday, June 23, 2008 11:51 AM
> To: java-user@lucene.apache.org
> Subject: lucene search options
>
> Hi All,
>
> I am using Lucene for creating indexes. There is one field as "email" which
> stored the email id.
> I have few queries regarding searching:
> 1. I want to search for all the records having domain as "gmail.com" . So,
> is there a way by which I can do a partial search on "email" field such
> that
> I get the records matching only the domain name.
> I think wildcard (*) cannot be used in the beginning :(
>
> 2. If I just want to search for the records which are not matching email as
> "abc@xyz.com"
> How can I search for it. Here, MUST_NOT cannot be used alone. Is there a
> way
> out?
>
>
> Please help.
>
> Thanks,
> Aditi
>
> **************** 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
>
>

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


Re: lucene search options

Posted by Aditi Goyal <ad...@gmail.com>.
Thanks Allahbaksh, But this was just an example. I want to search for lot
more fields like this.


On Mon, Jun 23, 2008 at 11:55 AM, Allahbaksh Mohammedali Asadullah <
Allahbaksh_Asadullah@infosys.com> wrote:

> One way of doing it is while parsing email if it has .gmail.com add it to
> different field also.
> Warm 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://allahbaksh.blogspot.com
>
>
> -----Original Message-----
> From: Aditi Goyal [mailto:aditigupta20@gmail.com]
> Sent: Monday, June 23, 2008 11:51 AM
> To: java-user@lucene.apache.org
> Subject: lucene search options
>
> Hi All,
>
> I am using Lucene for creating indexes. There is one field as "email" which
> stored the email id.
> I have few queries regarding searching:
> 1. I want to search for all the records having domain as "gmail.com" . So,
> is there a way by which I can do a partial search on "email" field such
> that
> I get the records matching only the domain name.
> I think wildcard (*) cannot be used in the beginning :(
>
> 2. If I just want to search for the records which are not matching email as
> "abc@xyz.com"
> How can I search for it. Here, MUST_NOT cannot be used alone. Is there a
> way
> out?
>
>
> Please help.
>
> Thanks,
> Aditi
>
> **************** 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
>
>

RE: lucene search options

Posted by Allahbaksh Mohammedali Asadullah <Al...@infosys.com>.
One way of doing it is while parsing email if it has .gmail.com add it to different field also.
Warm 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://allahbaksh.blogspot.com


-----Original Message-----
From: Aditi Goyal [mailto:aditigupta20@gmail.com]
Sent: Monday, June 23, 2008 11:51 AM
To: java-user@lucene.apache.org
Subject: lucene search options

Hi All,

I am using Lucene for creating indexes. There is one field as "email" which
stored the email id.
I have few queries regarding searching:
1. I want to search for all the records having domain as "gmail.com" . So,
is there a way by which I can do a partial search on "email" field such that
I get the records matching only the domain name.
I think wildcard (*) cannot be used in the beginning :(

2. If I just want to search for the records which are not matching email as
"abc@xyz.com"
How can I search for it. Here, MUST_NOT cannot be used alone. Is there a way
out?


Please help.

Thanks,
Aditi

**************** 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