lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 12667] - MultiSearcher does not work with MultiTermQuery or PrefixQuery
Date Tue, 17 Sep 2002 23:12:16 GMT
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:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message