Skip to content

Query fails on old indices when returning a semantic text field and source is disabled #136130

@Mikep86

Description

@Mikep86

Elasticsearch Version

9.2

Installed Plugins

No response

Java Version

bundled

OS Version

n/a

Problem Description

In 9.2, we made a breaking change to exclude vectors from _source by default. Additionally, we tied that index setting to control if semantic field embeddings are included in _source. These two changes have combined to create a problem when:

  • Querying an index created before 9.2 (i.e. it includes vectors in _source by default)
  • A semantic_text field is in _source
  • _source is disabled by the request

The failure mode is indicated by:

      {
        "shard": 4,
        "index": "properties",
        "node": "HoRCRAz6Sr2Awtz2BaKorw",
        "reason": {
          "type": "illegal_argument_exception",
          "reason": "can not write type [class org.elasticsearch.xpack.inference.mapper.SemanticTextField]"
        }
      }

Steps to Reproduce

  1. Create an index with a semantic_text field in a version prior to 9.2
  2. Add some docs to the index
  3. Upgrade to 9.2
  4. Query the index with _source disabled such that a doc with a populated semantic_text field is returned
GET my-index/_search
{
  "_source": false,
  "query": {
    <some query that returns a doc with a semantic text field>
  }
}

Logs (if relevant)

No response

Metadata

Metadata

Assignees

Labels

:SearchOrg/RelevanceLabel for the Search (solution/org) Relevance team>bugTeam:Search - RelevanceThe Search organization Search Relevance teampriority:highA label for assessing bug priority to be used by ES engineers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions