SpanRegexQuery

2008-07-31 Thread Christopher M Collins
Hello, I'm trying to use SpanRegexQuery as one of the clauses in my SpanQuery. When I give it a regex like: "L[a-z]+ing" and do a rewrite on the final query I get terms like "Labinger" and "Lackonsingh" along with the expected terms "Labeling", "

Re: SpanRegexQuery

2008-07-31 Thread Daniel Noll
Christopher M Collins wrote: Hello, I'm trying to use SpanRegexQuery as one of the clauses in my SpanQuery. When I give it a regex like: "L[a-z]+ing" and do a rewrite on the final query I get terms like "Labinger" and "Lackonsingh" along with the expected ter

Re: SpanRegexQuery

2008-08-01 Thread Erik Hatcher
On Jul 31, 2008, at 10:06 PM, Christopher M Collins wrote: I'm trying to use SpanRegexQuery as one of the clauses in my SpanQuery. When I give it a regex like: "L[a-z]+ing" and do a rewrite on the final query I get terms like "Labinger" and "Lackonsingh&quo

Location of SpanRegexQuery

2007-08-16 Thread dontspamterry
Hi, While researching support for wildcards in a PhraseQuery, I see various references to SpanRegexQuery which is not part of the 2.2 distribution. I checked the Lucene site to see if it's some add-on jar, but couldn't find anything so I'm wondering where can I obtain the .class/

SpanRegexQuery causes error

2006-09-07 Thread Luke Tan
!StringUtils.isEmpty(queryText)) { if (queryText.indexOf("*") == 0 || queryText.indexOf("?") == 0) return null; if (queryText.indexOf(' ') != -1) { SpanRegexQuery srq = new SpanRegexQuery(new Term(field, queryText));

Re: Location of SpanRegexQuery

2007-08-16 Thread Erick Erickson
wrote: > > > Hi, > > While researching support for wildcards in a PhraseQuery, I see various > references to SpanRegexQuery which is not part of the 2.2 distribution. I > checked the Lucene site to see if it's some add-on jar, but couldn't find > anything so I&#x

Re: Location of SpanRegexQuery

2007-08-16 Thread dontspamterry
and I've never had to > find any other jars from the Lucene site, they've all > been in contrib > > Hope this helps > Erick > > On 8/16/07, dontspamterry <[EMAIL PROTECTED]> wrote: >> >> >> Hi, >> >> While researching support f

Re: SpanRegexQuery causes error

2006-09-07 Thread Erik Hatcher
pty(queryText)) { if (queryText.indexOf("*") == 0 || queryText.indexOf ("?") == 0) return null; if (queryText.indexOf(' ') != -1) { SpanRegexQuery srq = new SpanRegexQuery(new Term(field, queryText));

Re: SpanRegexQuery causes error

2006-09-07 Thread Luke Tan
It's spanFirst(spanRegexQuery(monthly:day * of every * months), 10) java.lang.NullPointerException java.lang.NullPointerException at java.util.Hashtable.get(Hashtable.java:336) at org.apache.lucene.index.MultiReader.norms(MultiReader.java:163)

Re: SpanRegexQuery causes error

2006-09-08 Thread Erik Hatcher
On Sep 7, 2006, at 9:26 PM, Luke Tan wrote: spanFirst(spanRegexQuery(monthly:day * of every * months), 10) What analyzer did you use for your text? Again, that is not a valid regular expression. But also, you're using a single long string of several words within your SpanRegex

Re: SpanRegexQuery causes error

2006-09-08 Thread Luke Tan
e: On Sep 7, 2006, at 9:26 PM, Luke Tan wrote: > spanFirst(spanRegexQuery(monthly:day * of every * months), 10) What analyzer did you use for your text? Again, that is not a valid regular expression. But also, you're using a single long string of several words within your SpanRege

Re: SpanRegexQuery causes error

2006-09-08 Thread Luke Tan
and I nest these SpanTermQuery into SpanNearQuery with slop > 1. Thanks. On 9/9/06, Erik Hatcher <[EMAIL PROTECTED]> wrote: > > > On Sep 7, 2006, at 9:26 PM, Luke Tan wrote: > > spanFirst(spanRegexQuery(monthly:day * of every * months), 10) > > What analyzer did y

Re: SpanRegexQuery causes error

2006-09-08 Thread Erik Hatcher
anks. On 9/9/06, Erik Hatcher <[EMAIL PROTECTED]> wrote: On Sep 7, 2006, at 9:26 PM, Luke Tan wrote: > spanFirst(spanRegexQuery(monthly:day * of every * months), 10) What analyzer did you use for your text? Again, that is not a valid regular expression. But also, you're us

Problem when using getSpans for SpanRegexQuery

2011-04-02 Thread Tianyu Li
Hi, I was trying to use SpanRegexQuery in Lucene 3.03 to find terms that match regular expression. The reason I use SpanRegexQuery instead of RegexQuery is because I want to get all matches of the regular expression (if there are multiple ones in a document), not just documents containing these

Has SpanRegexQuery been deprecated in lucene 2.3.0?

2008-02-12 Thread Mitchell, Erica
Hi, I've downloaded lucene 2.3.0 and the jar lucene-core-2.3.0.jar does not contain the SpanRegexQuery class. Has this been deprecated? Thanks, Erica IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Bui

Using SpanRegexQuery to search year like 200?

2006-09-08 Thread Luke Tan
Hi, Can this be use to search year 2000, 2001, 2002, ... 2009? SpanFirstQuery snq = new SpanFirstQuery(new SpanRegexQuery(new Term("year", "200?")), 1); I need to use it to search something like Who is born in 200? Thanks

Re: Has SpanRegexQuery been deprecated in lucene 2.3.0?

2008-02-12 Thread Erik Hatcher
Erica - it has never been in the core JAR.It should be available in the lucene-regex-2.3.0.jar Erik On Feb 12, 2008, at 10:01 AM, Mitchell, Erica wrote: Hi, I've downloaded lucene 2.3.0 and the jar lucene-core-2.3.0.jar does not contain the SpanRegexQuery class. Has

Re: Using SpanRegexQuery to search year like 200?

2006-09-08 Thread Erik Hatcher
To use SpanRegexQuery, you need to understand regular expressions. The WildcardQuery syntax is _NOT_ the same as SpanRegexQuery syntax. WildcardQuery supports a ? for single character match and * for multiple characters. SpanRegexQuery use standard regular expression syntax. &quo

Re: Using SpanRegexQuery to search year like 200?

2006-09-09 Thread Erick Erickson
stQuery(new SpanRegexQuery(new Term("year", "200?")), 1); I need to use it to search something like Who is born in 200? Thanks

Re: Using SpanRegexQuery to search year like 200?

2006-09-10 Thread Luke Tan
ED]> wrote: > > Hi, > > Can this be use to search year 2000, 2001, 2002, ... 2009? > > SpanFirstQuery snq = new SpanFirstQuery(new SpanRegexQuery(new > Term("year", > "200?")), 1); > > > I need to use it to search something like > > Who is born in 200? > > Thanks > >

Re: Using SpanRegexQuery to search year like 200?

2006-09-10 Thread Luke Tan
Hi, Oops. You just remind me about that. I conveniently think regex as simple as * and ? Yes, I understood java regex. Thanks Luke On 9/9/06, Erik Hatcher <[EMAIL PROTECTED]> wrote: To use SpanRegexQuery, you need to understand regular expressions. The WildcardQuery syntax is _NOT_ th

Re: Using SpanRegexQuery to search year like 200?

2006-09-10 Thread Erick Erickson
k > > On 9/8/06, Luke Tan <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > Can this be use to search year 2000, 2001, 2002, ... 2009? > > > > SpanFirstQuery snq = new SpanFirstQuery(new SpanRegexQuery(new > > Term("year", > > "200?")), 1); > > > > > > I need to use it to search something like > > > > Who is born in 200? > > > > Thanks > > > > > >