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

Regression in QueryString/Percolator behavior on unmapped fields between 7.6.2 and 7.7.0 #63150

Open
ruke47 opened this issue Oct 1, 2020 · 3 comments
Labels
>bug :Search/Percolator Reverse search: find queries that match a document Team:Search Meta label for search team

Comments

@ruke47
Copy link

ruke47 commented Oct 1, 2020

Elasticsearch version (bin/elasticsearch --version): 7.7.0 (problem persists through 7.9.2)

Plugins installed: none

JVM version (java -version):

openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.6+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.6+10, mixed mode)

OS version (uname -a if on a Unix-like system):
reproduced on:
Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64
4.4.0-1026-aws #35-Ubuntu SMP Thu Jul 20 21:59:09 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior: In 7.6.2-, I am able to set map_unmapped_fields_as_text: true on an index, create a percolator_query that consists of a query_string query, and match documents that contains unmapped fields against it. This functionality appears to break in 7.7.0.

Steps to reproduce:
The below results in 1 hit in 7.6.2, but 0 hits in 7.7.0:

curl -XPUT "localhost:${PORT}/percolation-index" -H 'Content-Type:application/json' -d '
{
  "settings": {
    "percolator": {
      "map_unmapped_fields_as_text": true
    }
  },
  "mappings": {
    "properties": {
      "percolator_field": {
        "type": "percolator"
      }
    }
  }
}'
curl -XPOST "localhost:${PORT}/percolation-index/_doc?refresh=true" -H 'Content-Type:application/json' -d '
{
  "percolator_field": {
	"query_string": {
	  "query": "message:test"
	}
  }
}'
curl -XPOST "localhost:${PORT}/percolation-index/_search?pretty" -H 'Content-Type:application/json' -d '
{
  "query": {
    "percolate": {
      "field": "percolator_field",
      "document": {
        "message": "test stuff"
      }
    }
  }
}'

Provide logs (if relevant): n/a

(Crossposted from: https://discuss.elastic.co/t/some-change-in-percolation-querystringquery-mapping-between-7-6-2-and-7-7-0/250579)

@ruke47 ruke47 added >bug needs:triage Requires assignment of a team area label labels Oct 1, 2020
@henningandersen henningandersen added :Search/Percolator Reverse search: find queries that match a document v7.9.2 labels Oct 2, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Percolator)

@elasticmachine elasticmachine added the Team:Search Meta label for search team label Oct 2, 2020
@henningandersen henningandersen removed the needs:triage Requires assignment of a team area label label Oct 2, 2020
@ruke47
Copy link
Author

ruke47 commented Oct 28, 2020

Additional details:

If I create the percolator, and then add a "message": { "type": "text"} mapping to the index, the percolate query still fails. If I add the mapping to the index before creating the percolator, the percolate query will succeed.

@avivunitq
Copy link

avivunitq commented Dec 14, 2022

I am having the same issue in v7.9.1 as well as 7.10.2! Is there any update on this bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Percolator Reverse search: find queries that match a document Team:Search Meta label for search team
Projects
None yet
Development

No branches or pull requests

5 participants