I am using lucene to search date ranges. I want to know how should I take date to index it. When I want to index it in all 开发者_StackOverflow中文版resolution ie. Year,Month,Day,Hour,Minute,second,Millisecond
The data you're indexing provides time information up to the Millisecond? The only sort of data that I can think of that provides that sort of precise information is something like a list of benchmarking results or maybe you're searching through best times of an auto race or something.
At this point I don't think you should use Lucene if you're only looking to search date ranges. A relational database performs quite well for this.
You can still keep Lucene for full-text search stuff, and use something else for date ranges (MySQL).
Here's just a reference from Lucene's site:
In a query form, fields which are general text should use the query parser. All others, such as date ranges, keywords, etc. are better added directly through the query API.
精彩评论