sunspot_solr 2.2.2 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (256) hide show
  1. checksums.yaml +4 -4
  2. data/bin/sunspot-solr +2 -6
  3. data/lib/sunspot/solr/server.rb +2 -3
  4. data/solr/README.txt +181 -181
  5. data/solr/bin/post +29 -19
  6. data/solr/bin/solr +247 -428
  7. data/solr/bin/solr.cmd +102 -256
  8. data/solr/bin/solr.in.cmd +15 -7
  9. data/solr/bin/solr.in.sh +26 -12
  10. data/solr/server/README.txt +110 -113
  11. data/solr/server/contexts/solr-jetty-context.xml +8 -8
  12. data/solr/server/etc/jetty-http.xml +47 -0
  13. data/solr/server/etc/jetty-https-ssl.xml +175 -159
  14. data/solr/server/etc/jetty-https.xml +53 -0
  15. data/solr/server/etc/jetty-ssl.xml +46 -0
  16. data/solr/server/etc/jetty.xml +189 -167
  17. data/solr/server/etc/webdefault.xml +527 -527
  18. data/solr/server/lib/javax.servlet-api-3.1.0.jar +0 -0
  19. data/solr/server/lib/jetty-continuation-9.2.11.v20150529.jar +0 -0
  20. data/solr/server/lib/jetty-deploy-9.2.11.v20150529.jar +0 -0
  21. data/solr/server/lib/jetty-http-9.2.11.v20150529.jar +0 -0
  22. data/solr/server/lib/jetty-io-9.2.11.v20150529.jar +0 -0
  23. data/solr/server/lib/jetty-jmx-9.2.11.v20150529.jar +0 -0
  24. data/solr/server/lib/jetty-rewrite-9.2.11.v20150529.jar +0 -0
  25. data/solr/server/lib/jetty-security-9.2.11.v20150529.jar +0 -0
  26. data/solr/server/lib/jetty-server-9.2.11.v20150529.jar +0 -0
  27. data/solr/server/lib/jetty-servlet-9.2.11.v20150529.jar +0 -0
  28. data/solr/server/lib/jetty-servlets-9.2.11.v20150529.jar +0 -0
  29. data/solr/server/lib/jetty-util-9.2.11.v20150529.jar +0 -0
  30. data/solr/server/lib/jetty-webapp-9.2.11.v20150529.jar +0 -0
  31. data/solr/server/lib/jetty-xml-9.2.11.v20150529.jar +0 -0
  32. data/solr/server/modules/http.mod +9 -0
  33. data/solr/server/modules/https.mod +9 -0
  34. data/solr/server/modules/server.mod +11 -0
  35. data/solr/server/modules/ssl.mod +9 -0
  36. data/solr/server/resources/jetty-logging.properties +1 -0
  37. data/solr/server/resources/log4j.properties +24 -24
  38. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-exec-1.3.jar +0 -0
  39. data/solr/server/solr-webapp/webapp/WEB-INF/lib/{hadoop-annotations-2.3.0.jar → hadoop-annotations-2.6.0.jar} +0 -0
  40. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-auth-2.6.0.jar +0 -0
  41. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-common-2.6.0.jar +0 -0
  42. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-hdfs-2.6.0.jar +0 -0
  43. data/solr/server/solr-webapp/webapp/WEB-INF/lib/htrace-core-3.0.4.jar +0 -0
  44. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpclient-4.4.1.jar +0 -0
  45. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpcore-4.4.1.jar +0 -0
  46. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpmime-4.4.1.jar +0 -0
  47. data/solr/server/solr-webapp/webapp/WEB-INF/lib/jackson-core-2.5.4.jar +0 -0
  48. data/solr/server/solr-webapp/webapp/WEB-INF/lib/jackson-dataformat-smile-2.5.4.jar +0 -0
  49. data/solr/server/solr-webapp/webapp/WEB-INF/lib/{lucene-analyzers-common-5.0.0.jar → lucene-analyzers-common-5.3.1.jar} +0 -0
  50. data/solr/server/solr-webapp/webapp/WEB-INF/lib/{lucene-analyzers-kuromoji-5.0.0.jar → lucene-analyzers-kuromoji-5.3.1.jar} +0 -0
  51. data/solr/server/solr-webapp/webapp/WEB-INF/lib/{lucene-analyzers-phonetic-5.0.0.jar → lucene-analyzers-phonetic-5.3.1.jar} +0 -0
  52. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-backward-codecs-5.3.1.jar +0 -0
  53. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-codecs-5.3.1.jar +0 -0
  54. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-core-5.3.1.jar +0 -0
  55. data/solr/server/solr-webapp/webapp/WEB-INF/lib/{lucene-expressions-5.0.0.jar → lucene-expressions-5.3.1.jar} +0 -0
  56. data/solr/server/solr-webapp/webapp/WEB-INF/lib/{lucene-grouping-5.0.0.jar → lucene-grouping-5.3.1.jar} +0 -0
  57. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-highlighter-5.3.1.jar +0 -0
  58. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-join-5.3.1.jar +0 -0
  59. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-memory-5.3.1.jar +0 -0
  60. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-misc-5.3.1.jar +0 -0
  61. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-queries-5.3.1.jar +0 -0
  62. data/solr/server/solr-webapp/webapp/WEB-INF/lib/{lucene-queryparser-5.0.0.jar → lucene-queryparser-5.3.1.jar} +0 -0
  63. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-sandbox-5.3.1.jar +0 -0
  64. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-spatial-5.3.1.jar +0 -0
  65. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-suggest-5.3.1.jar +0 -0
  66. data/solr/server/solr-webapp/webapp/WEB-INF/lib/org.restlet-2.3.0.jar +0 -0
  67. data/solr/server/solr-webapp/webapp/WEB-INF/lib/org.restlet.ext.servlet-2.3.0.jar +0 -0
  68. data/solr/server/solr-webapp/webapp/WEB-INF/lib/solr-core-5.3.1.jar +0 -0
  69. data/solr/server/solr-webapp/webapp/WEB-INF/lib/solr-solrj-5.3.1.jar +0 -0
  70. data/solr/server/solr-webapp/webapp/WEB-INF/lib/t-digest-3.1.jar +0 -0
  71. data/solr/server/solr-webapp/webapp/WEB-INF/web.xml +169 -181
  72. data/solr/server/solr-webapp/webapp/WEB-INF/weblogic.xml +28 -28
  73. data/solr/server/solr-webapp/webapp/admin.html +164 -163
  74. data/solr/server/solr-webapp/webapp/css/angular/analysis.css +304 -0
  75. data/solr/server/solr-webapp/webapp/css/angular/chosen.css +465 -0
  76. data/solr/server/solr-webapp/webapp/css/angular/cloud.css +398 -0
  77. data/solr/server/solr-webapp/webapp/css/angular/common.css +724 -0
  78. data/solr/server/solr-webapp/webapp/css/angular/cores.css +233 -0
  79. data/solr/server/solr-webapp/webapp/css/angular/dataimport.css +370 -0
  80. data/solr/server/solr-webapp/webapp/css/angular/documents.css +179 -0
  81. data/solr/server/solr-webapp/webapp/css/angular/files.css +53 -0
  82. data/solr/server/solr-webapp/webapp/css/angular/index.css +206 -0
  83. data/solr/server/solr-webapp/webapp/css/angular/logging.css +376 -0
  84. data/solr/server/solr-webapp/webapp/css/angular/menu.css +321 -0
  85. data/solr/server/solr-webapp/webapp/css/angular/plugins.css +212 -0
  86. data/solr/server/solr-webapp/webapp/css/angular/query.css +162 -0
  87. data/solr/server/solr-webapp/webapp/css/angular/replication.css +500 -0
  88. data/solr/server/solr-webapp/webapp/css/angular/schema-browser.css +567 -0
  89. data/solr/server/solr-webapp/webapp/css/angular/segments.css +173 -0
  90. data/solr/server/solr-webapp/webapp/css/angular/threads.css +161 -0
  91. data/solr/server/solr-webapp/webapp/css/chosen.css +421 -421
  92. data/solr/server/solr-webapp/webapp/css/styles/analysis.css +311 -311
  93. data/solr/server/solr-webapp/webapp/css/styles/cloud.css +410 -410
  94. data/solr/server/solr-webapp/webapp/css/styles/common.css +701 -701
  95. data/solr/server/solr-webapp/webapp/css/styles/cores.css +244 -244
  96. data/solr/server/solr-webapp/webapp/css/styles/dashboard.css +155 -155
  97. data/solr/server/solr-webapp/webapp/css/styles/dataimport.css +403 -403
  98. data/solr/server/solr-webapp/webapp/css/styles/documents.css +197 -197
  99. data/solr/server/solr-webapp/webapp/css/styles/files.css +54 -54
  100. data/solr/server/solr-webapp/webapp/css/styles/index.css +207 -207
  101. data/solr/server/solr-webapp/webapp/css/styles/java-properties.css +52 -52
  102. data/solr/server/solr-webapp/webapp/css/styles/logging.css +391 -391
  103. data/solr/server/solr-webapp/webapp/css/styles/menu.css +329 -328
  104. data/solr/server/solr-webapp/webapp/css/styles/plugins.css +195 -195
  105. data/solr/server/solr-webapp/webapp/css/styles/query.css +173 -173
  106. data/solr/server/solr-webapp/webapp/css/styles/replication.css +515 -515
  107. data/solr/server/solr-webapp/webapp/css/styles/schema-browser.css +578 -578
  108. data/solr/server/solr-webapp/webapp/css/styles/segments.css +145 -0
  109. data/solr/server/solr-webapp/webapp/css/styles/threads.css +172 -172
  110. data/solr/server/solr-webapp/webapp/img/chosen-sprite-2x.png +0 -0
  111. data/solr/server/solr-webapp/webapp/img/filetypes/README +27 -27
  112. data/solr/server/solr-webapp/webapp/img/solr.svg +39 -39
  113. data/solr/server/solr-webapp/webapp/index.html +208 -0
  114. data/solr/server/solr-webapp/webapp/js/angular/app.js +713 -0
  115. data/solr/server/solr-webapp/webapp/js/angular/controllers/analysis.js +199 -0
  116. data/solr/server/solr-webapp/webapp/js/angular/controllers/cloud.js +528 -0
  117. data/solr/server/solr-webapp/webapp/js/angular/controllers/core-overview.js +225 -0
  118. data/solr/server/solr-webapp/webapp/js/angular/controllers/cores.js +465 -0
  119. data/solr/server/solr-webapp/webapp/js/angular/controllers/dataimport.js +284 -0
  120. data/solr/server/solr-webapp/webapp/js/angular/controllers/documents.js +139 -0
  121. data/solr/server/solr-webapp/webapp/js/angular/controllers/files.js +92 -0
  122. data/solr/server/solr-webapp/webapp/js/angular/controllers/index.js +95 -0
  123. data/solr/server/solr-webapp/webapp/js/angular/controllers/java-properties.js +45 -0
  124. data/solr/server/solr-webapp/webapp/js/angular/controllers/logging.js +146 -0
  125. data/solr/server/solr-webapp/webapp/js/angular/controllers/plugins.js +166 -0
  126. data/solr/server/solr-webapp/webapp/js/angular/controllers/query.js +99 -0
  127. data/solr/server/solr-webapp/webapp/js/angular/controllers/replication.js +227 -0
  128. data/solr/server/solr-webapp/webapp/js/angular/controllers/schema-browser.js +432 -0
  129. data/solr/server/solr-webapp/webapp/js/angular/controllers/segments.js +94 -0
  130. data/solr/server/solr-webapp/webapp/js/angular/controllers/threads.js +51 -0
  131. data/solr/server/solr-webapp/webapp/js/angular/services.js +214 -0
  132. data/solr/server/solr-webapp/webapp/js/lib/ZeroClipboard.js +342 -342
  133. data/solr/server/solr-webapp/webapp/js/lib/chosen.js +982 -982
  134. data/solr/server/solr-webapp/webapp/js/lib/console.js +29 -29
  135. data/solr/server/solr-webapp/webapp/js/lib/d3.js +9373 -9373
  136. data/solr/server/solr-webapp/webapp/js/lib/highlight.js +31 -31
  137. data/solr/server/solr-webapp/webapp/js/lib/jquery-1.7.2.min.js +30 -30
  138. data/solr/server/solr-webapp/webapp/js/lib/jquery.ajaxfileupload.js +184 -184
  139. data/solr/server/solr-webapp/webapp/js/lib/jquery.blockUI.js +523 -523
  140. data/solr/server/solr-webapp/webapp/js/lib/jquery.cookie.js +71 -71
  141. data/solr/server/solr-webapp/webapp/js/lib/jquery.form.js +806 -806
  142. data/solr/server/solr-webapp/webapp/js/lib/jquery.jstree.js +3534 -3534
  143. data/solr/server/solr-webapp/webapp/js/lib/jquery.sammy.js +1863 -1863
  144. data/solr/server/solr-webapp/webapp/js/lib/jquery.timeago.js +189 -189
  145. data/solr/server/solr-webapp/webapp/js/lib/linker.js +48 -48
  146. data/solr/server/solr-webapp/webapp/js/lib/naturalSort.js +82 -0
  147. data/solr/server/solr-webapp/webapp/js/lib/order.js +216 -216
  148. data/solr/server/solr-webapp/webapp/js/main.js +60 -58
  149. data/solr/server/solr-webapp/webapp/js/require.js +11349 -11349
  150. data/solr/server/solr-webapp/webapp/js/scripts/analysis.js +545 -545
  151. data/solr/server/solr-webapp/webapp/js/scripts/app.js +680 -679
  152. data/solr/server/solr-webapp/webapp/js/scripts/cloud.js +877 -877
  153. data/solr/server/solr-webapp/webapp/js/scripts/cores.js +719 -719
  154. data/solr/server/solr-webapp/webapp/js/scripts/dashboard.js +562 -562
  155. data/solr/server/solr-webapp/webapp/js/scripts/dataimport.js +812 -812
  156. data/solr/server/solr-webapp/webapp/js/scripts/documents.js +370 -370
  157. data/solr/server/solr-webapp/webapp/js/scripts/files.js +265 -265
  158. data/solr/server/solr-webapp/webapp/js/scripts/index.js +340 -340
  159. data/solr/server/solr-webapp/webapp/js/scripts/java-properties.js +106 -106
  160. data/solr/server/solr-webapp/webapp/js/scripts/logging.js +578 -576
  161. data/solr/server/solr-webapp/webapp/js/scripts/ping.js +72 -72
  162. data/solr/server/solr-webapp/webapp/js/scripts/plugins.js +462 -462
  163. data/solr/server/solr-webapp/webapp/js/scripts/query.js +229 -229
  164. data/solr/server/solr-webapp/webapp/js/scripts/replication.js +527 -527
  165. data/solr/server/solr-webapp/webapp/js/scripts/schema-browser.js +1229 -1229
  166. data/solr/server/solr-webapp/webapp/js/scripts/segments.js +206 -0
  167. data/solr/server/solr-webapp/webapp/js/scripts/threads.js +158 -158
  168. data/solr/server/solr-webapp/webapp/libs/angular-chosen.js +139 -0
  169. data/solr/server/solr-webapp/webapp/libs/angular-cookies.js +229 -0
  170. data/solr/server/solr-webapp/webapp/libs/angular-cookies.min.js +31 -0
  171. data/solr/server/solr-webapp/webapp/libs/angular-resource.min.js +36 -0
  172. data/solr/server/solr-webapp/webapp/libs/angular-route.js +1018 -0
  173. data/solr/server/solr-webapp/webapp/libs/angular-route.min.js +38 -0
  174. data/solr/server/solr-webapp/webapp/libs/angular-sanitize.js +703 -0
  175. data/solr/server/solr-webapp/webapp/libs/angular-sanitize.min.js +39 -0
  176. data/solr/server/solr-webapp/webapp/libs/angular.js +26093 -0
  177. data/solr/server/solr-webapp/webapp/libs/angular.min.js +273 -0
  178. data/solr/server/solr-webapp/webapp/libs/chosen.jquery.js +1194 -0
  179. data/solr/server/solr-webapp/webapp/libs/chosen.jquery.min.js +30 -0
  180. data/solr/server/solr-webapp/webapp/libs/d3.js +9373 -0
  181. data/solr/server/solr-webapp/webapp/libs/highlight.js +31 -0
  182. data/solr/server/solr-webapp/webapp/libs/jquery-2.1.3.min.js +29 -0
  183. data/solr/server/solr-webapp/webapp/libs/jquery.jstree.js +3534 -0
  184. data/solr/server/solr-webapp/webapp/libs/ngtimeago.js +102 -0
  185. data/solr/server/solr-webapp/webapp/partials/analysis.html +128 -0
  186. data/solr/server/solr-webapp/webapp/partials/cloud.html +104 -0
  187. data/solr/server/solr-webapp/webapp/partials/core_overview.html +227 -0
  188. data/solr/server/solr-webapp/webapp/partials/cores.html +231 -0
  189. data/solr/server/solr-webapp/webapp/partials/dataimport.html +209 -0
  190. data/solr/server/solr-webapp/webapp/partials/documents.html +118 -0
  191. data/solr/server/solr-webapp/webapp/partials/files.html +47 -0
  192. data/solr/server/solr-webapp/webapp/partials/index.html +261 -0
  193. data/solr/server/solr-webapp/webapp/partials/java-properties.html +27 -0
  194. data/solr/server/solr-webapp/webapp/partials/logging-levels.html +56 -0
  195. data/solr/server/solr-webapp/webapp/partials/logging.html +56 -0
  196. data/solr/server/solr-webapp/webapp/partials/plugins.html +72 -0
  197. data/solr/server/solr-webapp/webapp/partials/query.html +356 -0
  198. data/solr/server/solr-webapp/webapp/partials/replication.html +239 -0
  199. data/solr/server/solr-webapp/webapp/partials/schema-browser.html +206 -0
  200. data/solr/server/solr-webapp/webapp/partials/segments.html +99 -0
  201. data/solr/server/solr-webapp/webapp/partials/threads.html +65 -0
  202. data/solr/server/solr-webapp/webapp/tpl/analysis.html +83 -83
  203. data/solr/server/solr-webapp/webapp/tpl/cloud.html +87 -87
  204. data/solr/server/solr-webapp/webapp/tpl/cores.html +226 -226
  205. data/solr/server/solr-webapp/webapp/tpl/dashboard.html +201 -201
  206. data/solr/server/solr-webapp/webapp/tpl/dataimport.html +183 -183
  207. data/solr/server/solr-webapp/webapp/tpl/documents.html +107 -107
  208. data/solr/server/solr-webapp/webapp/tpl/files.html +44 -44
  209. data/solr/server/solr-webapp/webapp/tpl/index.html +250 -250
  210. data/solr/server/solr-webapp/webapp/tpl/logging.html +23 -23
  211. data/solr/server/solr-webapp/webapp/tpl/plugins.html +39 -39
  212. data/solr/server/solr-webapp/webapp/tpl/query.html +361 -361
  213. data/solr/server/solr-webapp/webapp/tpl/replication.html +216 -216
  214. data/solr/server/solr-webapp/webapp/tpl/schema-browser.html +192 -192
  215. data/solr/server/solr-webapp/webapp/tpl/segments.html +49 -0
  216. data/solr/server/solr-webapp/webapp/tpl/threads.html +56 -56
  217. data/solr/server/solr/README.txt +77 -77
  218. data/solr/server/solr/solr.xml +51 -51
  219. data/solr/server/solr/zoo.cfg +17 -17
  220. data/solr/server/start.jar +0 -0
  221. data/spec/server_spec.rb +3 -8
  222. metadata +132 -43
  223. data/solr/server/lib/jetty-continuation-8.1.10.v20130312.jar +0 -0
  224. data/solr/server/lib/jetty-deploy-8.1.10.v20130312.jar +0 -0
  225. data/solr/server/lib/jetty-http-8.1.10.v20130312.jar +0 -0
  226. data/solr/server/lib/jetty-io-8.1.10.v20130312.jar +0 -0
  227. data/solr/server/lib/jetty-jmx-8.1.10.v20130312.jar +0 -0
  228. data/solr/server/lib/jetty-security-8.1.10.v20130312.jar +0 -0
  229. data/solr/server/lib/jetty-server-8.1.10.v20130312.jar +0 -0
  230. data/solr/server/lib/jetty-servlet-8.1.10.v20130312.jar +0 -0
  231. data/solr/server/lib/jetty-util-8.1.10.v20130312.jar +0 -0
  232. data/solr/server/lib/jetty-webapp-8.1.10.v20130312.jar +0 -0
  233. data/solr/server/lib/jetty-xml-8.1.10.v20130312.jar +0 -0
  234. data/solr/server/lib/servlet-api-3.0.jar +0 -0
  235. data/solr/server/solr-webapp/webapp/.gitignore +0 -1
  236. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-auth-2.3.0.jar +0 -0
  237. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-common-2.3.0.jar +0 -0
  238. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-hdfs-2.3.0.jar +0 -0
  239. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpclient-4.3.1.jar +0 -0
  240. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpcore-4.3.jar +0 -0
  241. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpmime-4.3.1.jar +0 -0
  242. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-backward-codecs-5.0.0.jar +0 -0
  243. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-codecs-5.0.0.jar +0 -0
  244. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-core-5.0.0.jar +0 -0
  245. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-highlighter-5.0.0.jar +0 -0
  246. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-join-5.0.0.jar +0 -0
  247. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-memory-5.0.0.jar +0 -0
  248. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-misc-5.0.0.jar +0 -0
  249. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-queries-5.0.0.jar +0 -0
  250. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-spatial-5.0.0.jar +0 -0
  251. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-suggest-5.0.0.jar +0 -0
  252. data/solr/server/solr-webapp/webapp/WEB-INF/lib/org.restlet-2.1.1.jar +0 -0
  253. data/solr/server/solr-webapp/webapp/WEB-INF/lib/org.restlet.ext.servlet-2.1.1.jar +0 -0
  254. data/solr/server/solr-webapp/webapp/WEB-INF/lib/solr-core-5.0.0.jar +0 -0
  255. data/solr/server/solr-webapp/webapp/WEB-INF/lib/solr-solrj-5.0.0.jar +0 -0
  256. data/solr/server/webapps/solr.war +0 -0
@@ -0,0 +1,99 @@
1
+ /*
2
+ Licensed to the Apache Software Foundation (ASF) under one or more
3
+ contributor license agreements. See the NOTICE file distributed with
4
+ this work for additional information regarding copyright ownership.
5
+ The ASF licenses this file to You under the Apache License, Version 2.0
6
+ (the "License"); you may not use this file except in compliance with
7
+ the License. You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ */
17
+
18
+ solrAdminApp.controller('QueryController',
19
+ function($scope, $routeParams, $location, Query){
20
+ $scope.resetMenu("query");
21
+
22
+ // @todo read URL parameters into scope
23
+ $scope.query = {wt: 'json', q:'*:*', indent:'on'};
24
+ $scope.filters = [{fq:""}];
25
+ $scope.dismax = {defType: "dismax"};
26
+ $scope.edismax = {defType: "edismax", stopwords: true, lowercaseOperators: true};
27
+ $scope.hl = {hl:"on"};
28
+ $scope.facet = {facet: "on"};
29
+ $scope.spatial = {};
30
+ $scope.spellcheck = {spellcheck:"on"};
31
+ $scope.qt = "/select";
32
+
33
+ $scope.doQuery = function() {
34
+ var params = {};
35
+
36
+ var set = function(key, value) {
37
+ if (params[key]) {
38
+ params[key].push(value);
39
+ } else {
40
+ params[key] = [value];
41
+ }
42
+ }
43
+ var copy = function(params, query) {
44
+ for (var key in query) {
45
+ terms = query[key];
46
+ if (terms.length > 0 && key[0]!="$") {
47
+ set(key, terms);
48
+ }
49
+ }
50
+ };
51
+
52
+ copy(params, $scope.query);
53
+
54
+ if ($scope.isDismax) copy(params, $scope.dismax);
55
+ if ($scope.isEdismax) copy(params, $scope.edismax);
56
+ if ($scope.isHighlight) copy(params, $scope.hl);
57
+ if ($scope.isFacet) copy(params, $scope.facet);
58
+ if ($scope.isSpatial) copy(params, $scope.spatial);
59
+ if ($scope.isSpellcheck) copy(params, $scope.spellcheck);
60
+
61
+ if ($scope.rawParams) {
62
+ for (var param in $scope.rawParams.split(/[&\n]/)) {
63
+ var parts = param.split("=");
64
+ set(parts[0], parts[1]);
65
+ }
66
+ }
67
+
68
+ var qt = $scope.qt ? $scope.qt : "select";
69
+
70
+ for (var filter in $scope.filters) {
71
+ copy(params, $scope.filters[filter]);
72
+ }
73
+
74
+ params.doNotIntercept=true;
75
+ params.core = $routeParams.core;
76
+ params.handler = qt;
77
+ var url = "/solr/" + $routeParams.core + qt + "?" + Query.url(params);
78
+ Query.query(params, function(data) {
79
+ $scope.lang = $scope.query.wt;
80
+ $scope.response = data;
81
+ $scope.url = $location.protocol() + "://" +
82
+ $location.host() + ":" +
83
+ $location.port() + url;
84
+ });
85
+ };
86
+
87
+ $scope.removeFilter = function(index) {
88
+ if ($scope.filters.length === 1) {
89
+ $scope.filters = [{fq: ""}];
90
+ } else {
91
+ $scope.filters.splice(index, 1);
92
+ }
93
+ };
94
+
95
+ $scope.addFilter = function(index) {
96
+ $scope.filters.splice(index+1, 0, {fq:""});
97
+ };
98
+ }
99
+ );
@@ -0,0 +1,227 @@
1
+ /*
2
+ Licensed to the Apache Software Foundation (ASF) under one or more
3
+ contributor license agreements. See the NOTICE file distributed with
4
+ this work for additional information regarding copyright ownership.
5
+ The ASF licenses this file to You under the Apache License, Version 2.0
6
+ (the "License"); you may not use this file except in compliance with
7
+ the License. You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ */
17
+
18
+ solrAdminApp.controller('ReplicationController',
19
+ function($scope, $rootScope, $routeParams, $interval, $timeout, Replication) {
20
+ $scope.resetMenu("replication");
21
+
22
+ $scope.iterationCount = 1;
23
+
24
+ $scope.refresh = function() {
25
+ Replication.details({core:$routeParams.core}, function(response) {
26
+ if ($scope.interval) $interval.cancel($scope.interval);
27
+ $scope.isSlave = (response.details.isSlave === 'true');
28
+ if ($scope.isSlave) {
29
+ $scope.progress = getProgressDetails(response.details.slave);
30
+ $scope.iterations = getIterations(response.details.slave);
31
+ $scope.versions = getSlaveVersions(response.details);
32
+ $scope.settings = getSlaveSettings(response.details);
33
+ if ($scope.settings.isReplicating) {
34
+ $timeout($scope.refresh, 1000);
35
+ } else if(!$scope.settings.isPollingDisabled && $scope.settings.pollInterval) {
36
+ $scope.interval = $interval(function() {
37
+ $scope.settings.tick--;
38
+ }, 1000, $scope.settings.tick);
39
+ $timeout($scope.refresh, 1000*(1+$scope.settings.tick));
40
+ }
41
+ } else {
42
+ $scope.versions = getMasterVersions(response.details);
43
+ }
44
+ $scope.master = getMasterSettings(response.details, $scope.isSlave);
45
+ });
46
+
47
+ };
48
+
49
+ $scope.execute = function(command) {
50
+ Replication.command({core:$routeParams.core, command:command}, function(data){$scope.refresh()});
51
+ }
52
+
53
+ $scope.showIterations = function() { $scope.iterationCount = 100000}; // limitTo should accept undefined, but doesn't work.
54
+ $scope.hideIterations = function() { $scope.iterationCount = 1};
55
+
56
+ $scope.refresh();
57
+ });
58
+
59
+ var getProgressDetails = function(progress) {
60
+
61
+ progress.timeRemaining = parseSeconds(progress.timeRemaining);
62
+ progress.totalPercent = parseInt(progress.totalPercent);
63
+ if (progress.totalPercent === 0) {
64
+ progress.totalPercentWidth = "1px";
65
+ } else {
66
+ progress.totalPercentWidth = progress.totalPercent + "%";
67
+ }
68
+ progress.currentFileSizePercent = parseInt(progress.currentFileSizePercent);
69
+
70
+ if (!progress.indexReplicatedAtList) {
71
+ progress.indexReplicatedAtList = [];
72
+ }
73
+
74
+ if (!progress.replicationFailedAtList) {
75
+ progress.replicationFailedAtList = [];
76
+ }
77
+ return progress;
78
+ };
79
+
80
+ var getIterations = function(slave) {
81
+
82
+ var iterations = [];
83
+
84
+ var find = function(list, date) {
85
+ return list.filter(function(e) {return e.date == date});
86
+ };
87
+
88
+ for (var i in slave.indexReplicatedAtList) {
89
+ var date = slave.indexReplicatedAtList[i];
90
+ var iteration = {date:date, status:"replicated", latest: false};
91
+ if (date == slave.indexReplicatedAt) {
92
+ iteration.latest = true;
93
+ }
94
+ iterations.push(iteration);
95
+ }
96
+
97
+ for (var i in slave.replicationFailedAtList) {
98
+ var failedDate = slave.replicationFailedAtList[i];
99
+ var matchingIterations = find(iterations, failedDate);
100
+ if (matchingIterations) {
101
+ iteration = matchingIterations[0];
102
+ } else {
103
+ iteration = {date: failedDate, latest:false};
104
+ iterations.push(iteration);
105
+ }
106
+ iteration.status = "failed";
107
+ if (failedDate == slave.replicationFailedAt) {
108
+ iteration.latest = true;
109
+ }
110
+ }
111
+ iterations.sort(function(a,b){ return a.date> b.date;}).reverse();
112
+ return iterations;
113
+ };
114
+
115
+ var getMasterVersions = function(data) {
116
+ versions = {masterSearch:{}, master:{}};
117
+
118
+ versions.masterSearch.version = data.indexVersion;
119
+ versions.masterSearch.generation = data.generation;
120
+ versions.masterSearch.size = data.indexSize;
121
+
122
+ versions.master.version = data.master.replicableVersion || '-';
123
+ versions.master.generation = data.master.replicableGeneration || '-';
124
+ versions.master.size = '-';
125
+
126
+ return versions;
127
+ };
128
+
129
+ var getSlaveVersions = function(data) {
130
+ versions = {masterSearch: {}, master: {}, slave: {}};
131
+
132
+ versions.slave.version = data.indexVersion;
133
+ versions.slave.generation = data.generation;
134
+ versions.slave.size = data.indexSize;
135
+
136
+ versions.master.version = data.slave.masterDetails.replicableVersion || '-';
137
+ versions.master.generation = data.slave.masterDetails.replicableGeneration || '-';
138
+ versions.master.size = '-';
139
+
140
+ versions.masterSearch.version = data.slave.masterDetails.indexVersion;
141
+ versions.masterSearch.generation = data.slave.masterDetails.generation;
142
+ versions.masterSearch.size = data.slave.masterDetails.indexSize;
143
+
144
+ versions.changedVersion = data.indexVersion !== data.slave.masterDetails.indexVersion;
145
+ versions.changedGeneration = data.generation !== data.slave.masterDetails.generation;
146
+
147
+ return versions;
148
+ };
149
+
150
+ var parseDateToEpoch = function(date) {
151
+ // ["Sat Mar 03 11:00:00 CET 2012", "Sat", "Mar", "03", "11:00:00", "CET", "2012"]
152
+ var parts = date.match( /^(\w+)\s+(\w+)\s+(\d+)\s+(\d+\:\d+\:\d+)\s+(\w+)\s+(\d+)$/ );
153
+
154
+ // "Sat Mar 03 2012 10:37:33"
155
+ var d = new Date( parts[1] + ' ' + parts[2] + ' ' + parts[3] + ' ' + parts[6] + ' ' + parts[4] );
156
+ return d.getTime();
157
+ }
158
+
159
+ var parseSeconds = function(time) {
160
+ var seconds = 0;
161
+ var arr = new String(time || '').split('.');
162
+ var parts = arr[0].split(':').reverse();
163
+
164
+ for (var i = 0; i < parts.length; i++) {
165
+ seconds += ( parseInt(parts[i], 10) || 0 ) * Math.pow(60, i);
166
+ }
167
+
168
+ if (arr[1] && 5 <= parseInt(arr[1][0], 10)) {
169
+ seconds++; // treat more or equal than .5 as additional second
170
+
171
+ }
172
+
173
+ return seconds;
174
+ }
175
+
176
+ var getSlaveSettings = function(data) {
177
+ var settings = {};
178
+ settings.masterUrl = data.slave.masterUrl;
179
+ settings.isPollingDisabled = data.slave.isPollingDisabled == 'true';
180
+ settings.pollInterval = data.slave.pollInterval;
181
+ settings.isReplicating = data.slave.isReplicating == 'true';
182
+ settings.nextExecutionAt = data.slave.nextExecutionAt;
183
+
184
+ if(settings.isReplicating) {
185
+ settings.isApprox = true;
186
+ settings.tick = parseSeconds(settings.pollInterval);
187
+ } else if (!settings.isPollingDisabled && settings.pollInterval) {
188
+ if( settings.nextExecutionAt ) {
189
+ settings.nextExecutionAtEpoch = parseDateToEpoch(settings.nextExecutionAt);
190
+ settings.currentTime = parseDateToEpoch(data.slave.currentDate);
191
+
192
+ if( settings.nextExecutionAtEpoch > settings.currentTime) {
193
+ settings.isApprox = false;
194
+ settings.tick = ( settings.nextExecutionAtEpoch - settings.currentTime) / 1000;
195
+ }
196
+ }
197
+ }
198
+ return settings;
199
+ };
200
+
201
+ var getMasterSettings = function(details, isSlave) {
202
+ var master = {};
203
+ var masterData = isSlave ? details.slave.masterDetails.master : details.master;
204
+ master.replicationEnabled = masterData.replicationEnabled == "true";
205
+ master.replicateAfter = masterData.replicateAfter.join(", ");
206
+
207
+ if (masterData.confFiles) {
208
+ master.files = [];
209
+ var confFiles = masterData.confFiles.split(',');
210
+ for (var i=0; i<confFiles.length; i++) {
211
+ var file = confFiles[i];
212
+ var short = file;
213
+ var title = file;
214
+ if (file.indexOf(":")>=0) {
215
+ title = file.replace(':', ' » ');
216
+ var parts = file.split(':');
217
+ if (isSlave) {
218
+ short = parts[1];
219
+ } else {
220
+ short = parts[0];
221
+ }
222
+ }
223
+ master.files.push({title:title, name:short});
224
+ }
225
+ }
226
+ return master;
227
+ }
@@ -0,0 +1,432 @@
1
+ /*
2
+ Licensed to the Apache Software Foundation (ASF) under one or more
3
+ contributor license agreements. See the NOTICE file distributed with
4
+ this work for additional information regarding copyright ownership.
5
+ The ASF licenses this file to You under the Apache License, Version 2.0
6
+ (the "License"); you may not use this file except in compliance with
7
+ the License. You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ */
17
+
18
+ var cookie_schema_browser_autoload = 'schema-browser_autoload';
19
+
20
+ solrAdminApp.controller('SchemaBrowserController',
21
+ function($scope, $routeParams, $location, $cookies, Luke) {
22
+ $scope.resetMenu("schema-browser");
23
+
24
+ $scope.refresh = function () {
25
+ Luke.schema({core: $routeParams.core}, function (schema) {
26
+ Luke.index({core: $routeParams.core}, function (index) {
27
+
28
+ var data = mergeIndexAndSchemaData(index, schema.schema);
29
+
30
+ $scope.fieldsAndTypes = getFieldsAndTypes(data);
31
+ $scope.is = {};
32
+
33
+ var search = $location.search();
34
+ leftbar = {};
35
+ $scope.isField = $scope.isDynamicField = $scope.isType = false;
36
+ if (search.field) {
37
+ $scope.selectedType = "Field";
38
+ $scope.is.field = true;
39
+ $scope.name = search.field;
40
+ leftbar.fields = [$scope.name];
41
+ var field = data.fields[$scope.name];
42
+ leftbar.types = [field.type];
43
+ if (field.dynamicBase) leftbar.dynamicFields = [field.dynamicBase];
44
+ if (field.copySources && field.copySources.length>0) leftbar.copyFieldSources = field.copySources.sort();
45
+ if (field.copyDests && field.copyDests.length>0) leftbar.copyFieldDests = field.copyDests.sort();
46
+ $scope.fieldOrType = "field=" + $scope.name;
47
+ } else if (search["dynamic-field"]) {
48
+ $scope.selectedType = "Dynamic Field";
49
+ $scope.is.dynamicField = true;
50
+ $scope.name = search["dynamic-field"];
51
+ leftbar.dynamicFields = [$scope.name];
52
+ leftbar.types = [data.dynamic_fields[$scope.name].type];
53
+ $scope.fieldOrType = "dynamic-field=" + $scope.name;
54
+ } else if (search.type) {
55
+ $scope.selectedType = "Type";
56
+ $scope.is.type = true;
57
+ $scope.name = search.type;
58
+ leftbar.types = [$scope.name];
59
+ leftbar.fields = filterFields("fields", data, $scope.name);
60
+ leftbar.dynamicFields = filterFields("dynamic_fields", data, $scope.name);
61
+ $scope.fieldOrType = "type=" + $scope.name;
62
+ }
63
+ $scope.leftbar = leftbar;
64
+ $scope.core = $routeParams.core;
65
+ $scope.defaultSearchField = data.default_search_field;
66
+ $scope.uniqueKeyField = data.unique_key_field;
67
+ $scope.isDefaultSearchField = ($scope.selectedType == "Field" && $scope.name == $scope.defaultSearchField);
68
+ $scope.isUniqueKeyField = ($scope.selectedType == "Field" && $scope.name == $scope.uniqueKeyField);
69
+
70
+ $scope.display = getFieldProperties(index, $routeParams.core, $scope.is, $scope.name);
71
+ $scope.analysis = getAnalysisInfo(data, $scope.is, $scope.name);
72
+
73
+ $scope.isAutoload = $cookies[cookie_schema_browser_autoload] == "true";
74
+ if ($scope.isAutoload) {
75
+ $scope.toggleTerms();
76
+ }
77
+ });
78
+ });
79
+ };
80
+ $scope.refresh();
81
+
82
+ $scope.selectFieldOrType = function() {
83
+ $location.search($scope.fieldOrType);
84
+ }
85
+
86
+ $scope.toggleAnalyzer = function(analyzer) {
87
+ analyzer.show = !analyzer.show;
88
+ }
89
+
90
+ $scope.loadTermInfo = function() {
91
+ var params = {fl: $scope.name, core: $routeParams.core};
92
+ if ($scope.topTermsCount) {
93
+ params.numTerms = $scope.topTermsCount;
94
+ }
95
+ $scope.isLoadingTerms = true;
96
+ Luke.field(params, function (data) {
97
+ $scope.isLoadingTerms = false;
98
+ $scope.termInfo = getTermInfo(data.fields[$scope.name]);
99
+ if (!$scope.topTermsCount) {
100
+ $scope.topTermsCount = $scope.termInfo.termCount;
101
+ }
102
+ });
103
+ }
104
+
105
+ $scope.toggleTerms = function() {
106
+ $scope.showTerms = !$scope.showTerms;
107
+
108
+ if ($scope.showTerms) {
109
+ $scope.loadTermInfo();
110
+ }
111
+ }
112
+
113
+ $scope.loadAllTerms = function() {
114
+ $scope.topTermsCount = $scope.termInfo.maxTerms;
115
+ $scope.loadTermInfo();
116
+ }
117
+
118
+ $scope.toggleAutoload = function() {
119
+ $scope.isAutoload = !$scope.isAutoload;
120
+ $cookies[cookie_schema_browser_autoload] = $scope.isAutoload;
121
+ console.log("cookie: " + $cookies[cookie_schema_browser_autoload]);
122
+ }
123
+ }
124
+ );
125
+
126
+ var getFieldsAndTypes = function(data) {
127
+ var fieldsAndTypes = [];
128
+ for (var field in data.fields) {
129
+ fieldsAndTypes.push({
130
+ group: "Fields",
131
+ value: "field=" + field,
132
+ label: field
133
+ });
134
+ }
135
+ for (var field in data.dynamic_fields) {
136
+ fieldsAndTypes.push({
137
+ group: "Dynamic Fields",
138
+ value: "dynamic-field=" + field,
139
+ label: field
140
+ });
141
+ }
142
+ for (var type in data.types) {
143
+ fieldsAndTypes.push({
144
+ group: "Types",
145
+ value: "type=" + type,
146
+ label: type
147
+ });
148
+ }
149
+ return fieldsAndTypes;
150
+ };
151
+
152
+ var filterFields = function(type, data, name) {
153
+ var fields = [];
154
+ for (var i in data.types[name].fields) {
155
+ var field = data.types[name].fields[i];
156
+ if (data[type][field]) {
157
+ fields.push(field)
158
+ }
159
+ }
160
+ return fields.sort();
161
+ }
162
+
163
+ var mergeIndexAndSchemaData = function(index, schema) {
164
+
165
+ var data = {
166
+ default_search_field: null,
167
+ unique_key_field: null,
168
+ key: {},
169
+ fields: {},
170
+ dynamic_fields: {},
171
+ types: {},
172
+ relations: {
173
+ f_df: {},
174
+ f_t: {},
175
+ df_f: {},
176
+ df_t: {},
177
+ t_f: {},
178
+ t_df: {}
179
+ }
180
+ };
181
+
182
+ data.fields = index.fields;
183
+
184
+ data.key = index.info.key;
185
+
186
+ data.default_search_field = schema.defaultSearchField;
187
+ data.unique_key_field = schema.uniqueKeyField;
188
+
189
+ data.dynamic_fields = schema.dynamicFields;
190
+ data.types = schema.types;
191
+
192
+ for (var field in schema.fields) {
193
+ data.fields[field] =
194
+ $.extend({}, data.fields[field], schema.fields[field]);
195
+ }
196
+
197
+ for (var field in data.fields) {
198
+ var copy_dests = data.fields[field].copyDests;
199
+ for (var i in copy_dests) {
200
+ var copy_dest = copy_dests[i];
201
+ if (!data.fields[copy_dest]) {
202
+ data.fields[copy_dest] = {
203
+ partial: true,
204
+ copySources: []
205
+ };
206
+ }
207
+
208
+ if (data.fields[copy_dest].partial) {
209
+ data.fields[copy_dest].copySources.push(field);
210
+ }
211
+ }
212
+
213
+ var copy_sources = data.fields[field].copySources;
214
+ for (var i in copy_sources) {
215
+ var copy_source = copy_sources[i];
216
+ if (!data.fields[copy_source]) {
217
+ data.fields[copy_source] = {
218
+ partial: true,
219
+ copyDests: []
220
+ };
221
+ }
222
+
223
+ if (data.fields[copy_source].partial) {
224
+ data.fields[copy_source].copyDests.push(field);
225
+ }
226
+ }
227
+
228
+ data.relations.f_t[field] = data.fields[field].type;
229
+
230
+ if (!data.relations.t_f[data.fields[field].type]) {
231
+ data.relations.t_f[data.fields[field].type] = [];
232
+ }
233
+ data.relations.t_f[data.fields[field].type].push(field);
234
+
235
+ if (data.fields[field].dynamicBase) {
236
+ data.relations.f_df[field] = data.fields[field].dynamicBase;
237
+
238
+ if (!data.relations.df_f[data.fields[field].dynamicBase]) {
239
+ data.relations.df_f[data.fields[field].dynamicBase] = [];
240
+ }
241
+ data.relations.df_f[data.fields[field].dynamicBase].push(field);
242
+ }
243
+ }
244
+
245
+ for (var dynamic_field in data.dynamic_fields) {
246
+ data.relations.df_t[dynamic_field] = data.dynamic_fields[dynamic_field].type;
247
+
248
+ if (!data.relations.t_df[data.dynamic_fields[dynamic_field].type]) {
249
+ data.relations.t_df[data.dynamic_fields[dynamic_field].type] = [];
250
+ }
251
+ data.relations.t_df[data.dynamic_fields[dynamic_field].type].push(dynamic_field);
252
+ }
253
+ return data;
254
+ };
255
+
256
+ var getFieldProperties = function(data, core, is, field) {
257
+
258
+ var display = {};
259
+
260
+ display.partialState = is.field && !!data.fields[field].partial;
261
+
262
+ display.columns = [];
263
+ display.rows = [];
264
+ var allFlags = "";
265
+
266
+ var addRow = function(name, flags) {
267
+ if (flags[0]!='(') {
268
+ display.rows.push({name:name, flags:flags});
269
+ for (var i in flags) {
270
+ if (flags[i]!="-" && allFlags.indexOf(flags[i])<0) {
271
+ allFlags+=flags[i];
272
+ }
273
+ }
274
+ } else {
275
+ display.rows.push({name:name, comment:flags});
276
+ }
277
+ }
278
+
279
+ // Identify the rows for our field property table
280
+ if (is.field && data.fields[field]) {
281
+ if (data.fields[field].flags) {
282
+ addRow('Properties', data.fields[field].flags);
283
+ }
284
+ if (data.fields[field].schema) {
285
+ addRow('Schema', data.fields[field].schema);
286
+ }
287
+ if (data.fields[field].index) {
288
+ addRow('Index', data.fields[field].index);
289
+ }
290
+ display.docs = data.fields[field].docs;
291
+ display.docsUrl = "#/" + core + "/query?q=" + field + ":[* TO *]";
292
+ display.distinct = data.fields[field].distinct;
293
+ display.positionIncrementGap = data.fields[field].positionIncrementGap;
294
+ display.similarity = data.fields[field].similarity;
295
+ } else if (is.dynamicField && data.dynamic_fields[field] && data.dynamic_fields[field].flags) {
296
+ addRow('Properties', data.dynamic_fields[field].flags);
297
+ }
298
+
299
+ // identify columns in field property table:
300
+ for (var key in data.info.key) {
301
+ if (allFlags.indexOf(key)>=0) {
302
+ display.columns.push({key: key, name: data.info.key[key]});
303
+ }
304
+ }
305
+
306
+ // identify rows and cell values in field property table:
307
+ for (var i in display.rows) {
308
+ var row = display.rows[i];
309
+ row.cells = [];
310
+
311
+ for (var j in display.columns) {
312
+ var flag = display.columns[j].key;
313
+ row.cells.push({key: flag, value: row.flags.indexOf(flag)>=0});
314
+ }
315
+ }
316
+
317
+ return display;
318
+ };
319
+
320
+ var getAnalysisInfo = function(data, is, name) {
321
+
322
+ var analysis = {};
323
+
324
+ if (is.field) {
325
+ var type = data.relations.f_t[name];
326
+ analysis.query = "analysis.fieldname=" + name;
327
+ }
328
+ else if (is.dynamicField) {
329
+ var type = data.relations.df_t[name];
330
+ analysis.query = "analysis.fieldtype=" + type;
331
+ }
332
+ else if (is.type) {
333
+ var type = name;
334
+ analysis.query = "analysis.fieldtype=" + name;
335
+ }
336
+
337
+ var processComponentType = function (label, key, componentTypeData) {
338
+ if (componentTypeData) {
339
+ var components = [];
340
+ console.dir(componentTypeData);
341
+ for (var componentName in componentTypeData) {
342
+ console.log(componentName);
343
+ var componentData = componentTypeData[componentName];
344
+ var component = {className: componentData.className, args:[]};
345
+ if (componentData.args) {
346
+ for (var argName in componentData.args) {
347
+ var argValue = componentData.args[argName];
348
+ if (argValue == "1" || argValue == "true") {
349
+ component.args.push({name: argName, booleanValue:true});
350
+ } else if (argValue == "0" || argValue == "false") {
351
+ component.args.push({name: argName, booleanValue:false});
352
+ } else {
353
+ component.args.push({name: argName, value:argValue});
354
+ }
355
+ }
356
+ }
357
+ components.push(component);
358
+ }
359
+ return {label: label, key: key, components: components};
360
+ } else {
361
+ return {label: label, key: key};
362
+ }
363
+ }
364
+
365
+ var buildAnalyzer = function (analyzerData) {
366
+ var analyzer = {};
367
+ analyzer.className = analyzerData.className;
368
+ analyzer.componentTypes = [];
369
+ if (analyzerData.tokenizer) {
370
+ analyzer.componentTypes.push(processComponentType("Char Filters", "charFilters", analyzerData.charFilters));
371
+ analyzer.componentTypes.push(processComponentType("Tokenizer", "tokenizer", {tokenizer: analyzerData.tokenizer}));
372
+ analyzer.componentTypes.push(processComponentType("Token Filters", "tokenFilters", analyzerData.filters));
373
+ }
374
+ return analyzer;
375
+ }
376
+
377
+ analysis.data = data.types[type];
378
+ if (analysis.data) {
379
+ analysis.analyzers = [
380
+ {key: "index", name: "Index", detail: buildAnalyzer(analysis.data.indexAnalyzer)},
381
+ {key: "query", name: "Query", detail: buildAnalyzer(analysis.data.queryAnalyzer)}
382
+ ];
383
+ }
384
+ return analysis;
385
+ }
386
+
387
+ var getTermInfo = function(data) {
388
+
389
+ var termInfo = {};
390
+ if (data && data.topTerms) {
391
+ termInfo.topTerms = [];
392
+
393
+ var currentGroup = {count: 0}
394
+ for (var i = 0; i < data.topTerms.length; i += 2) {
395
+ var count = data.topTerms[i + 1];
396
+ if (currentGroup.count != count) {
397
+ currentGroup = {count: count, terms: []};
398
+ termInfo.topTerms.push(currentGroup);
399
+ }
400
+ currentGroup.terms.push(data.topTerms[i]);
401
+ }
402
+ termInfo.termCount = data.topTerms.length / 2;
403
+ termInfo.maxTerms = data.distinct;
404
+ }
405
+
406
+ if(data && data.histogram) {
407
+ termInfo.histogram = [];
408
+ termInfo.histogramMax = 0;
409
+ for (var i = 0; i < data.histogram.length; i += 2) {
410
+ termInfo.histogram.push({key: data.histogram[i], value: data.histogram[i + 1]});
411
+ termInfo.histogramMax = Math.max(termInfo.histogramMax, data.histogram[i + 1]);
412
+ }
413
+ }
414
+ return termInfo;
415
+ };
416
+
417
+ /*
418
+ var get_width = function get_width()
419
+ {
420
+ return $( this ).width();
421
+ }
422
+
423
+ var max_width = 10 + Math.max.apply( Math, $( 'p', topterms_table_element ).map( get_width ).get() );
424
+ topterms:
425
+ p { width: {{maxWidth}}px !important; }
426
+ ul { margin-left: {{max_width + 5 }}px !important; }
427
+
428
+ var max_width = 10 + Math.max.apply( Math, $( 'dt', histogram_holder_element ).map( get_width ).get() );
429
+ histogram_holder:
430
+ ul { margin-left: {{maxWidth}}px !important; }
431
+ li dt { left: {{-maxWidth}}px !important; width: {{maxWidth}}px !important; }
432
+ */