lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luke Tan" <tans...@gmail.com>
Subject Re: SpanRegexQuery causes error
Date Sat, 09 Sep 2006 00:04:32 GMT
I use analyzer with LowerCaseTokenizer only (No stop word or any other
special treatment). The phrase is tokenized.

On 9/9/06, Luke Tan

> I tried .* too but it gave the same error. I think it's a bug.
>
> I solve it using SpanTermQuery where the search phrase is broken into
> day
> of
> every
> months
>
> and I nest these SpanTermQuery into SpanNearQuery with slop > 1.
>
> Thanks.
>
>
> On 9/9/06, Erik Hatcher <erik@ehatchersolutions.com> 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 using a single long string of
> > several words within your SpanRegexQuery term.  What you probably
> > want is a SpanNearQuery of those fixed terms along with a ".*"
> > SpanRegexQuery in the wildcarded spots, and then you could nest that
> > inside a SpaneFirstQuery.
> >
> > > java.lang.NullPointerException
> > > java.lang.NullPointerException
> > >    at java.util.Hashtable.get(Hashtable.java:336)
> > >    at org.apache.lucene.index.MultiReader.norms (MultiReader.java:163)
> > >    at org.apache.lucene.search.spans.SpanWeight.scorer
> > > (SpanWeight.java:70)
> > >    at org.apache.lucene.search.IndexSearcher.search
> > > (IndexSearcher.java:129)
> > >    at org.apache.lucene.search.IndexSearcher.search
> > > (IndexSearcher.java:110)
> > >    at org.apache.lucene.search.Hits.getMoreDocs(Hits.java:65)
> > >    at org.apache.lucene.search.Hits.<init>(Hits.java:52)
> > >    at org.apache.lucene.search.Searcher.search(Searcher.java:53)
> >
> >
> > It's likely a bug that you get this particular error, but I think
> > you'll get around it by solving the above mentioned issues with your
> > query.
> >
> >         Erik
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message