elasticsearch-mapping

No handler for type [string] declared on field [name]

五迷三道 提交于 2019-12-02 19:52:46
When type is declared as string , Elasticsearch 6.0 will show this error. "name" => [ "type" => "string", "analyzer" => "ik_max_word" ] Aryeetey Solomon Aryeetey Elasticsearch has dropped the string type and is now using text . So your code should be something like this "name" => [ "type" => "text", "analyzer" => "ik_max_word" ] 来源: https://stackoverflow.com/questions/47452770/no-handler-for-type-string-declared-on-field-name

Store Date Format in elasticsearch

允我心安 提交于 2019-12-02 18:58:05
I met a problem when I want to add one datetime string into Elasticsearch. The document is below: {"LastUpdate" : "2013/07/24 00:00:00"} This document raised an error which is "NumberFormatException" [For input string: \"20130724 00:00:00\"] I know that I can use the Date Format in Elasticsearch, but I don't know how to use even I read the document on the website. {"LastUpdate": { "properties": { "type": "date", "format": "yyyy-MM-dd"} } } and {"LastUpdate": { "type": "date", "format": "yyyy-MM-dd" } } are wrong. How can I transfer the datetime string into date format in Elasticsearch? How can

Edge NGram with phrase matching

☆樱花仙子☆ 提交于 2019-11-30 02:25:14
I need to autocomplete phrases . For example, when I search "dementia in alz" , I want to get "dementia in alzheimer's" . For this, I configured Edge NGram tokenizer . I tried both edge_ngram_analyzer and standard as the analyzer in the query body. Nevertheless, I can't get results when I'm trying to match a phrase. What am I doing wrong? My query: { "query":{ "multi_match":{ "query":"dementia in alz", "type":"phrase", "analyzer":"edge_ngram_analyzer", "fields":["_all"] } } } My mappings: ... "type" : { "_all" : { "analyzer" : "edge_ngram_analyzer", "search_analyzer" : "standard" },

How to store relational data in elasticsearch

半腔热情 提交于 2019-11-29 12:19:30
What are the options to store relational data in elasticsearch. I know the following approaches Nested object :- I don't want to store data in nested format because I want to update the one document without changing the other document and if I use nested object then there will be repetition of child data in parent documents. Parent-child :- I don't want to store data in single index, but for using Parent-child data needs to be present in one index(different types). I know this restriction will be removed in future release as mentioned in https://github.com/elastic/elasticsearch/issues/15613

Edge NGram with phrase matching

倾然丶 夕夏残阳落幕 提交于 2019-11-28 21:40:01
问题 I need to autocomplete phrases. For example, when I search "dementia in alz" , I want to get "dementia in alzheimer's" . For this, I configured Edge NGram tokenizer. I tried both edge_ngram_analyzer and standard as the analyzer in the query body. Nevertheless, I can't get results when I'm trying to match a phrase. What am I doing wrong? My query: { "query":{ "multi_match":{ "query":"dementia in alz", "type":"phrase", "analyzer":"edge_ngram_analyzer", "fields":["_all"] } } } My mappings: ...

How to store relational data in elasticsearch

时光怂恿深爱的人放手 提交于 2019-11-28 06:15:47
问题 What are the options to store relational data in elasticsearch. I know the following approaches Nested object :- I don't want to store data in nested format because I want to update the one document without changing the other document and if I use nested object then there will be repetition of child data in parent documents. Parent-child :- I don't want to store data in single index, but for using Parent-child data needs to be present in one index(different types). I know this restriction

Change default mapping of string to “not analyzed” in Elasticsearch

佐手、 提交于 2019-11-27 03:16:21
In my system, the insertion of data is always done through csv files via logstash. I never pre-define the mapping. But whenever I input a string it is always taken to be analyzed , as a result an entry like hello I am Sinha is split into hello , I , am , Sinha . Is there anyway I could change the default/dynamic mapping of elasticsearch so that all strings, irrespective of index, irrespective of type are taken to be not analyzed ? Or is there a way of setting it in the .conf file? Say my conf file looks like input { file { path => "/home/sagnik/work/logstash-1.4.2/bin/promosms_dec15.csv" type

Change default mapping of string to “not analyzed” in Elasticsearch

倾然丶 夕夏残阳落幕 提交于 2019-11-26 10:28:07
问题 In my system, the insertion of data is always done through csv files via logstash. I never pre-define the mapping. But whenever I input a string it is always taken to be analyzed , as a result an entry like hello I am Sinha is split into hello , I , am , Sinha . Is there anyway I could change the default/dynamic mapping of elasticsearch so that all strings, irrespective of index, irrespective of type are taken to be not analyzed ? Or is there a way of setting it in the .conf file? Say my conf