@DocStore(doc = "id")
public class Model{@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
protected Long id;
...
}
The DocStore annotation does not create a property id in the ElasticSearch index.
When requesting an ordered list from the ES using query.order("id") the following json is produced:json:{"size":1000,"sort":[{"id":{"order":"asc"}}],"query":{"match_all":{}}}
and ES query fails:
Caused by: java.io.IOException: Unhandled response code 400
body:{"error":{"root_cause":[{"type":"search_parse_exception","reason":"No mapping found for [id] in order to sort on"}],
"type":"search_phase_execution_exception","reason":"all shards failed",
"phase":"query","grouped":true,
"failed_shards":[{"shard":0,"index":"model_v1","node":"TYGwdbCZQNiwVM2I2Abn4w","reason":{"type":"search_parse_exception","reason":"No mapping found for [id] in order to sort on"}}]},"status":400}