Mapping for a hash map

2014-06-13 Thread Manuel Vacelet
Hi there,

I'd like to define a mapping for a hash map but I do not manage to get it 
right.
Here is the kind of documents I'd like to index:
{
"message" : "Elasticsearch test 1",
"dates": {
"create": "2014-01-11",
"update": "2014-06-12"
}
}

{
"message" : "Elasticsearch test 2",
"dates": {
"date_1": "2014-01-11",
}
}

Note: date_1 is on purpose, I cannot know at mapping definition how many 
dates I will have to deal with.

As is, without mapping it works automagically (probably thanks to type 
autodetection) but is there a mean to get it done without ?

My problem is that I might have stuff like that too:
{
"message" : "Elasticsearch test 3",
"strings": {
"string_1": "some text",
"string_2": "2014-01-11"
}
}

{
"message" : "Elasticsearch test 4",
"strings": {
"string_2": "some other text"
}
}


In this case I need to be able to enforce that string_2 is not a date 

What is the right way to do it ?
Manuel

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/f45de373-4b57-4550-b9ae-c68d71dcf459%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Index/search with ACLs and parent/child relationship

2014-05-18 Thread Manuel Vacelet
Hi,

I'm struggling with an ES design and I'd like to share with you.

I have a set of different documents stored in ES, those documents can be 
seen only by a set of people.
To address this point, for each document, I have a property 'groups' with 
the list of user groups allowed to access it ('all', 'project_members', 
'designers', etc)
On query, I just have to add the list of groups a user belongs to and tada, 
it works. Great.

Now some of those documents are hierarchically stored, so the permissions 
are.
Pretty much like unix folders: 
- I can have a document that is world readable 
- but as long as this doc is in a folder that is only readable by one user, 
only this user can access the doc.

How can I map this in ES?

I've read 
http://www.elasticsearch.org/blog/managing-relations-inside-elasticsearch
Sounds like parent/child might be a solution but:
- How do I write the query to have permissions applied ?

Thanks for your help;
Manuel

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/bf69d9fe-5cb1-4d2b-bf24-8564b3b643c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.