lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <>
Subject [jira] [Updated] (LUCENE-3273) Convert Lucene Core tests over to a simple MockQueryParser
Date Mon, 04 Jul 2011 18:52:21 GMT


Robert Muir updated LUCENE-3273:

    Attachment: LUCENE-3273_testboolean2.patch

here's my example, TestBoolean2.

in my opinion building the queries like this makes the test much more readable.

it adds 48 lines and deletes 29 lines of code... 

I think adding these 19 lines of code to this 343 line test case is worth every penny, because
its much easier to see what any given test does, e.g. just glance real quick at testQueries06
and you see its a BQ with one MUST and two MUST_NOTS, no parsing by the brain required.

> Convert Lucene Core tests over to a simple MockQueryParser
> ----------------------------------------------------------
>                 Key: LUCENE-3273
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Sub-task
>          Components: core/other
>            Reporter: Chris Male
>         Attachments: LUCENE-3273.patch, LUCENE-3273_testboolean2.patch
> Most tests use Lucene Core's QueryParser for convenience.  We want to consolidate it
into a QP module which we can't have as a dependency.  We should add a simple MockQueryParser
which does String.split() on the query string, analyzers the terms and builds a BooleanQuery
if necessary.  Any more complex Queries (such as phrases) should be done programmatically.

This message is automatically generated by JIRA.
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message