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 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" }
} }
} }
} }