How should I write this statement?

Create an index

···
PUT /new_index
{
"mappings": {
"properties": {
"data": {
"type": "keyword"
},
"hash": {
"type": "integer"
},
"hash_mapping": {
"type": "keyword"
},
"task_id": {
"type": "keyword"
}
}
}
}
···

Insert data

···
POST /new_index/_doc
{
"data": "111 123 124 456 789",
"hash": 12345,
"hash_mapping": "Sample mapping value",
"task_id": "Task No. 1"
}
···

The table structure in Elasticsearch is as above.

Now it is necessary to set up a fuzzy search.

Examples:

  1. When searching for data "111 123 124 456 789", it can be found with a matching degree of 100%.
  2. When searching for data "111 123 124 456", it can be found with a matching degree of 100%.
  3. When searching for data "111 123 124 333 789", it can be found with a matching degree of 80%.
  4. When searching for data "222 123 124 333 789", it cannot be found with a matching degree of 60%.

Return the matching data when the matching degree is greater than or equal to 80%.

It sounds like you may want to use multi field to map the data field as both a keyword and as an analysed text field using the whitespace tokeniser. The tokenised field would mostly give the result you describe, but the last example would match at 60% as 3 out of 5 terms would match.

Since I'm new to Elasticsearch, I'm not quite clear about some concepts yet.

This structure can be modified and the "keyword" type doesn't have to be used. As long as this function can be achieved, it will be okay. Do you know how to do it?
thanks

I would recommend mapping the field using multi field so you have both keyword and text mapping. For some types of queries one my work better than the other.

Would it be convenient for you to write a sample? Thank you very much.

Did you look at the documentation I linked to? This contains a very similar example.