Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-User

using phrase query with wildcard

 

 

Lucene java-user RSS feed   Index | Next | Previous | View Threaded


ilya.levin at hp

Jul 22, 2012, 1:29 AM

Post #1 of 5 (1167 views)
Permalink
using phrase query with wildcard

Hi,

I'm trying to create a phrase query with wildcard, from the forums it seems that the solution is not trivial.
I'm trying to create the following queries: "this is a phrase*" OR "*This is a phrase" and
Get hits on every possibility where the * resides.
What is the best way to achieve this?

Thanks.


dorony at gingersoftware

Jul 22, 2012, 1:48 AM

Post #2 of 5 (1164 views)
Permalink
RE: using phrase query with wildcard [In reply to]

Is * a placeholder for a term or a part of a term?

-----Original Message-----
From: Levin, Ilya [mailto:ilya.levin [at] hp]
Sent: 22 July 2012 11:29
To: java-user [at] lucene
Subject: using phrase query with wildcard

Hi,

I'm trying to create a phrase query with wildcard, from the forums it seems that the solution is not trivial.
I'm trying to create the following queries: "this is a phrase*" OR "*This is a phrase" and Get hits on every possibility where the * resides.
What is the best way to achieve this?

Thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


ilya.levin at hp

Jul 22, 2012, 2:51 AM

Post #3 of 5 (1160 views)
Permalink
RE: using phrase query with wildcard [In reply to]

It can be both.

-----Original Message-----
From: Doron Yaacoby [mailto:dorony [at] gingersoftware]
Sent: ιεν ΰ 22 ιεμι 2012 11:48
To: java-user [at] lucene
Subject: RE: using phrase query with wildcard

Is * a placeholder for a term or a part of a term?

-----Original Message-----
From: Levin, Ilya [mailto:ilya.levin [at] hp]
Sent: 22 July 2012 11:29
To: java-user [at] lucene
Subject: using phrase query with wildcard

Hi,

I'm trying to create a phrase query with wildcard, from the forums it seems that the solution is not trivial.
I'm trying to create the following queries: "this is a phrase*" OR "*This is a phrase" and Get hits on every possibility where the * resides.
What is the best way to achieve this?

Thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


jack at basetechnology

Jul 22, 2012, 8:14 AM

Post #4 of 5 (1159 views)
Permalink
Re: using phrase query with wildcard [In reply to]

SpanNearQuery can be used to allow an arbitrary number of terms between
sub-phrases of a larger phrase. But, that is between terms, not at the
beginning or end of a phrase.

See:
http://lucene.apache.org/core/3_6_0/api/core/org/apache/lucene/search/spans/SpanNearQuery.html

You can use SpanMultiTermQueryWrapper to include wild and fuzzy terms in
your span query.

See:
http://lucene.apache.org/core/3_6_0/api/core/org/apache/lucene/search/spans/SpanMultiTermQueryWrapper.html

You can also use SpanPositionRangeQuery to assure that a phrase match occurs
with a desired position range, such as to assure that the match occurs at
the beginning, near the beginning, or end of a document.

See:
http://lucene.apache.org/core/3_6_0/api/core/org/apache/lucene/search/spans/SpanPositionRangeQuery.html

-- Jack Krupansky

-----Original Message-----
From: Levin, Ilya
Sent: Sunday, July 22, 2012 4:51 AM
To: java-user [at] lucene
Subject: RE: using phrase query with wildcard

It can be both.

-----Original Message-----
From: Doron Yaacoby [mailto:dorony [at] gingersoftware]
Sent: ιεν ΰ 22 ιεμι 2012 11:48
To: java-user [at] lucene
Subject: RE: using phrase query with wildcard

Is * a placeholder for a term or a part of a term?

-----Original Message-----
From: Levin, Ilya [mailto:ilya.levin [at] hp]
Sent: 22 July 2012 11:29
To: java-user [at] lucene
Subject: using phrase query with wildcard

Hi,

I'm trying to create a phrase query with wildcard, from the forums it seems
that the solution is not trivial.
I'm trying to create the following queries: "this is a phrase*" OR "*This
is a phrase" and Get hits on every possibility where the * resides.
What is the best way to achieve this?

Thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


iorixxx at yahoo

Jul 23, 2012, 6:21 AM

Post #5 of 5 (1150 views)
Permalink
Re: using phrase query with wildcard [In reply to]

> I'm trying to create a phrase query with wildcard, from the
> forums it seems that the solution is not trivial.
> I'm trying to create the following queries: "this is a
> phrase*"  OR  "*This is a phrase" and
> Get hits on every possibility where the * resides.
> What is the best way to achieve this?

Some pointers:

https://issues.apache.org/jira/browse/LUCENE-1486

http://lucene.apache.org/core/3_6_1/api/all/org/apache/lucene/queryParser/complexPhrase/ComplexPhraseQueryParser.html

http://wiki.apache.org/lucene-java/LuceneFAQ#Can_I_combine_wildcard_and_phrase_search.2C_e.g._.22foo_ba.2A.22.3F

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene

Lucene java-user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.