You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by bu...@apache.org on 2002/09/18 01:12:16 UTC

DO NOT REPLY [Bug 12667] - MultiSearcher does not work with MultiTermQuery or PrefixQuery

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12667>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12667

MultiSearcher does not work with MultiTermQuery or PrefixQuery





------- Additional Comments From alt@picnic.demon.co.uk  2002-09-17 23:12 -------

It seems that Queries are reset using the "prepare()" method on a Query. However
the MultiTermQuery does not do this correctly. Its caches in the 

private BooleanQuery query;

member item the results of the terms generated from the index. This value is
never cleared in the prepare() method - hence further indexes are ignored.

You cannot create a prepare() method in MultiTermQuery since its subclasses
override 
the method and provide there own implementation.

The solution I propose is to change setEnum in MultiTermQuery as follows:-

    /** Set the TermEnum to be used */
    protected void setEnum(FilteredTermEnum enum) {
        this.enum = enum;
	this.query = null;
    }

This will clear the cache query out on each reset.

I have tested this patch and it correctly produces the search results when using
multiple indexes.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>