Guest User

Untitled

a guest
Oct 23rd, 2019
72
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2. "size": 0,
  3. "query": {
  4. "bool": {
  5. "minimum_should_match": 0,
  6. "must": [
  7. {
  8. "exists": {
  9. "field": "productPriceDiscount"
  10. }
  11. },
  12. {
  13. "bool": {
  14. "should": [
  15. {
  16. "match": {
  17. "network": {
  18. "query": "connexity",
  19. "boost": 0.5
  20. }
  21. }
  22. },
  23. {
  24. "match": {
  25. "network": {
  26. "query": "billiger",
  27. "boost": 0.5
  28. }
  29. }
  30. }
  31. ]
  32. }
  33. },
  34. {
  35. "bool": {
  36. "should": [
  37. {
  38. "common": {
  39. "productName.lang": {
  40. "query": "iphone",
  41. "cutoff_frequency": 0.001,
  42. "boost": 0.3
  43. }
  44. }
  45. },
  46. {
  47. "match_phrase": {
  48. "productName.lang": {
  49. "query": "iphone",
  50. "boost": 1.5
  51. }
  52. }
  53. },
  54. {
  55. "match_phrase_prefix": {
  56. "productName.lang": {
  57. "query": "iphone",
  58. "boost": 0.01
  59. }
  60. }
  61. },
  62. {
  63. "match": {
  64. "productName.lang": {
  65. "query": "iphone",
  66. "operator": "and",
  67. "boost": 0.5,
  68. "fuzziness": 1
  69. }
  70. }
  71. },
  72. {
  73. "match": {
  74. "manufacturer": {
  75. "query": "iphone",
  76. "boost": 0.5
  77. }
  78. }
  79. }
  80. ]
  81. }
  82. }
  83. ]
  84. }
  85. },
  86. "aggs": {
  87. "categories": {
  88. "terms": {
  89. "size": 100,
  90. "field": "category.category_id"
  91. },
  92. "aggs": {
  93. "category": {
  94. "top_hits": {
  95. "size": 1,
  96. "_source": {
  97. "includes": [
  98. "category.category_id",
  99. "category.name"
  100. ]
  101. }
  102. }
  103. }
  104. }
  105. }
  106. }
  107. }
RAW Paste Data