From 1e36249351c208f1feaf39a79d1a947ac400d025 Mon Sep 17 00:00:00 2001 From: Paul Masurel Date: Fri, 11 Oct 2024 18:09:30 +0900 Subject: [PATCH] fixing integration testst --- .../0005-query_string_query.yaml | 3 +++ .../es_compatibility/0007-range_queries.yaml | 6 +++-- .../0014-multi-match-query.yaml | 17 +++----------- .../scenarii/es_compatibility/0020-stats.yaml | 1 - .../_setup.elasticsearch.yaml | 17 ++++++++++++-- .../es_compatibility/_setup.quickwit.yaml | 22 ++++++++++++------- 6 files changed, 39 insertions(+), 27 deletions(-) diff --git a/quickwit/rest-api-tests/scenarii/es_compatibility/0005-query_string_query.yaml b/quickwit/rest-api-tests/scenarii/es_compatibility/0005-query_string_query.yaml index 53079e9f7eb..8cb495379c3 100644 --- a/quickwit/rest-api-tests/scenarii/es_compatibility/0005-query_string_query.yaml +++ b/quickwit/rest-api-tests/scenarii/es_compatibility/0005-query_string_query.yaml @@ -233,6 +233,9 @@ expected: total: value: 100 --- +# elasticsearch accepts this query +engines: + - quickwit json: query: query_string: diff --git a/quickwit/rest-api-tests/scenarii/es_compatibility/0007-range_queries.yaml b/quickwit/rest-api-tests/scenarii/es_compatibility/0007-range_queries.yaml index bbedea70e0d..1f240d5c4d3 100644 --- a/quickwit/rest-api-tests/scenarii/es_compatibility/0007-range_queries.yaml +++ b/quickwit/rest-api-tests/scenarii/es_compatibility/0007-range_queries.yaml @@ -195,11 +195,11 @@ json: range: repo.name: gte: "h" - lte: "z" + lte: "i" expected: hits: total: - value: 62 + value: 1 relation: "eq" --- # This field is a JSON field and has fast field normalization. @@ -218,6 +218,8 @@ expected: --- # This field is a JSON field and has fast field normalization. # That means it is case insensitive +engines: + - quickwit json: query: range: diff --git a/quickwit/rest-api-tests/scenarii/es_compatibility/0014-multi-match-query.yaml b/quickwit/rest-api-tests/scenarii/es_compatibility/0014-multi-match-query.yaml index 47b7b842464..dccea842e53 100644 --- a/quickwit/rest-api-tests/scenarii/es_compatibility/0014-multi-match-query.yaml +++ b/quickwit/rest-api-tests/scenarii/es_compatibility/0014-multi-match-query.yaml @@ -76,6 +76,9 @@ expected: total: value: 1 --- +engines: + # TODO check the discrepancy with ES + - quickwit json: query: multi_match: @@ -87,20 +90,6 @@ expected: total: value: 4 --- -# This query fails on elasticsearch, with an error message -# explaining position are missing for one of the fields. -# -# Todo: Somehow we accept it on quickwit. -engines: - - elasticsearch -json: - query: - multi_match: - type: phrase - query: the pomle missingtoken - fields: ["payload.commits.message", "actor.login"] -status_code: 400 ---- json: query: multi_match: diff --git a/quickwit/rest-api-tests/scenarii/es_compatibility/0020-stats.yaml b/quickwit/rest-api-tests/scenarii/es_compatibility/0020-stats.yaml index f2d92991e9f..461911f73c9 100644 --- a/quickwit/rest-api-tests/scenarii/es_compatibility/0020-stats.yaml +++ b/quickwit/rest-api-tests/scenarii/es_compatibility/0020-stats.yaml @@ -59,7 +59,6 @@ expected: method: [GET] engines: - quickwit - - elasticsearch endpoint: "_stats" expected: _all: diff --git a/quickwit/rest-api-tests/scenarii/es_compatibility/_setup.elasticsearch.yaml b/quickwit/rest-api-tests/scenarii/es_compatibility/_setup.elasticsearch.yaml index 639f9233e61..f21d5c9598e 100644 --- a/quickwit/rest-api-tests/scenarii/es_compatibility/_setup.elasticsearch.yaml +++ b/quickwit/rest-api-tests/scenarii/es_compatibility/_setup.elasticsearch.yaml @@ -25,6 +25,17 @@ json: { method: PUT endpoint: gharchive json: { + "settings": { + "analysis": { + "normalizer": { + "keyword_lowercase": { + "type": "custom", + "filter": ["lowercase"] + }, + "keyword_keepcase": { "type": "custom" } + } + } + }, "mappings": { "properties": { "id": { @@ -47,7 +58,8 @@ json: { "store": true }, "login": { - "type": "text", + "type": "keyword", + "normalizer": "keyword_lowercase", "store": true, "norms": false, "index_options": "docs" @@ -79,7 +91,8 @@ json: { "store": true }, "name": { - "type": "text", + "type": "keyword", + "normalizer": "keyword_keepcase", "store": true }, "url": { diff --git a/quickwit/rest-api-tests/scenarii/es_compatibility/_setup.quickwit.yaml b/quickwit/rest-api-tests/scenarii/es_compatibility/_setup.quickwit.yaml index b6d2df1053f..a306e4e7d06 100644 --- a/quickwit/rest-api-tests/scenarii/es_compatibility/_setup.quickwit.yaml +++ b/quickwit/rest-api-tests/scenarii/es_compatibility/_setup.quickwit.yaml @@ -36,14 +36,20 @@ json: timestamp_field: created_at mode: dynamic field_mappings: - - name: repo.name - type: text - fast: true - indexed: true - - name: actor.id - type: u64 - fast: true - indexed: true + - name: repo + type: object + field_mappings: + - name: name + type: text + fast: true + indexed: true + # - name: actor + # type: object + # field_mappings: + # - name: id + # type: u64 + # fast: true + # indexed: true - name: public type: bool fast: false