{"action":"created","issue":{"url":"https://api.github.com/repos/Stratio/cassandra-lucene-index/issues/56","labels_url":"https://api.github.com/repos/Stratio/cassandra-lucene-index/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/Stratio/cassandra-lucene-index/issues/56/comments","events_url":"https://api.github.com/repos/Stratio/cassandra-lucene-index/issues/56/events","html_url":"https://github.com/Stratio/cassandra-lucene-index/issues/56","id":114009184,"number":56,"title":"Are miliseconds supported in range filters concerning date fields?","user":{"login":"dejwsz","id":5338748,"avatar_url":"https://avatars.githubusercontent.com/u/5338748?v=3","gravatar_id":"","url":"https://api.github.com/users/dejwsz","html_url":"https://github.com/dejwsz","followers_url":"https://api.github.com/users/dejwsz/followers","following_url":"https://api.github.com/users/dejwsz/following{/other_user}","gists_url":"https://api.github.com/users/dejwsz/gists{/gist_id}","starred_url":"https://api.github.com/users/dejwsz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dejwsz/subscriptions","organizations_url":"https://api.github.com/users/dejwsz/orgs","repos_url":"https://api.github.com/users/dejwsz/repos","events_url":"https://api.github.com/users/dejwsz/events{/privacy}","received_events_url":"https://api.github.com/users/dejwsz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-29T09:16:59Z","updated_at":"2015-10-29T10:59:28Z","closed_at":null,"body":"Hi, as I can see the mapping for date field supports such pattern: yyyy/MM/dd HH:mm:ss.SSS Z. So in theory milliseconds (SSS) should be supported. \r\nWhen I use range filter it looks like the milliseconds are not taken under consideration. So in case of use of such a filter:\r\n{type:\"range\", field:\"modifytime\", lower:\"2015-10-27 14:05:39.798\"} I can get only these rows which modify time is lower from 2015-10-27 14:05:39.000 (798 ms is considered as 000). Are milliseconds really supported?"},"comment":{"url":"https://api.github.com/repos/Stratio/cassandra-lucene-index/issues/comments/152146853","html_url":"https://github.com/Stratio/cassandra-lucene-index/issues/56#issuecomment-152146853","issue_url":"https://api.github.com/repos/Stratio/cassandra-lucene-index/issues/56","id":152146853,"user":{"login":"ealonsodb","id":11426807,"avatar_url":"https://avatars.githubusercontent.com/u/11426807?v=3","gravatar_id":"","url":"https://api.github.com/users/ealonsodb","html_url":"https://github.com/ealonsodb","followers_url":"https://api.github.com/users/ealonsodb/followers","following_url":"https://api.github.com/users/ealonsodb/following{/other_user}","gists_url":"https://api.github.com/users/ealonsodb/gists{/gist_id}","starred_url":"https://api.github.com/users/ealonsodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ealonsodb/subscriptions","organizations_url":"https://api.github.com/users/ealonsodb/orgs","repos_url":"https://api.github.com/users/ealonsodb/repos","events_url":"https://api.github.com/users/ealonsodb/events{/privacy}","received_events_url":"https://api.github.com/users/ealonsodb/received_events","type":"User","site_admin":false},"created_at":"2015-10-29T10:59:28Z","updated_at":"2015-10-29T10:59:28Z","body":"Hi @dejwsz , \r\nYes, milliseconds are supported in range filters. \r\nBy deafult Range query does not include lower or upper bounding\r\n\r\nYou must set ``include_lower``  to true in order to get results including \"2015-10-27 14:05:39.798\".\r\n\r\nI have executed this simple example and it works ok.\r\n\r\n```\r\n\r\nCREATE KEYSPACE test \r\n     WITH replication = {'class':'SimpleStrategy', 'replication_factor': 1};\r\nUSE test;\r\n\r\nCREATE TABLE test1 (\r\n\tid int,\r\n\tdate timestamp,\r\n\tlucene text,\r\n\tPRIMARY KEY (id)\r\n);\r\n\r\nCREATE CUSTOM INDEX test_index ON test.test1(lucene)\r\nUSING 'com.stratio.cassandra.lucene.Index'\r\nWITH OPTIONS = {\r\n    'refresh_seconds' : '1',\r\n    'schema' : '{\r\n        fields : {\r\n            date : {type:\"date\"}\r\n    }}'\r\n};\r\n\r\nINSERT into test.test1(id, date) VALUES (1, '2015-10-27 14:05:39.798');\r\n\r\nSELECT * FROM test.test1 \r\n    WHERE lucene='{type:\"range\", field:\"date\", \r\n                                 lower:\"2015-10-27 14:05:39.798\", \r\n                                 include_lower:true}';\r\n\r\n```\r\n\r\nIn addition to that, if you want use the default pattern for dates \"yyyy/MM/dd HH:mm:ss.SSS Z\" please be aware that  'Z' is time zone. \r\nInstead, if you want to use \"yyyy/MM/dd HH:mm:ss.SSS\" set it in the mapper so:\r\n\r\n```\r\n\r\n\r\nCREATE CUSTOM INDEX test_index ON test.test1(lucene)\r\nUSING 'com.stratio.cassandra.lucene.Index'\r\nWITH OPTIONS = {\r\n    'refresh_seconds' : '1',\r\n    'schema' : '{\r\n        fields : {\r\n            date : {type:\"date\", pattern:\"yyyy/MM/dd HH:mm:ss.SSS\"}\r\n    }}'\r\n};\r\n\r\n```\r\n\r\n\r\n"}}