You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by javier muguruza <jm...@gmail.com> on 2006/03/09 19:36:39 UTC

1.9.1 problem with MatchAllDocsQuery

Hi all,

I was using lucene-1.9-rc1-dev.jar (got it from luke website I think).
I was running a query whose tostring() was:
-body:angel -body:darpa -body:protocol +MatchAllDocsQuery1.0

When I upgraded to 1.9.1, I am getting an exception:
ava.lang.ArrayIndexOutOfBoundsException: 0
	at org.apache.lucene.search.MultiSearcher.rewrite(MultiSearcher.java:268)
	at org.apache.lucene.search.MultiSearcher.createWeight(MultiSearcher.java:293)
	at org.apache.lucene.search.Searcher.search(Searcher.java:116)
	at org.apache.lucene.search.Searcher.search(Searcher.java:95)
	at runner.step.LuceneSearchHelper.search(LuceneSearchHelper.java:52)
tostring gives the following:
-body:angel -body:darpa -body:protocol +MatchAllDocsQuery

is that a regression?

thanks,
javier

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: 1.9.1 problem with MatchAllDocsQuery

Posted by javier muguruza <jm...@gmail.com>.
thanks Yonik, did not notice that. I patched my code not to run the
search in that case, previous versions of lucene did not throw any
exception in the same case though.

thanks

On 3/10/06, Yonik Seeley <ys...@gmail.com> wrote:
> Hi Javier,
>
> The exception is happening on the last line of this method:
>
>   public Query rewrite(Query original) throws IOException {
>     Query[] queries = new Query[searchables.length];
>     for (int i = 0; i < searchables.length; i++) {
>       queries[i] = searchables[i].rewrite(original);
>     }
>     return queries[0].combine(queries);
>   }
>
> It looks like the only way that can happen is if you don't have any
> searchables in your MultiSearcher.
>
> -Yonik
> http://incubator.apache.org/solr Solr, The Open Source Lucene Search Server
>
>
> On 3/9/06, javier muguruza <jm...@gmail.com> wrote:
> > Hi all,
> >
> > I was using lucene-1.9-rc1-dev.jar (got it from luke website I think).
> > I was running a query whose tostring() was:
> > -body:angel -body:darpa -body:protocol +MatchAllDocsQuery1.0
> >
> > When I upgraded to 1.9.1, I am getting an exception:
> > ava.lang.ArrayIndexOutOfBoundsException: 0
> >         at org.apache.lucene.search.MultiSearcher.rewrite(MultiSearcher.java:268)
> >         at org.apache.lucene.search.MultiSearcher.createWeight(MultiSearcher.java:293)
> >         at org.apache.lucene.search.Searcher.search(Searcher.java:116)
> >         at org.apache.lucene.search.Searcher.search(Searcher.java:95)
> >         at runner.step.LuceneSearchHelper.search(LuceneSearchHelper.java:52)
> > tostring gives the following:
> > -body:angel -body:darpa -body:protocol +MatchAllDocsQuery
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: 1.9.1 problem with MatchAllDocsQuery

Posted by Yonik Seeley <ys...@gmail.com>.
Hi Javier,

The exception is happening on the last line of this method:

  public Query rewrite(Query original) throws IOException {
    Query[] queries = new Query[searchables.length];
    for (int i = 0; i < searchables.length; i++) {
      queries[i] = searchables[i].rewrite(original);
    }
    return queries[0].combine(queries);
  }

It looks like the only way that can happen is if you don't have any
searchables in your MultiSearcher.

-Yonik
http://incubator.apache.org/solr Solr, The Open Source Lucene Search Server


On 3/9/06, javier muguruza <jm...@gmail.com> wrote:
> Hi all,
>
> I was using lucene-1.9-rc1-dev.jar (got it from luke website I think).
> I was running a query whose tostring() was:
> -body:angel -body:darpa -body:protocol +MatchAllDocsQuery1.0
>
> When I upgraded to 1.9.1, I am getting an exception:
> ava.lang.ArrayIndexOutOfBoundsException: 0
>         at org.apache.lucene.search.MultiSearcher.rewrite(MultiSearcher.java:268)
>         at org.apache.lucene.search.MultiSearcher.createWeight(MultiSearcher.java:293)
>         at org.apache.lucene.search.Searcher.search(Searcher.java:116)
>         at org.apache.lucene.search.Searcher.search(Searcher.java:95)
>         at runner.step.LuceneSearchHelper.search(LuceneSearchHelper.java:52)
> tostring gives the following:
> -body:angel -body:darpa -body:protocol +MatchAllDocsQuery

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org