pretty sure this mapping is going to work

This commit is contained in:
booboy 2019-02-02 02:25:50 -06:00
parent 4a2f27d5f6
commit 7db91e6053

View file

@ -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
@ -20,22 +20,24 @@ class ElasticSearchHelper
def mappings
{
"mappings": {
"_doc": {
"properties": {
"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" }
},
"paste_text": { "type": "text" }
"mappings": {
"paste": {
"properties": {
"paste_metadata": {
"type": "nested",
"properties": {
"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" }
}
}
}