
jack at basetechnology
Jul 22, 2012, 8:14 AM
Post #4 of 5
(408 views)
Permalink
|
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
|