Search for a task

Searches tasks based on parameters indicated in the request body.

Path and HTTP methods

  1. GET /_plugins/_ml/tasks/_search

Example request: Search for a task in which function_name is KMEANS

  1. GET /_plugins/_ml/tasks/_search
  2. {
  3. "query": {
  4. "bool": {
  5. "filter": [
  6. {
  7. "term": {
  8. "function_name": "KMEANS"
  9. }
  10. }
  11. ]
  12. }
  13. }
  14. }

copy

Example response

  1. {
  2. "took" : 12,
  3. "timed_out" : false,
  4. "_shards" : {
  5. "total" : 1,
  6. "successful" : 1,
  7. "skipped" : 0,
  8. "failed" : 0
  9. },
  10. "hits" : {
  11. "total" : {
  12. "value" : 2,
  13. "relation" : "eq"
  14. },
  15. "max_score" : 0.0,
  16. "hits" : [
  17. {
  18. "_index" : ".plugins-ml-task",
  19. "_id" : "_wnLJ38BvytMh9aUi-Ia",
  20. "_version" : 4,
  21. "_seq_no" : 29,
  22. "_primary_term" : 4,
  23. "_score" : 0.0,
  24. "_source" : {
  25. "last_update_time" : 1645640125267,
  26. "create_time" : 1645640125209,
  27. "is_async" : true,
  28. "function_name" : "KMEANS",
  29. "input_type" : "SEARCH_QUERY",
  30. "worker_node" : "jjqFrlW7QWmni1tRnb_7Dg",
  31. "state" : "COMPLETED",
  32. "model_id" : "AAnLJ38BvytMh9aUi-M2",
  33. "task_type" : "TRAINING"
  34. }
  35. },
  36. {
  37. "_index" : ".plugins-ml-task",
  38. "_id" : "wwRRLX8BydmmU1x6I-AI",
  39. "_version" : 3,
  40. "_seq_no" : 38,
  41. "_primary_term" : 7,
  42. "_score" : 0.0,
  43. "_source" : {
  44. "last_update_time" : 1645732766656,
  45. "create_time" : 1645732766472,
  46. "is_async" : true,
  47. "function_name" : "KMEANS",
  48. "input_type" : "SEARCH_QUERY",
  49. "worker_node" : "A_IiqoloTDK01uZvCjREaA",
  50. "state" : "COMPLETED",
  51. "model_id" : "xARRLX8BydmmU1x6I-CG",
  52. "task_type" : "TRAINING"
  53. }
  54. }
  55. ]
  56. }
  57. }