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
|
attr_accessor :server_uri, :index, :pastebinner, :doctype
|
||||||
DEFAULT_METHOD = :post
|
DEFAULT_METHOD = :post
|
||||||
|
|
||||||
def initialize(server_uri, index, doctype='_doc')
|
def initialize(server_uri, index, doctype='paste')
|
||||||
@server_uri = server_uri
|
@server_uri = server_uri
|
||||||
@index = index
|
@index = index
|
||||||
@doctype = doctype
|
@doctype = doctype
|
||||||
|
@ -20,22 +20,24 @@ class ElasticSearchHelper
|
||||||
|
|
||||||
def mappings
|
def mappings
|
||||||
{
|
{
|
||||||
"mappings": {
|
"mappings": {
|
||||||
"_doc": {
|
"paste": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"paste_metadata": { "type": "nested" }
|
"paste_metadata": {
|
||||||
"properties": {
|
"type": "nested",
|
||||||
"scrape_url": { "type": "string" },
|
"properties": {
|
||||||
"full_url": { "type": "string" },
|
"scrape_url": { "type": "text" },
|
||||||
"date": { "type": "string" },
|
"full_url": { "type": "text" },
|
||||||
"size": { "type": "string" },
|
"date": { "type": "text" },
|
||||||
"expire": { "type": "string" },
|
"size": { "type": "text" },
|
||||||
"title": { "type": "string" },
|
"expire": { "type": "text" },
|
||||||
"syntax": { "type": "string" },
|
"title": { "type": "text" },
|
||||||
"user": { "type": "string" },
|
"syntax": { "type": "text" },
|
||||||
"hits": { "type": "string" }
|
"user": { "type": "text" },
|
||||||
},
|
"hits": { "type": "integer" }
|
||||||
"paste_text": { "type": "text" }
|
}
|
||||||
|
},
|
||||||
|
"paste_text": { "type": "text" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue