diff --git a/lib/elastic_search_helper.rb b/lib/elastic_search_helper.rb index 67c2b7e..6f24954 100644 --- a/lib/elastic_search_helper.rb +++ b/lib/elastic_search_helper.rb @@ -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" } } } }