Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. {
  2. "mapping": {
  3. "properties": {
  4. "id": {
  5. "type": "String",
  6. "index": "not_analyzed"
  7. },
  8. "tags": {
  9. "type": "nested",
  10. "properties": {
  11. "id": {
  12. "type": "String",
  13. "index": "not_analyzed"
  14. },
  15. "tag_value": {
  16. "type": "nested",
  17. "properties": {
  18. "tagId": {
  19. "type": "String",
  20. "index": "not_analyzed"
  21. },
  22. "label": {
  23. "type": "String",
  24. "index": "not_analyzed"
  25. }
  26. }
  27. }
  28. }
  29. }
  30. }
  31. }
  32. }
  33.  
  34. {
  35. "_source": {
  36. "includes": [
  37. "id"
  38. ]
  39. },
  40. "query": {
  41. "bool": {
  42. "filter": [
  43. {
  44. "ids": {
  45. "values": [
  46. "021a9586-82de-4cbd-a651-e0b403d2b6da",
  47. "fee6e022-442d-419f-943f-ad2859013330"
  48. ]
  49. }
  50. },
  51. {
  52. "nested": {
  53. "path": "tags",
  54. "query": {
  55. "bool": {
  56. "must": [
  57. {
  58. "term": {
  59. "id": "xyz"
  60. }
  61. },
  62. {
  63. "nested": {
  64. "path": "tags.tag_value",
  65. "query": {
  66. "bool": {
  67. "must": [
  68. {
  69. "terms": {
  70. "tags.tag_value.tagId": [
  71. "english",
  72. "portugese"
  73. ]
  74. }
  75. }
  76. ]
  77. }
  78. },
  79. "inner_hits": {
  80. "size": 4,
  81. "_source": {
  82. "includes": [
  83. "tagId",
  84. "label"
  85. ]
  86. }
  87. }
  88. }
  89. }
  90. ]
  91. }
  92. }
  93. }
  94. }
  95. ]
  96. }
  97. }
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement