lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vinicius Barros (JIRA)" <>
Subject [jira] [Commented] (LUCENE-1768) NumericRange support for new query parser
Date Mon, 28 Mar 2011 05:08:05 GMT


Vinicius Barros commented on LUCENE-1768:

Hi Uwe and Adriano, 

I read the description, javadocs about the numeric support and the new query parser and all
the comments here. Let me try to summarize what needs to be done here:

-figure out a way to configure in query parser which fields are numeric, and for each of these
fields, the numeric type must also be defined...from the comments, it seems the best way to
do this is using a map field->NumericType

-create a NumericQueryNodeProcessor that converts ParametricRangeQueryNode to NumericRangeQueryNode,
when its field is a numeric field. This processor should also convert the range string values
to numeric values based on the NumericType

-create a NumericRangeQueryNodeBuilder, which will build which will build NumericRangeQuery
objects from NumericRangeQueryNode objects

-rename RangeQueryNode to TermRangeQueryNode as it will only be used for string

-create a NumericRangeQueryNode which will be used for any non-string range query

-merge DateTools with a new NumericTools class. Does that make sense? I am not sure if I got
everything correctly here.

Some questions below:

create the new NumericRangeQueryNode that extends from TermRangeQueryNode

-should NumericRangeQueryNode extends TermRangeQueryNode? I don't see any reason for that,
since one will hold Number values and the other String values

-I remember the old date query, using strings, used to not only allow range queries, but also
term queries (date:2010/10/10), is that correct? Does numeric fields also support this kind
of query? I could only fine NumericRangeQuery, but no NumericQuery. If the user enters (age:19)
in the query, and "age" is a numeric field, should the query parser throw an error saying
it's not suppported?

I am planning to create a GSOC proposal for this project, it looks interesting, very cool
this new support to numeric in Lucene, I missed that first time I used Lucene, maybe because
I was used to regular databases. Also, the query parser uses some design patterns I have been
reading about lately, as builders and processors. 

> NumericRange support for new query parser
> -----------------------------------------
>                 Key: LUCENE-1768
>                 URL:
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: QueryParser
>    Affects Versions: 2.9
>            Reporter: Uwe Schindler
>            Assignee: Adriano Crestani
>              Labels: contrib, gsoc, gsoc2011, lucene-gsoc-11, mentor
>             Fix For: 4.0
> It would be good to specify some type of "schema" for the query parser in future, to
automatically create NumericRangeQuery for different numeric types? It would then be possible
to index a numeric value (double,float,long,int) using NumericField and then the query parser
knows, which type of field this is and so it correctly creates a NumericRangeQuery for strings
like "[1.567..*]" or "(1.787..19.5]".
> There is currently no way to extract if a field is numeric from the index, so the user
will have to configure the FieldConfig objects in the ConfigHandler. But if this is done,
it will not be that difficult to implement the rest.
> The only difference between the current handling of RangeQuery is then the instantiation
of the correct Query type and conversion of the entered numeric values (simple Number.valueOf(...)
cast of the user entered numbers). Evenerything else is identical, NumericRangeQuery also
supports the MTQ rewrite modes (as it is a MTQ).
> Another thing is a change in Date semantics. There are some strange flags in the current
parser that tells it how to handle dates.

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