Skip to content

Instantly share code, notes, and snippets.

@marklin-latte
Created November 18, 2014 01:58
Show Gist options
  • Save marklin-latte/f53b5ad092e5e5c6be50 to your computer and use it in GitHub Desktop.
Save marklin-latte/f53b5ad092e5e5c6be50 to your computer and use it in GitHub Desktop.
ElasticSearch-search index mapping
//URI
GET http://localhost:9200/test1/_mapping
(test1 is index)
//Result
{
"test1": {
"mappings": {
"attachment": {
"properties": {
"documentId": {
"type": "string"
},
"file": {
"type": "attachment",
"path": "full",
"fields": {
"file": {
"type": "string",
"store": true,
"term_vector": "with_positions_offsets"
},
"author": {
"type": "string"
},
"title": {
"type": "string",
"store": true
},
"name": {
"type": "string"
},
"date": {
"type": "date",
"format": "dateOptionalTime"
},
"keywords": {
"type": "string"
},
"content_type": {
"type": "string"
},
"content_length": {
"type": "integer"
},
"language": {
"type": "string"
}
}
},
"organizeId": {
"type": "string"
},
"projectId": {
"type": "string"
}
}
}
}
}
}
type attachment is a plugin , it can parse office file or pdf file ,
and you can search file content !
https://github.com/elasticsearch/elasticsearch-mapper-attachments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment