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

[BUG] Error not returned when creating a percolator document containing a field without mapping #12141

Closed
tokki92 opened this issue Feb 2, 2024 · 1 comment · Fixed by #13957
Labels
bug Something isn't working Indexing Indexing, Bulk Indexing and anything related to indexing Search Search query, autocomplete ...etc

Comments

@tokki92
Copy link

tokki92 commented Feb 2, 2024

Describe the bug

If an asterisk is included in the value of the query field when creating a percolator document with query_string, query_shard_exception (No field mapping can be found for the field with name [{someField}]) is not returned even if there is no mapping of that field. And that field is not searchable.

Related component

Indexing

To Reproduce

request

PUT /:index/_doc/:id

{
  "query": {
    "query_string": {
      "query": "someField: *test",
      "default_operator": "AND",
      "default_field": "body"
    }
  }
}

then this percolator document is created successfully even if someField has no mapping in its index and someField is not searchable

Expected behavior

When the request body is(no asterisk)

{
  "query": {
    "query_string": {
      "query": "someField: test",
      "default_operator": "AND",
      "default_field": "body"
    }
  },
}

cluster returns 400 Bad Requeest response with query_shard_exception(reason: No field mapping can be found for the field with name [someField])

Additional Details

Plugins
Please list all plugins currently enabled.

Screenshots
If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

index settings

  • I don't think there is a relevant setting
"settings": {
      "index": {
        "replication": {
          "type": "DOCUMENT"
        },
        "refresh_interval": "3s",
        "number_of_shards": "1",
        "provided_name": "{index name}",
        "creation_date": "1706062096956",
        "number_of_replicas": "3",
        "uuid": "Dur7_p13SgOIwl-3rHt_BQ",
        "version": {
          "created": "136327927"
        }
      }
    }
@tokki92 tokki92 added bug Something isn't working untriaged labels Feb 2, 2024
@github-actions github-actions bot added the Indexing Indexing, Bulk Indexing and anything related to indexing label Feb 2, 2024
@tokki92 tokki92 changed the title [BUG] Error not returned when creating a perfolator document containing a field without mapping [BUG] Error not returned when creating a percolator document containing a field without mapping Feb 2, 2024
@ankitkala ankitkala added the Search Search query, autocomplete ...etc label Feb 15, 2024
@ankitkala
Copy link
Member

@tokki92 Feel free to raise a pull request for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Indexing Indexing, Bulk Indexing and anything related to indexing Search Search query, autocomplete ...etc
Projects
Archived in project
2 participants