I'm new to elasticsearch and lucene and am rather confused on a couple of
points.
First when creating a mapping what does the option "index" with either a
value of "analyzed" or "not_analyzed" do? How does it affect the index.
Next I have the following mapping. Below are just the properties
{
'path': {
"type": "multi_field",
"fields": {
"path": {"type": "string", "index": "not_analyzed"},
"sub_path": {"type": "string", "index": "not_analyzed"},
"name": {"type": "string", "index": "not_analyzed"},
"extension": {"type": "string", "index": "not_analyzed"},
},
},
'owner': {
"type": "multi_field",
"fields": {
"owner": {"type": "integer", "index": "analyzed"},
"name": {"type": "string", "index": "not_analyzed"},
},
},
'data_store': {
"type": "integer",
"index": "analyzed",
},
'size': {
"type": "integer",
"index": "analyzed",
},
'sharing': {
"type": "object",
"properties": {
"name": {"type": "string", "index": "not_analyzed"},
"id": {"type": "integer", "index": "analyzed"},
"permission": {"type": "integer", "index": "analyzed"},
},
},
}
When I try to sort on path or path.sub_path it throws an error saying,
"java.io.IOException: Can't sort on string types with more than one value
per doc, or more than one token per field"
path.sub_path is an array of strings but path is just a string. I don't
understand what I'm doing wrong. If I try to sort on size it doesn't throw
an error but doesn't sort it either.
My sort looks like
[{"size": {"order": "desc"},},] <--- Doesn't throw an error but doesn't sort
either
[{"path": {"order":"desc"},},] <--- Causes the error to be thrown
Any advice or help is appreciated. I've tried reading the docs but I feel
like I'm missing some foundational pieces that would explain this. So if
there are any blog posts or articles covering basics/foundations that
someone can point me to I would appreciate it.
Thanks,
Nathan