Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-9705

Explain Query tool doesn't show the correct ES query when suggest queries are made

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.60.0
    • search, search-elastic
    • None

    Description

      When running the following suggest query from AEM(ES index is available)

      SELECT [rep:suggest()] FROM [dam:Asset] as s WHERE SUGGEST('jav') option(index name [damAssetElastic-7-custom-2])
      

      the detailed plan show that the following query is run on ES side:

      {"bool":\{"must":[{"query_string":{"query":"suggest?term=jav","fields":[],"type":"best_fields","default_operator":"or","max_determinized_states":10000,"enable_position_increments":true,"fuzziness":"AUTO","fuzzy_prefix_length":0,"fuzzy_max_expansions":50,"phrase_slop":0,"escape":false,"auto_generate_synonyms_phrase_query":true,"fuzzy_transpositions":true,"boost":1.0}}],"adjust_pure_negative":true,"boost":1.0}}
      

      Instead, the following query is actually run on ES side:

      POST cm-p11553-e21096-publish._damassetelastic-7-custom-2/_search
      {
        "query": {
          "bool": {
            "must": [
              {
                "nested": {
                  "path": ":suggest",
                  "query": {
                    "match_phrase_prefix": {
                      ":suggest.value": {
                        "query": "jav"
                      }
                    }
                  }
                }
              }
            ],
            "adjust_pure_negative": true,
            "boost": 1
          }
        }
      }
      

      the Explain query should reflect the correct ES query as well.

      Attachments

        Activity

          People

            fortino Fabrizio Fortino
            francoiszhang Jun Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: