pretty sure this mapping is going to work
This commit is contained in:
parent
4a2f27d5f6
commit
7db91e6053
1 changed files with 19 additions and 17 deletions
|
@ -2,7 +2,7 @@ class ElasticSearchHelper
|
|||
attr_accessor :server_uri, :index, :pastebinner, :doctype
|
||||
DEFAULT_METHOD = :post
|
||||
|
||||
def initialize(server_uri, index, doctype='_doc')
|
||||
def initialize(server_uri, index, doctype='paste')
|
||||
@server_uri = server_uri
|
||||
@index = index
|
||||
@doctype = doctype
|
||||
|
@ -21,19 +21,21 @@ class ElasticSearchHelper
|
|||
def mappings
|
||||
{
|
||||
"mappings": {
|
||||
"_doc": {
|
||||
"paste": {
|
||||
"properties": {
|
||||
"paste_metadata": { "type": "nested" }
|
||||
"paste_metadata": {
|
||||
"type": "nested",
|
||||
"properties": {
|
||||
"scrape_url": { "type": "string" },
|
||||
"full_url": { "type": "string" },
|
||||
"date": { "type": "string" },
|
||||
"size": { "type": "string" },
|
||||
"expire": { "type": "string" },
|
||||
"title": { "type": "string" },
|
||||
"syntax": { "type": "string" },
|
||||
"user": { "type": "string" },
|
||||
"hits": { "type": "string" }
|
||||
"scrape_url": { "type": "text" },
|
||||
"full_url": { "type": "text" },
|
||||
"date": { "type": "text" },
|
||||
"size": { "type": "text" },
|
||||
"expire": { "type": "text" },
|
||||
"title": { "type": "text" },
|
||||
"syntax": { "type": "text" },
|
||||
"user": { "type": "text" },
|
||||
"hits": { "type": "integer" }
|
||||
}
|
||||
},
|
||||
"paste_text": { "type": "text" }
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue