简体   繁体   中英

DSE Solr date range query for String date 'yyyymmdd' & integer hour

I'm using Datastax Solr version 4.8. I've column with string values of date in 'yyyymmdd' format and another column with int values of hour. Now the requirement is to fetch all the records say from yyyymmdd - '20161110' to '20161130' and from hour 21 to 15 .

Is there any way to get this search using DSE Solr?

I would suggest you to use a copy copy field with that string date as the source and a date field as the destination. Once your string date has been converted into an actual proper date you can query it like a normal date 'AND' the hour into the query. Hope it helps.

最后,我最终添加了timestamp列以获得日期范围查询结果。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM