Skip to content

Conversation

carlosdelest
Copy link
Member

Clarify in docs that semantic_text fields are not currently supported in object fields

@carlosdelest carlosdelest added >docs General docs changes auto-backport Automatically create backport pull requests when merged Team:SearchOrg Meta label for the Search Org (Enterprise Search) :SearchOrg/Relevance Label for the Search (solution/org) Relevance team v8.15.0 v8.16.0 v9.0.0 labels Oct 9, 2024
Copy link
Contributor

github-actions bot commented Oct 9, 2024

Documentation preview:

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-docs (Team:Docs)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/search-eng (Team:SearchOrg)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/search-relevance (Team:Search - Relevance)

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's preventing the field to work inside object fields? We fail if the field is under a nested object but normal objects should work fine. We have tests for this.

@carlosdelest
Copy link
Member Author

@jimczi

What's preventing the field to work inside object fields? We fail if the field is under a nested object but normal objects should work fine.

We're not overwriting correctly the object when calculating the inference. The following sequence:

PUT test_semantic

PUT /test_semantic/_mapping
{
  "properties": {
    "level_1": {
      "properties": {
        "level_2": {
          "type": "semantic_text",
          "inference_id": "elser-endpoint"
        }
      }
    }
  }
}

POST test_semantic/_doc/0001
{
  "level_1": {
    "level_2": "text"
  }
}

results in an error:

{
  "error": {
    "root_cause": [
      {
        "type": "document_parsing_exception",
        "reason": "[1:29] failed to parse field [level_1.level_2] of type [semantic_text] in document with id '0001'. Preview of field's value: 'null'"
      }
    ],
    "type": "document_parsing_exception",
    "reason": "[1:29] failed to parse field [level_1.level_2] of type [semantic_text] in document with id '0001'. Preview of field's value: 'null'",
    "caused_by": {
      "type": "illegal_argument_exception",
      "reason": "[1:29] [semantic_text] Expected START_OBJECT but was: END_OBJECT"
    }
  },
  "status": 400
}

I've been able to reproduce this locally.

We have tests for this.

We have tests for copy_to from object fields to (non-object) semantic fields here. I haven't found object tests on the inference tests.

@jimczi
Copy link
Contributor

jimczi commented Oct 9, 2024

Oh that's a bug then! We should account for objects here?

@carlosdelest
Copy link
Member Author

Oh that's a bug then! We should account for objects here?

👍 That is correct.

@jimczi
Copy link
Contributor

jimczi commented Oct 9, 2024

We have tests here but they don't use the action filter.

@carlosdelest
Copy link
Member Author

carlosdelest commented Oct 9, 2024

I'm closing this in favour of opening this GH bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged >docs General docs changes :SearchOrg/Relevance Label for the Search (solution/org) Relevance team Team:SearchOrg Meta label for the Search Org (Enterprise Search) v8.15.0 v8.16.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants