cube-js/cube

Elasticsearch contains query does a fuzzy match instead of like query

Open

#1.720 geöffnet am 4. Jan. 2021

Auf GitHub ansehen
 (6 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (1.965 Forks)batch import
community supporteddriver:elasticsearchhelp wanted

Repository-Metriken

Stars
 (19.563 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 5T 16h) (138 gemergte PRs in 30 T)

Beschreibung

Describe the bug When I do a contains search in the cube for an elasticsearch database it creates a fuzziness SQL query

To Reproduce Cube Query

{
  "filters": [
    {
      "dimension": "index.message",
      "values": [
        "viral"
      ],
      "operator": "contains"
    }
  ],
  "limit": 1,
  "dimensions": [
    "index.user_id"
  ]
}

This creates a SQL query like this

  SELECT
      index.user_id index__user_id
    FROM
      index AS index
  WHERE ( MATCH(index.message, 'viral', 'fuzziness=AUTO:1,5')) GROUP BY index.user_id ORDER BY index.user_id ASC LIMIT 1

Is there any reason we are not using the LIKE query in this case If not then can I change it, such that the engine creates a LIKE query when the input cube query has operator as contains

Contributor Guide