Guest User

Query

a guest
Feb 21st, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.92 KB | None | 0 0
  1. http://localhost:9200/mytestindex/testmapping/_search
  2. {
  3. "from": 0,
  4. "size": 50,
  5. "highlight": {
  6. "fields": {
  7. "content": {
  8.  
  9. }
  10. }
  11. },
  12. "fields": [
  13. "collectionNameOriginal",
  14. "projectNameOriginal",
  15. "repoNameOriginal",
  16. "branchNameOriginal",
  17. "filePathOriginal",
  18. "fileExtension",
  19. "changeId",
  20. "contentId",
  21. "vcType"
  22. ],
  23. "aggs": {
  24. "project_aggs": {
  25. "terms": {
  26. "field": "projectNameOriginal",
  27. "size": 0
  28. }
  29. }
  30. },
  31. "query": {
  32. "filtered": {
  33. "query": {
  34. "bool": {
  35. "must": [
  36. {
  37. "bool": {
  38. "should": [
  39. {
  40. "codesearch_score_query": {
  41. "query_id": "db80ac7a-ece3-4494-89c0-2548e2873805",
  42. "query": {
  43. "term": {
  44. "content": "int"
  45. }
  46. }
  47. }
  48. },
  49. {
  50. "function_score": {
  51. "boost": 10000000,
  52. "query": {
  53. "filtered": {
  54. "filter": {
  55. "term": {
  56. "fileName": "int",
  57. "_name": "fileName_int"
  58. }
  59. }
  60. }
  61. }
  62. }
  63. }
  64. ]
  65. }
  66. },
  67. {
  68. "bool": {
  69. "should": [
  70. {
  71. "codesearch_score_query": {
  72. "query_id": "db80ac7a-ece3-4494-89c0-2548e2873805",
  73. "query": {
  74. "term": {
  75. "content": "string"
  76. }
  77. }
  78. }
  79. },
  80. {
  81. "function_score": {
  82. "boost": 10000000,
  83. "query": {
  84. "filtered": {
  85. "filter": {
  86. "term": {
  87. "fileName": "string",
  88. "_name": "fileName_string"
  89. }
  90. }
  91. }
  92. }
  93. }
  94. }
  95. ]
  96. }
  97. },
  98. {
  99. "filtered": {
  100. "filter": {
  101. "term": {
  102. "fileExtension": "cs",
  103. "_name": "fileExtension_cs"
  104. }
  105. }
  106. }
  107. }
  108. ]
  109. }
  110. },
  111. "filter": {
  112. "bool": {
  113. "must": [
  114. {
  115. "bool": {
  116. "must": [
  117. {
  118. "bool": {
  119. "should": [
  120. {
  121. "bool": {
  122. "should": [
  123. {
  124. "bool": {
  125. "should": [
  126. {
  127. "terms": {
  128. "vcType": [
  129. "git"
  130. ]
  131. }
  132. },
  133. {
  134. "missing": {
  135. "field": "vcType"
  136. }
  137. }
  138. ]
  139. }
  140. },
  141. {
  142. "terms": {
  143. "vcType": [
  144. "tfvc"
  145. ]
  146. }
  147. }
  148. ]
  149. }
  150. },
  151. {
  152. "terms": {
  153. "vcType": [
  154. "custom"
  155. ]
  156. }
  157. }
  158. ]
  159. }
  160. },
  161. {
  162. "term": {
  163. "isDefaultBranch": "true"
  164. }
  165. }
  166. ]
  167. }
  168. },
  169. {
  170. "term": {
  171. "collectionId": "abcd"
  172. }
  173. }
  174. ]
  175. }
  176. }
  177. }
  178. }
  179. }
Add Comment
Please, Sign In to add comment