lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Cutting (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LUCENE-556) MatchAllDocsQuery, MultiSearcher and a custom HitCollector throwing exception
Date Fri, 05 May 2006 15:36:28 GMT
     [ http://issues.apache.org/jira/browse/LUCENE-556?page=all ]

Doug Cutting updated LUCENE-556:
--------------------------------

    Fix Version: 2.0

> MatchAllDocsQuery, MultiSearcher and a custom HitCollector throwing exception
> -----------------------------------------------------------------------------
>
>          Key: LUCENE-556
>          URL: http://issues.apache.org/jira/browse/LUCENE-556
>      Project: Lucene - Java
>         Type: Bug

>   Components: Search
>     Versions: 1.9
>  Environment: xp sp2, jdk1.5
>     Reporter: jm
>     Priority: Minor
>      Fix For: 2.0

>
> I have encountered an issue with lucene1.9.1. It involves MatchAllDocsQuery, MultiSearcher
and a custom HitCollector. The following code throws  java.lang.UnsupportedOperationException.
> If I remove the MatchAllDocsQuery  condition (comment whole //1 block), or if I dont
use the custom hitcollector (ms.search(mbq); instead of ms.search(mbq, allcoll);) the exception
goes away. By stepping into the source I can see it seems due to MatchAllDocsQuery no implementing
extractTerms()....
>            Searcher searcher = new
> IndexSearcher("c:\\projects\\mig\\runtime\\index\\01Aug16\\");
>            Searchable[] indexes = new IndexSearcher[1];
>            indexes[0] = searcher;
>            MultiSearcher ms = new MultiSearcher(indexes);
>            AllCollector allcoll = new AllCollector(ms);
>            BooleanQuery mbq = new BooleanQuery();
>            mbq.add(new TermQuery(new Term("body", "value1")),
> BooleanClause.Occur.MUST_NOT);
> // 1
>            MatchAllDocsQuery alld = new MatchAllDocsQuery();
>            mbq.add(alld, BooleanClause.Occur.MUST);
> //
>            System.out.println("Query: " + mbq.toString());
>            // 2
>            ms.search(mbq, allcoll);
>            //ms.search(mbq);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


Mime
View raw message