elasticsearch-2.0

Elasticsearch insensitive search accents

≯℡__Kan透↙ 提交于 2020-12-13 11:52:06
问题 I'm using Elastic search with Python. I can't find a way to make insensitive search with accents. For example: I have two words. " Camión " and " Camion ". When a user search for "camion" I'd like the two results show up. Creating index: es = Elasticsearch([{u'host': u'127.0.0.1', u'port': b'9200'}]) es.indices.create(index='name', ignore=400) es.index( index="name", doc_type="producto", id=p.pk, body={ 'title': p.titulo, 'slug': p.slug, 'summary': p.summary, 'description': p.description,

elasticsearch what is the difference between best_field and most_field

旧时模样 提交于 2020-05-26 12:03:47
问题 I already ready this article https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html but couldn't figure it out myself. lets have these two queries: first GET blablabla/_search { "query": { "multi_match": { "query": "games usa", "fields": ["title1", "title2"], "type": "best_fields" } } } second get blablabla/_search { "query" : { "multi_match": { "query": "games usa", "fields": ["title1", "title2"], "type": "most_fields" } } } I think the first query

Elastic search 2.0 search like query

丶灬走出姿态 提交于 2020-05-17 06:01:12
问题 This is my model: [ElasticsearchType(Name = "projectmodel")] public class ProjectModel { public string name { get; set; } public string description { get; set; } [Nested] [JsonProperty("taskmodels")] public List<TaskModel> taskmodels { get; set; } } public class TaskModel { public string title { get; set; } public string description { get; set; } } I use the following code for search inside the main object and nested object. var searchResults = client.Search<ProjectModel>( body => body.Query(

Tools to migrate index from elasticsearch 1.x to elasticsearch 2.x

风格不统一 提交于 2020-01-26 03:11:05
问题 I am looking for the tools to migrate data from 1.x to 2.x elasticsearch. Please suggest if anything is available? 回答1: You have a few options. You can use Logstash in order to copy indices from your old 1.x ES to your new 2.x ES: input { elasticsearch { hosts => ["old-es:9200"] <--- source ES host index => "source_index" <--- source index to copy docinfo => true } } filter { mutate { remove_field => [ "@version", "@timestamp" ] <--- remove added junk } } output { elasticsearch { hosts => [

How to write mappings in elsaticsearch for geopoint having lat lon and alt?

你离开我真会死。 提交于 2020-01-25 18:44:46
问题 My_Json_File { "addressInfo": { "city": "Wimsheim", "postcode": "71299", "geopoint": { "lon": 48.845877, "lat": 8.821861, "alt": 0.0 } }, "_id": "ac169008-aa5b-4b09-aa9e-3bf3018f316d" } Pls give suggestion on how encounter this "alt" field in geopoint and "_id" field and also write a suitable mappings for above JSON file. Update 1 My_Json_File { "_id": "ac169008-aa5b-4b09-aa9e-3bf3018f316d" "addressInfo": { "city": "Wimsheim", "postcode": "71299", "geopoint": { "lon": 48.845877, "lat": 8

Looking for Elasticsearch updateByQuery syntax example (Node driver)

喜欢而已 提交于 2020-01-10 03:50:07
问题 You have an Elasticsearch index with two docs: [ { "_index": "myIndex", "_type": "myType", "_id": "es1472002807930", "_source": { "animal": "turtle", "color": "green", "weight": 20, } }, { "_index": "myIndex", "_type": "myType", "_id": "es1472002809463", "_source": { "animal": "bear", "color": "brown" "weight": 400, } } ] Later, you get this updated data about the bear: { "color": "pink", "weight": 500, "diet": "omnivore", } So, you want to update the "color" and "weight" values of the bear,

ElasticSearch query using NEST 2.x with scroll is not returning result

非 Y 不嫁゛ 提交于 2020-01-06 16:22:53
问题 I'm trying to retrieve all data from the elasticsearch based on a message occurrence, i figured that if i used Scroll i could loop until the document search end but the following query returns Documents = 0 but Total = 1954: var response = client.Search<Log4Net>(s => s .Query(q => q.QueryString(qs => qs .DefaultField(m => m.Message).Query("\"" + message + "\""))) .SearchType(SearchType.Scan) .Scroll("60s")); while (response.Documents.Any()) { var request = new BulkRequest(); request.Refresh =

ElasticSearch query using NEST 2.x with scroll is not returning result

倾然丶 夕夏残阳落幕 提交于 2020-01-06 16:22:07
问题 I'm trying to retrieve all data from the elasticsearch based on a message occurrence, i figured that if i used Scroll i could loop until the document search end but the following query returns Documents = 0 but Total = 1954: var response = client.Search<Log4Net>(s => s .Query(q => q.QueryString(qs => qs .DefaultField(m => m.Message).Query("\"" + message + "\""))) .SearchType(SearchType.Scan) .Scroll("60s")); while (response.Documents.Any()) { var request = new BulkRequest(); request.Refresh =

Elasticsearch 2.4, Exists filter for nested objects not working

你离开我真会死。 提交于 2020-01-02 08:52:36
问题 My mapping is: "properties": { "user": { "type": "nested", "properties": { "id": { "type": "integer" }, "is_active": { "type": "boolean", "null_value": false }, "username": { "type": "string" } } }, I want to get all documents that do not have a user field. I tried: GET /index/type/_search { "query": { "bool": { "must_not": [ { "exists": { "field": "user" } } ] } } } Which returns all documents. Based on ElasticSearch 2.x exists filter for nested field doesn't work, I also tried: GET /index