Grant Ingersoll said:
You should be able to do inclusive/exclusive ranges using the query parser by
mixing matching brackets [] and braces {}.
See http://lucene.apache.org/java/2_9_1/queryparsersyntax.html#Range%20Searches

Hi Grant,

Thanks for your answer, but my problem is not that how to query, but the content of facet list. The list's numbers are only true if we use [date1 TO date2] in query.
If we use {date1 TO date2} in query, the number of results will be wrong.
What is the wrong with that? I should display dates in facet list as following:

publication date
1000-1100 (3)
1100-1200 (3)
1200-1300 (12)
...
as you can see here, the dates are duplicated, the 'to' date wil be the next 'from' date.

However it would be more elegant to display something like that:

publication date
1000-1099 (2)
1100-1199 (1)
1200-1299 (14)

It would involve, that
<lst name="facet_dates">
<lst name="date_df">
<int name="1000-01-01T00:00:00Z">3</int>
<int name="1100-01-01T00:00:00Z">3</int>
<int name="1200-01-01T00:00:00Z">12</int>
..
should be understand, that between 1000-01-01T00:00:00Z
and 1100-01-01T00:00:00Z minus 1 sec (or millisec) there are 3 results.

Grant, from your answer it is clear, that currently no way for the date facets to
behave like this, but I guess, that it may be an alternative solution.

Péter

Reply via email to