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

http://issues.apache.org/bugzilla/show_bug.cgi?id=33449





------- Additional Comments From [EMAIL PROTECTED]  2005-02-08 20:46 -------
Created an attachment (id=14212)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=14212&action=view)
Adds a QueryFactory interface and refactors code to use it

This patch adds a org.apache.lucene.search.QueryFactory interface and refactors
the Lucene code to use it.  It has 3 implementations included:

* org.apache.lucene.search.queryfactory.QueryFactoryImpl is an implementation
created by extracting the QueryParser code for Query construction
* org.apache.lucene.search.queryfactory.LowerCaseQueryFactory is a decorator
implementation that will convert all terms to lowercase
* org.apache.lucene.search.queryfactory.MultiFieldQueryFactory is an
implementation created by extracting the MultiFieldQueryParser code for Query
construction

Note that for some reason that I can't quite fathom at the moment this patch
seems to be rejected for the SearchTestForDuplicates code.  To fix this you'll
need to manually edit this file and change the construction of the QueryParser
implementations to take a QueryFactoryImpl instance, i.e.

new QueryParser(PRIORITY_FIELD, analyzer, new QueryFactoryImpl())

I have added unit-tests for the QueryFactory implementations as best I could
and changed one or two tests in the TestQueryParser unit-test because of the
introduction of the LowerCaseQueryFactory.  Because I have added these
unit-tests they rely on the MockObjects (http://www.mockobjects.com/) JAR file
(specifically I have used mockobjects-core-0.09.jar) which I have not included
in the patch but will attach here for download if so required.

Please also note that some of the API in QueryParser has moved into the
QueryFactoryImpl class as it seemed to be needed there more than in the
QueryParser itself, although that is not what I'm necessarily suggesting as a
change.  So you might find your code breaks which I apologise for!

Hopefully that's everything!

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to