Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when mapping a uuid cassandra type #53

Closed
mmoslares opened this issue Oct 13, 2016 · 1 comment
Closed

Error when mapping a uuid cassandra type #53

mmoslares opened this issue Oct 13, 2016 · 1 comment

Comments

@mmoslares
Copy link

Hello, I am testing elassandra as a solution because (great job by the way!) I needs analitics in my product (I am currently using cassanda 3, but I am testing elassandra and will migrate to it when the support on cassandra 3 is released).

I am having issues creating an index over a table with timeuuid/uuid column type. Here is what I am doing so far:

CREATE KEYSPACE IF NOT EXISTS tenantsdatabase WITH replication={ 'class':'NetworkTopologyStrategy', 'dc1':'1' };

CREATE TABLE IF NOT EXISTS tenantsdatabase.forms (
    tenantid varchar,
    relieveid timeuuid, 
    formcontent varchar,
PRIMARY KEY ((tenantid), relieveid));


http://xxx.xxx.xxx.xxx:9200/forms_index

{
   "settings" : { "keyspace" : "tenantsdatabase" },
   "mappings" : {
      "forms" : {
           "discover":".*",
           "properties" : {
              "tenantid" : { "type": "string", "index": "no" },
              "relieveid" : { "type": "string", "index": "analyzed" },
              "formcontent" : { "type" : "string", "index" : "analyzed" }
            }

      }
   }
}


GET http://xxx.xxx.xxx.xxx:9200/forms_index

The problem seems to be the mapping from string to uuid because when I change the type of the table from
relieveid timeuuid
to
relieveid varchar
the index works ok.

My question is: is possible to map a timeuuid/uuid cassandra type in an elastic index? I'm doing something wrong?

(Sorry about my english)

@vroyer
Copy link
Collaborator

vroyer commented Oct 13, 2016

Java UUID id not supported by lucene (nor by elasticsearch), so the only way is to index UUID as string.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants