elasticsearch-6

Elasticsearch - multi_match does not work on nested fields

六月ゝ 毕业季﹏ 提交于 2019-12-24 09:44:52
问题 I have records that can have multiple translations for a single text fields, e.g.: { "type": "movie", "title": { "en": "Dark Knight", "de": "Der dunkle Ritter" } } To represent these records I've created the following index: { "mappings": { "_doc": { "properties": { "type": { "type": "text", "analyzer": "english" }, "title": { "type": "nested", "properties": { "de": { "type": "text", "analyzer": "german" }, "en": { "type": "text", "analyzer": "english" } } } } } } } But when I try to use

How to exclude a field from getting searched by elasticsearch 6.1?

五迷三道 提交于 2019-12-19 10:38:09
问题 I have an index with multiple fields in it. I want to filter out based on presence of search string in all the fields except one - user_comments . The query search that I am doing is { "from": offset, "size": limit, "_source": [ "document_title" ], "query": { "function_score": { "query": { "bool": { "must": { "query_string": { "query": "#{query}" } } } } } } } Although the query string is searching through all the fields, and giving me documents with matching string in the user_comments field

How to convert binary data back to a float array in Elasticsearch/painless

只愿长相守 提交于 2019-12-11 17:16:39
问题 I am trying to efficiently store and retrieve an array of floats in elasticsearch 6.7. Numeroc doc values are sorted, which means I can't use them directly. At first I was using the source value of the field, but the performance on a large query is not great. I tried to encode the float array as binary and decode it inside my script. Unfortunately I'm stuck at converting a byte[4] array to a float in painless . In Java this would look like this Float.intBitsToFloat((vector_bytes[3] << 24) | (

Unable to create visualization using curl command in elaticearch

与世无争的帅哥 提交于 2019-12-11 16:59:17
问题 I am trying to create visualization using curl command. I am using elasticsearch 6.2.3. I am able to create the same in elasticsearch 5.6.8. I am using this command curl -XPUT http://localhost:9200/.kibana/visualization/vis1 -H 'Content-Type: application/json' -d @vis1.json It is showing this error : {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Rejecting mapping update to [.kibana] as the final mapping would have more than 1 type: [visualization, doc]"}],"type":

How to implement suggest completion with NEST 6.1.0?

橙三吉。 提交于 2019-12-11 15:48:40
问题 So far I have this (for indexing): var createIndexResponse = await elasticClient.CreateIndexAsync(indexName, c => c .InitializeUsing(indexConfig) .Mappings(m => m .Map<ElasticsearchModel>(mm => mm .Properties( p => p .Completion(cp => cp .Name(elasticsearchModel => elasticsearchModel.StringTest) .Analyzer("simple") .SearchAnalyzer("simple") ) .Text(t => t.Name(elasticsearchModel => elasticsearchModel.StringTest).Analyzer("customAnalyzerLowercaseSynonymAsciifolding")) ) ) ) ); I got to this

How to filter by the size of an array in nested type?

戏子无情 提交于 2019-12-11 11:29:28
问题 Let's say I have the following type: { "2019-11-04": { "mappings": { "_doc": { "properties": { "labels": { "type": "nested", "properties": { "confidence": { "type": "float" }, "created_at": { "type": "date", "format": "strict_date_optional_time||date_time||epoch_millis" }, "label": { "type": "keyword" }, "updated_at": { "type": "date", "format": "strict_date_optional_time||date_time||epoch_millis" }, "value": { "type": "keyword", "fields": { "numeric": { "type": "float", "ignore_malformed":

Elasticsearch 6.0.1 NoSuchFieldError: LUCENE_6_0_0

流过昼夜 提交于 2019-12-10 17:13:03
问题 I am using elasticsearch 6.0.1 and on BulkRequest request = new BulkRequest(); I am getting the below error. I have checked online, mostly people said that this happens if I have different versions of lucene jars in the classpath. java.lang.NoSuchFieldError: LUCENE_6_0_0 at org.elasticsearch.Version.<clinit>(Version.java:44) at org.elasticsearch.common.logging.DeprecationLogger.<clinit>(DeprecationLogger.java:159) at org.elasticsearch.action.bulk.BulkRequest.<clinit>(BulkRequest.java:67) at

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

元气小坏坏 提交于 2019-12-03 06:26:01
问题 When type is declared as string , Elasticsearch 6.0 will show this error. "name" => [ "type" => "string", "analyzer" => "ik_max_word" ] 回答1: 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

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

How to exclude a field from getting searched by elasticsearch 6.1?

巧了我就是萌 提交于 2019-12-01 11:03:45
I have an index with multiple fields in it. I want to filter out based on presence of search string in all the fields except one - user_comments . The query search that I am doing is { "from": offset, "size": limit, "_source": [ "document_title" ], "query": { "function_score": { "query": { "bool": { "must": { "query_string": { "query": "#{query}" } } } } } } } Although the query string is searching through all the fields, and giving me documents with matching string in the user_comments field as well. But, I want to query it against all the fields leaving out the user_comments field. The white