Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query String Query with quote_field_suffix not using the quote_field_suffix field to search #29324

Closed
sherry-ger opened this issue Mar 30, 2018 · 8 comments · Fixed by #29332
Closed
Labels
>bug :Search/Search Search-related issues that do not fall into other categories

Comments

@sherry-ger
Copy link

sherry-ger commented Mar 30, 2018

Elasticsearch version
6.2.3

Plugins installed: []
X-Pack

JVM version (java -version):
1.8.0_162

Description of the problem including expected versus actual behavior:

Query string query with quote_field_suffix not using the correct field for search. Simple query string query seems to work correctly. Also, this works fine in version 5.6 and 6.0 alpha 2

Steps to reproduce:

PUT testindex
{
  "settings": {
    "analysis": {
      "analyzer": {
        "english_exact": {
          "tokenizer": "standard",
          "filter": [
            "lowercase"
          ]
        }
      }
    },
    "number_of_shards": 1,
    "number_of_replicas": 0
  },
  "mappings": {
    "type": {
      "properties": {
        "body": {
          "type": "text",
          "analyzer": "english",
          "fields": {
            "exact": {
              "type": "text",
              "analyzer": "english_exact"
            }
          }
        }
      }
    }
  }
}

PUT testindex/type/1
{
  "body": "Ski resort"
}

PUT testindex/type/2
{
  "body": "A pair of skis"
}

PUT testindex/type/3
{
  "body": "ski boots"
}

POST testindex/_refresh

GET testindex/_search                               <-- works fine 
{
  "query": {
    "simple_query_string": {
      "fields": [ "body" ],
      "quote_field_suffix": ".exact",
      "query": "\"ski boot\""
    }
  }
}

GET testindex/_search
{
  "query": {
    "query_string": {
      "fields": [ "body" ],
      "quote_field_suffix": ".exact",
      "query": "\"ski boot\""
    }
  }
}

GET testindex/_validate/query?rewrite 
{
  "query": {
    "query_string": {
      "fields": [ "body" ],
      "quote_field_suffix": ".exact",
      "query": "\"ski boot\""
    }
  }
}

The result of the rewrite seems to drop the exact multi-field.

@ushakanagaraj
Copy link

ushakanagaraj commented Mar 30, 2018

Hi Sherry, thank you for filing the bug. Is there an ETA on this? One of our feature delivery is dependent on this.

Is there an alternate interim solution?

@talevy talevy added the :Search/Search Search-related issues that do not fall into other categories label Mar 30, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

jimczi added a commit to jimczi/elasticsearch that referenced this issue Apr 2, 2018
This change fixes the handling of the `quote_field_suffix` option on `query_string`
 query. The expansion was not applied to default fields query.

Closes elastic#29324
jimczi added a commit that referenced this issue Apr 4, 2018
This change fixes the handling of the `quote_field_suffix` option on `query_string`
 query. The expansion was not applied to default fields query.

Closes #29324
jimczi added a commit that referenced this issue Apr 4, 2018
This change fixes the handling of the `quote_field_suffix` option on `query_string`
 query. The expansion was not applied to default fields query.

Closes #29324
@imranazad
Copy link

Does anyone know when this will be released officially?

@jasontedor
Copy link
Member

@imranazad It should be included in 6.3.0, but as a matter of policy we do not provide release dates.

@imranazad
Copy link

imranazad commented Apr 13, 2018

@jasontedor Thanks, I've downloaded the version (6.2.3) from here: https://www.elastic.co/downloads/elasticsearch

But the issue persists, I've noticed there are various references to 6.3.0 but I can't seem to figure out where to download it from.

Can you please advise?

@jasontedor
Copy link
Member

6.3.0 is not released yet; that’s why I say we do not provide release dates.

@imranazad
Copy link

imranazad commented Apr 14, 2018

@jasontedor Ah I see, thanks I realised that afterwards. I'll keep an eye out.

@jasontedor
Copy link
Member

You're welcome; sorry for the previous confusion.

kcm pushed a commit that referenced this issue May 9, 2018
This change fixes the handling of the `quote_field_suffix` option on `query_string`
 query. The expansion was not applied to default fields query.

Closes #29324

(cherry picked from commit 644e5ea)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Search Search-related issues that do not fall into other categories
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants