Elasticsearch - агрегирование без учета регистра не работаетElasticsearch aggregation

Ответить Пред. темаСлед. тема
Гость
 Elasticsearch - агрегирование без учета регистра не работает

Сообщение Гость »


ES version - 7.17.7

I've an index for which I' running an aggregation to get all field matching certain regex. This should be case-insensitive i.e.

new york should match New York and NEW YORK and New YORK Have added a lowercase_normaliser to index so that documents are indexed with lowercase name. This doesn't solve the issue though. Now I've to pass the regex in lowercase, else it doesn't return correct results.

I've created an index named blah with following mapping

{ "blah": { "mappings": { "properties": { "name": { "type": "text", "fields": { "raw": { "type": "keyword", "normalizer": "lowercase_normalizer" } } } } } } } Index settings -

{ "blah": { "settings": { "index": { "max_ngram_diff": "20", "analysis": { "normalizer": { "lowercase_normalizer": { "filter": [ "lowercase" ], "type": "custom" } } } } } } } Documents inserted:

blah/_doc/1

{ "name": "NEW YORK" } blah/_doc/2

{ "name": "New Orleans" } blah/_doc/3

{ "name": "New Hampshire" } Following aggregation query doesn't return expected results - Query

{ "aggregations": { "autoComplete": { "terms": { "field": "name.raw", "include": "New.*", "order": [ { "_term": "asc" } ] } } }, "size": 0 } Output

"aggregations": { "autoComplete": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ ] } } EDIT Another downside is that if I use aggregation after running .lowecase on inlcude value, results are also normalised. Is it possible to have original value being returned?


Источник: https://stackoverflow.com/questions/781 ... ot-working
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение
  • Как добавить параметр без учета регистра в Array.IndexOf
    Гость » » в форуме C#
    0 Ответы
    122 Просмотры
    Последнее сообщение Гость
  • Java: ключ карты без учета регистра, где ключ — Pair
    Anonymous » » в форуме JAVA
    0 Ответы
    182 Просмотры
    Последнее сообщение Anonymous
  • Сравнение без учета регистра для библиотеки GSSAPI Kerberos под Windows
    Anonymous » » в форуме C++
    0 Ответы
    158 Просмотры
    Последнее сообщение Anonymous
  • Найти подстроку без учета регистра – C# [дубликат]
    Anonymous » » в форуме C#
    0 Ответы
    88 Просмотры
    Последнее сообщение Anonymous
  • Docopt.DocoptLanguageError: «использование:» (без учета регистра) не найдено
    Anonymous » » в форуме Python
    0 Ответы
    62 Просмотры
    Последнее сообщение Anonymous

Вернуться в «Elasticsearch aggregation»