{"action":"closed","issue":{"url":"https://api.github.com/repos/Stratio/cassandra-lucene-index/issues/158","repository_url":"https://api.github.com/repos/Stratio/cassandra-lucene-index","labels_url":"https://api.github.com/repos/Stratio/cassandra-lucene-index/issues/158/labels{/name}","comments_url":"https://api.github.com/repos/Stratio/cassandra-lucene-index/issues/158/comments","events_url":"https://api.github.com/repos/Stratio/cassandra-lucene-index/issues/158/events","html_url":"https://github.com/Stratio/cassandra-lucene-index/issues/158","id":161555483,"number":158,"title":"CQL \"date\" type: No results","user":{"login":"wasifaleem","id":7237122,"avatar_url":"https://avatars.githubusercontent.com/u/7237122?v=3","gravatar_id":"","url":"https://api.github.com/users/wasifaleem","html_url":"https://github.com/wasifaleem","followers_url":"https://api.github.com/users/wasifaleem/followers","following_url":"https://api.github.com/users/wasifaleem/following{/other_user}","gists_url":"https://api.github.com/users/wasifaleem/gists{/gist_id}","starred_url":"https://api.github.com/users/wasifaleem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wasifaleem/subscriptions","organizations_url":"https://api.github.com/users/wasifaleem/orgs","repos_url":"https://api.github.com/users/wasifaleem/repos","events_url":"https://api.github.com/users/wasifaleem/events{/privacy}","received_events_url":"https://api.github.com/users/wasifaleem/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Stratio/cassandra-lucene-index/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-06-21T22:34:46Z","updated_at":"2016-07-18T13:19:29Z","closed_at":"2016-07-18T13:19:29Z","body":"Hi.\r\n\r\nI am testing out a simplistic use case of indexing date fields, but I ran into a problem.\r\n\r\nConsider the following example schema.\r\n\r\n```cql\r\nCREATE KEYSPACE IF NOT EXISTS test_date WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};\r\n\r\nCREATE TABLE test_date.test (\r\n  id text PRIMARY KEY,\r\n  dob date,\r\n  lucene text\r\n);\r\n\r\nCREATE CUSTOM INDEX test_date_index ON test_date.test (lucene)\r\nUSING 'com.stratio.cassandra.lucene.Index'\r\nWITH OPTIONS = {\r\n'refresh_seconds' : '1',\r\n'schema' : '{\r\n        fields : {\r\n            id    : {type : \"string\"},\r\n            dob     : {type : \"date\", pattern : \"yyyy-MM-dd\"}\r\n        }\r\n    }'\r\n};\r\n```\r\n\r\nThe corresponding data and query:\r\n\r\n```cql\r\nINSERT INTO test_date.test (id, dob) VALUES ( 'unique_id', '2015-10-10');\r\n\r\nSELECT * FROM test_date.test\r\nWHERE lucene = '{filter : {\r\n                       type  : \"match\",\r\n                       field : \"dob\",\r\n                       value : \"2015-10-10\" }}';\r\n\r\n id | dob | lucene\r\n----+-----+--------\r\n\r\n(0 rows)\r\n```\r\nThe log file contains an error event\r\n```log\r\nINFO  [MemtablePostFlush:82] 2016-06-21 17:21:48,605 Index.java:239 - Flushed Lucene index test_date.test.test_date_index\r\nERROR [SharedPool-Worker-2] 2016-06-21 17:22:12,120 Schema.java:140 - Error in Lucene index:\r\n        while mapping : Columns{id=unique_id, dob=-2147466930}\r\n        with mapper   : DateMapper{field=dob, indexed=true, sorted=false, validated=false, column=dob, pattern=yyyy-MM-dd}\r\n        caused by     : Required positive Integer for dates but found '-2147466930'\r\n(END)\r\n\r\n```\r\n\r\n\r\nIf I do the same, but with CQL type \"timestamp\", I do get proper results.\r\nI am on versions 2.2.4 and 2.2.6."}}
{"actor":{"display_login":"ealonsodb"}}