You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by David Kaelbling <dk...@blackducksoftware.com> on 2008/12/11 17:24:18 UTC
Re: [jira] Created: (LUCENE-1486) Wildcards, ORs etc inside Phrase
queries
Will https://issues.apache.org/jira/browse/LUCENE-1486 let people
include NOT inside phrases? My customers would like to have queries
like "copyright !mycompany"~2, that find any copyright clause except
their own. Currently searches like this hit on copyright only if
mycompany doesn't appear anywhere in the document; it ignores the
phrase/proximity requirement.
Thanks,
David
--
David Kaelbling
Senior Software Engineer
Black Duck Software, Inc.
dkaelbling@blackducksoftware.com
T +1.781.810.2041
F +1.781.891.5145
http://www.blackducksoftware.com
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
RE: [jira] Created: (LUCENE-1486) Wildcards, ORs etc inside Phrasequeries
Posted by Steven A Rowe <sa...@syr.edu>.
Hi David,
SpanRegexQuery may help - see my response on a similar thread below:
<http://www.nabble.com/Query-to-ignore-certain-phrases-td18935560.html#a18946729>
Steve
On 12/11/2008 at 11:59 AM, David Kaelbling wrote:
> Thanks! But not quite -- that query doesn't hit on a document that
> contains:
> copyright 2008 mycompany
> blah blah blah blah
> copyright 2008 yourcompany
>
> - David
>
> On Thu, 2008-12-11 at 11:33 -0500, Yonik Seeley wrote:
> > On Thu, Dec 11, 2008 at 11:24 AM, David Kaelbling
> > <dk...@blackducksoftware.com> wrote:
> > > Will https://issues.apache.org/jira/browse/LUCENE-1486 let people
> > > include NOT inside phrases? My customers would like to have queries
> > > like "copyright !mycompany"~2, that find any copyright clause except
> > > their own.
> >
> > MultiPhraseQuery doesn't have that capability, but you could easily
> > handle this specific query with
> > copyright -"copyright mycompany"~2
> >
> > -Yonik
>
> --
> David Kaelbling
> Senior Software Engineer
> Black Duck Software, Inc.
>
> dkaelbling@blackducksoftware.com
> T +1.781.810.2041
> F +1.781.891.5145
>
> http://www.blackducksoftware.com
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
Re: [jira] Created: (LUCENE-1486) Wildcards, ORs etc inside Phrase
queries
Posted by David Kaelbling <dk...@blackducksoftware.com>.
Thanks! But not quite -- that query doesn't hit on a document that
contains:
copyright 2008 mycompany
blah blah blah blah
copyright 2008 yourcompany
- David
On Thu, 2008-12-11 at 11:33 -0500, Yonik Seeley wrote:
> On Thu, Dec 11, 2008 at 11:24 AM, David Kaelbling
> <dk...@blackducksoftware.com> wrote:
> > Will https://issues.apache.org/jira/browse/LUCENE-1486 let people
> > include NOT inside phrases? My customers would like to have queries
> > like "copyright !mycompany"~2, that find any copyright clause except
> > their own.
>
> MultiPhraseQuery doesn't have that capability, but you could easily
> handle this specific query with
> copyright -"copyright mycompany"~2
>
> -Yonik
--
David Kaelbling
Senior Software Engineer
Black Duck Software, Inc.
dkaelbling@blackducksoftware.com
T +1.781.810.2041
F +1.781.891.5145
http://www.blackducksoftware.com
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
Re: [jira] Created: (LUCENE-1486) Wildcards, ORs etc inside Phrase queries
Posted by Yonik Seeley <yo...@apache.org>.
On Thu, Dec 11, 2008 at 11:33 AM, Yonik Seeley <yo...@apache.org> wrote:
> On Thu, Dec 11, 2008 at 11:24 AM, David Kaelbling
> <dk...@blackducksoftware.com> wrote:
>> Will https://issues.apache.org/jira/browse/LUCENE-1486 let people
>> include NOT inside phrases? My customers would like to have queries
>> like "copyright !mycompany"~2, that find any copyright clause except
>> their own.
>
> MultiPhraseQuery doesn't have that capability, but you could easily
> handle this specific query with
> copyright -"copyright mycompany"~2
oops, sorry, that's actually not equivalent.
I assume you want a document with "copyright mycomany zzz zzz
zzzcopyright anotherco" to match.
-Yonik
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
Re: [jira] Created: (LUCENE-1486) Wildcards, ORs etc inside Phrase queries
Posted by mark harwood <ma...@yahoo.co.uk>.
I'm not sure I see an easy translation of "copyright !mycompany" into SpanQueries which is how all the other queries are being converted.
SpanNotQuery isn't applicable here because that only tests spans don't overlap. Yonik's approach looks good.
----- Original Message ----
From: Yonik Seeley <yo...@apache.org>
To: java-dev@lucene.apache.org
Cc: David Kaelbling <dk...@blackducksoftware.com>
Sent: Thursday, 11 December, 2008 16:33:39
Subject: Re: [jira] Created: (LUCENE-1486) Wildcards, ORs etc inside Phrase queries
On Thu, Dec 11, 2008 at 11:24 AM, David Kaelbling
<dk...@blackducksoftware.com> wrote:
> Will https://issues.apache.org/jira/browse/LUCENE-1486 let people
> include NOT inside phrases? My customers would like to have queries
> like "copyright !mycompany"~2, that find any copyright clause except
> their own.
MultiPhraseQuery doesn't have that capability, but you could easily
handle this specific query with
copyright -"copyright mycompany"~2
-Yonik
Currently searches like this hit on copyright only if
> mycompany doesn't appear anywhere in the document; it ignores the
> phrase/proximity requirement.
>
> Thanks,
> David
>
> --
> David Kaelbling
> Senior Software Engineer
> Black Duck Software, Inc.
>
> dkaelbling@blackducksoftware.com
> T +1.781.810.2041
> F +1.781.891.5145
>
> http://www.blackducksoftware.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
Re: [jira] Created: (LUCENE-1486) Wildcards, ORs etc inside Phrase queries
Posted by Yonik Seeley <yo...@apache.org>.
On Thu, Dec 11, 2008 at 11:24 AM, David Kaelbling
<dk...@blackducksoftware.com> wrote:
> Will https://issues.apache.org/jira/browse/LUCENE-1486 let people
> include NOT inside phrases? My customers would like to have queries
> like "copyright !mycompany"~2, that find any copyright clause except
> their own.
MultiPhraseQuery doesn't have that capability, but you could easily
handle this specific query with
copyright -"copyright mycompany"~2
-Yonik
Currently searches like this hit on copyright only if
> mycompany doesn't appear anywhere in the document; it ignores the
> phrase/proximity requirement.
>
> Thanks,
> David
>
> --
> David Kaelbling
> Senior Software Engineer
> Black Duck Software, Inc.
>
> dkaelbling@blackducksoftware.com
> T +1.781.810.2041
> F +1.781.891.5145
>
> http://www.blackducksoftware.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org