Skip to content

Conversation

carlosdelest
Copy link
Member

Add support for the upcoming semantic_text and semantic query.

@carlosdelest carlosdelest requested a review from a team June 18, 2024 15:52
@l-trotta l-trotta self-assigned this Jun 19, 2024
@l-trotta
Copy link
Contributor

@carlosdelest from the server code it seems like there are some other parameters for the Semantic Text property. Are all of those internal? Like model_settings for example

@carlosdelest
Copy link
Member Author

hey @l-trotta ! Good catch - model_settings is used internally and should not be set by the user, but internally from the mapping itself when a document is added.

I believe these are the properties exposed by the field type.

@l-trotta
Copy link
Contributor

Thanks for the clarification, just making sure :D
What about copy_to? From the documentation it looks like it's accepted, but then the server code says otherwise. Tested this in the devtools:

PUT my-index-000003
{
  "mappings": {
    "properties": {
      "inference_field": {
        "type": "semantic_text",
        "inference_id": "my-elser-endpoint",
        "copy_to": "field"
        }
    }
  }
}

returns:

{
  "error": {
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "Failed to parse mapping: semantic_text field [inference_field] does not support [copy_to]"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "Failed to parse mapping: semantic_text field [inference_field] does not support [copy_to]",
    "caused_by": {
      "type": "illegal_argument_exception",
      "reason": "semantic_text field [inference_field] does not support [copy_to]"
    }
  },
  "status": 400
}

@carlosdelest
Copy link
Member Author

My bad @l-trotta ! semantic_text can be the target of copy_to, but not have copy_to fields itself. Thanks for the catch, fixed it!

Copy link
Contributor

@l-trotta l-trotta left a comment

Choose a reason for hiding this comment

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

LGTM! thank you

@carlosdelest carlosdelest merged commit 3bcd7c5 into main Jun 19, 2024
@carlosdelest carlosdelest deleted the carlosdelest/semantic-text-and-query branch June 19, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants