Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
Hi,
this may be useful for the documentation.
Here are some simple steps for creating an elasticsearch index.
% curl -XPUT 'http://localhost:9200/manifoldcf' % curl -XPUT 'http://localhost:9200/manifoldcf/attachment/_mapping' -d ' { "attachment" : { "_source" : { "excludes" : [ "file" ] }, "properties": { "allow_token_document" : { "type" : "string" }, "allow_token_parent" : { "type" : "string" }, "allow_token_share" : { "type" : "string" }, "attributes" : { "type" : "string" }, "createdOn" : { "type" : "string" }, "deny_token_document" : { "type" : "string" }, "deny_token_parent" : { "type" : "string" }, "deny_token_share" : { "type" : "string" }, "lastModified" : { "type" : "string" }, "shareName" : { "type" : "string" }, "file" : { "type" : "attachment", "path" : "full", "fields" : { "file" : { "store" : true, "term_vector" : "with_positions_offsets", "type" : "string" } } } } } }'
This creates an index called manifoldcf with a mapping named attachment which has some generic fields for access tokens and a field file which makes use of the elasticsearch attachment mapper plugin. It is configured for highlighting ("term_vector" : "with_positions_offsets").
The following part is useful for not saving the source json on the index which reduces the index size significantly. Be aware that you shouldn't do this if you need to re-index data on the elasticsearch side or you want access to the whole document.
"_source" : { "excludes" : [ "file" ] },