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
data/solr/bin/solr.cmd CHANGED
@@ -18,6 +18,8 @@
18
18
 
19
19
  IF "%OS%"=="Windows_NT" setlocal enabledelayedexpansion enableextensions
20
20
 
21
+ set "PASS_TO_RUN_EXAMPLE="
22
+
21
23
  REM Determine top-level Solr directory
22
24
  set SDIR=%~dp0
23
25
  IF "%SDIR:~-1%"=="\" set SDIR=%SDIR:~0,-1%
@@ -36,10 +38,30 @@ REM command line args
36
38
  IF "%SOLR_INCLUDE%"=="" set "SOLR_INCLUDE=%SOLR_TIP%\bin\solr.in.cmd"
37
39
  IF EXIST "%SOLR_INCLUDE%" CALL "%SOLR_INCLUDE%"
38
40
 
39
- REM URL scheme for contacting Solr
41
+ REM Select HTTP OR HTTPS related configurations
40
42
  set SOLR_URL_SCHEME=http
41
- IF DEFINED SOLR_SSL_OPTS set SOLR_URL_SCHEME=https
42
- IF NOT DEFINED SOLR_SSL_OPTS set SOLR_SSL_OPTS=
43
+ set "SOLR_JETTY_CONFIG=--module=http"
44
+ set "SOLR_SSL_OPTS= "
45
+ IF DEFINED SOLR_SSL_KEY_STORE (
46
+ set "SOLR_JETTY_CONFIG=--module=https"
47
+ set SOLR_URL_SCHEME=https
48
+ set "SCRIPT_ERROR=Solr server directory %SOLR_SERVER_DIR% not found!"
49
+ set "SOLR_SSL_OPTS=-Dsolr.jetty.keystore=%SOLR_SSL_KEY_STORE% -Dsolr.jetty.keystore.password=%SOLR_SSL_KEY_STORE_PASSWORD% -Dsolr.jetty.truststore=%SOLR_SSL_TRUST_STORE% -Dsolr.jetty.truststore.password=%SOLR_SSL_TRUST_STORE_PASSWORD% -Dsolr.jetty.ssl.needClientAuth=%SOLR_SSL_NEED_CLIENT_AUTH% -Dsolr.jetty.ssl.wantClientAuth=%SOLR_SSL_WANT_CLIENT_AUTH%"
50
+ IF DEFINED SOLR_SSL_CLIENT_KEY_STORE (
51
+ set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Djavax.net.ssl.keyStore=%SOLR_SSL_CLIENT_KEY_STORE% -Djavax.net.ssl.keyStorePassword=%SOLR_SSL_CLIENT_KEY_STORE_PASSWORD% -Djavax.net.ssl.trustStore=%SOLR_SSL_CLIENT_TRUST_STORE% -Djavax.net.ssl.trustStorePassword=%SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD%"
52
+ ) ELSE (
53
+ set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Djavax.net.ssl.keyStore=%SOLR_SSL_KEY_STORE% -Djavax.net.ssl.keyStorePassword=%SOLR_SSL_KEY_STORE_PASSWORD% -Djavax.net.ssl.trustStore=%SOLR_SSL_TRUST_STORE% -Djavax.net.ssl.trustStorePassword=%SOLR_SSL_TRUST_STORE_PASSWORD%"
54
+ )
55
+ ) ELSE (
56
+ set SOLR_SSL_OPTS=
57
+ )
58
+
59
+ REM Set the SOLR_TOOL_HOST variable for use when connecting to a running Solr instance
60
+ IF NOT "%SOLR_HOST%"=="" (
61
+ set "SOLR_TOOL_HOST=%SOLR_HOST%"
62
+ ) ELSE (
63
+ set "SOLR_TOOL_HOST=localhost"
64
+ )
43
65
 
44
66
  REM Verify Java is available
45
67
  IF DEFINED SOLR_JAVA_HOME set "JAVA_HOME=%SOLR_JAVA_HOME%"
@@ -58,7 +80,7 @@ IF NOT EXIST "%JAVA_HOME%\bin\java.exe" (
58
80
  goto err
59
81
  )
60
82
  set "JAVA=%JAVA_HOME%\bin\java"
61
- CALL :resolve_java_version
83
+ CALL :resolve_java_info
62
84
  IF !JAVA_MAJOR_VERSION! LSS 7 (
63
85
  set "SCRIPT_ERROR=Java 1.7 or later is required to run Solr. Current Java version is: !JAVA_VERSION_INFO!"
64
86
  goto err
@@ -168,9 +190,9 @@ goto done
168
190
  @echo -s dir Sets the solr.solr.home system property; Solr will create core directories under
169
191
  @echo this directory. This allows you to run multiple Solr instances on the same host
170
192
  @echo while reusing the same server directory set using the -d parameter. If set, the
171
- @echo specified directory should contain a solr.xml file. The default value is example/solr.
193
+ @echo specified directory should contain a solr.xml file, unless solr.xml exists in ZooKeeper.
172
194
  @echo This parameter is ignored when running examples (-e), as the solr.solr.home depends
173
- @echo on which example is run.
195
+ @echo on which example is run. The default value is server/solr.
174
196
  @echo.
175
197
  @echo -e example Name of the example to run; available examples:
176
198
  @echo cloud: SolrCloud example
@@ -358,6 +380,7 @@ goto parse_args
358
380
 
359
381
  :set_verbose
360
382
  set verbose=1
383
+ set "PASS_TO_RUN_EXAMPLE=--verbose !PASS_TO_RUN_EXAMPLE!"
361
384
  SHIFT
362
385
  goto parse_args
363
386
 
@@ -441,6 +464,7 @@ IF "%firstChar%"=="-" (
441
464
  )
442
465
 
443
466
  set SOLR_HEAP=%~2
467
+ set "PASS_TO_RUN_EXAMPLE=-m %~2 !PASS_TO_RUN_EXAMPLE!"
444
468
  SHIFT
445
469
  SHIFT
446
470
  goto parse_args
@@ -459,6 +483,7 @@ IF "%firstChar%"=="-" (
459
483
  )
460
484
 
461
485
  set SOLR_HOST=%~2
486
+ set "PASS_TO_RUN_EXAMPLE=-h %~2 !PASS_TO_RUN_EXAMPLE!"
462
487
  SHIFT
463
488
  SHIFT
464
489
  goto parse_args
@@ -477,6 +502,7 @@ IF "%firstChar%"=="-" (
477
502
  )
478
503
 
479
504
  set SOLR_PORT=%~2
505
+ set "PASS_TO_RUN_EXAMPLE=-p %~2 !PASS_TO_RUN_EXAMPLE!"
480
506
  SHIFT
481
507
  SHIFT
482
508
  goto parse_args
@@ -518,6 +544,7 @@ IF "%firstChar%"=="-" (
518
544
  )
519
545
 
520
546
  set "ZK_HOST=%~2"
547
+ set "PASS_TO_RUN_EXAMPLE=-z %~2 !PASS_TO_RUN_EXAMPLE!"
521
548
  SHIFT
522
549
  SHIFT
523
550
  goto parse_args
@@ -536,12 +563,15 @@ IF NOT "%SOLR_OPTS%"=="" (
536
563
  ) ELSE (
537
564
  set "SOLR_OPTS=%PASSTHRU%"
538
565
  )
566
+ set "PASS_TO_RUN_EXAMPLE=%PASSTHRU% !PASS_TO_RUN_EXAMPLE!"
539
567
  SHIFT
540
568
  SHIFT
541
569
  goto parse_args
542
570
 
543
571
  :set_noprompt
544
572
  set NO_USER_PROMPT=1
573
+ set "PASS_TO_RUN_EXAMPLE=-noprompt !PASS_TO_RUN_EXAMPLE!"
574
+
545
575
  SHIFT
546
576
  goto parse_args
547
577
 
@@ -568,37 +598,7 @@ IF NOT EXIST "%SOLR_SERVER_DIR%" (
568
598
  goto err
569
599
  )
570
600
 
571
- IF "%EXAMPLE%"=="" (
572
- REM SOLR_HOME just becomes serverDir/solr
573
- ) ELSE IF "%EXAMPLE%"=="techproducts" (
574
- mkdir "%SOLR_TIP%\example\techproducts\solr"
575
- set "SOLR_HOME=%SOLR_TIP%\example\techproducts\solr"
576
- IF NOT EXIST "!SOLR_HOME!\solr.xml" (
577
- copy "%DEFAULT_SERVER_DIR%\solr\solr.xml" "!SOLR_HOME!\solr.xml"
578
- )
579
- IF NOT EXIST "!SOLR_HOME!\zoo.cfg" (
580
- copy "%DEFAULT_SERVER_DIR%\solr\zoo.cfg" "!SOLR_HOME!\zoo.cfg"
581
- )
582
- ) ELSE IF "%EXAMPLE%"=="cloud" (
583
- set SOLR_MODE=solrcloud
584
- goto cloud_example_start
585
- ) ELSE IF "%EXAMPLE%"=="dih" (
586
- set "SOLR_HOME=%SOLR_TIP%\example\example-DIH\solr"
587
- ) ELSE IF "%EXAMPLE%"=="schemaless" (
588
- mkdir "%SOLR_TIP%\example\schemaless\solr"
589
- set "SOLR_HOME=%SOLR_TIP%\example\schemaless\solr"
590
- IF NOT EXIST "!SOLR_HOME!\solr.xml" (
591
- copy "%DEFAULT_SERVER_DIR%\solr\solr.xml" "!SOLR_HOME!\solr.xml"
592
- )
593
- IF NOT EXIST "!SOLR_HOME!\zoo.cfg" (
594
- copy "%DEFAULT_SERVER_DIR%\solr\zoo.cfg" "!SOLR_HOME!\zoo.cfg"
595
- )
596
- ) ELSE (
597
- @echo.
598
- @echo 'Unrecognized example %EXAMPLE%!'
599
- @echo.
600
- goto start_usage
601
- )
601
+ IF NOT "%EXAMPLE%"=="" goto run_example
602
602
 
603
603
  :start_solr
604
604
  IF "%SOLR_HOME%"=="" set "SOLR_HOME=%SOLR_SERVER_DIR%\solr"
@@ -613,11 +613,6 @@ IF NOT EXIST "%SOLR_HOME%\" (
613
613
  )
614
614
  )
615
615
 
616
- IF NOT EXIST "%SOLR_HOME%\solr.xml" (
617
- set "SCRIPT_ERROR=Solr home directory %SOLR_HOME% must contain solr.xml!"
618
- goto err
619
- )
620
-
621
616
  IF "%STOP_KEY%"=="" set STOP_KEY=solrrocks
622
617
 
623
618
  @REM This is quite hacky, but examples rely on a different log4j.properties
@@ -694,7 +689,7 @@ IF "%SCRIPT_CMD%"=="stop" (
694
689
  set found_it=1
695
690
  @echo Stopping Solr process %%N running on port %SOLR_PORT%
696
691
  set /A STOP_PORT=%SOLR_PORT% - 1000
697
- "%JAVA%" %SOLR_SSL_OPTS% -Djetty.home="%SOLR_SERVER_DIR%" -jar "%SOLR_SERVER_DIR%\start.jar" STOP.PORT=!STOP_PORT! STOP.KEY=%STOP_KEY% --stop
692
+ "%JAVA%" %SOLR_SSL_OPTS% -Djetty.home="%SOLR_SERVER_DIR%" -jar "%SOLR_SERVER_DIR%\start.jar" "%SOLR_JETTY_CONFIG%" STOP.PORT=!STOP_PORT! STOP.KEY=%STOP_KEY% --stop
698
693
  del "%SOLR_TIP%"\bin\solr-%SOLR_PORT%.port
699
694
  timeout /T 5
700
695
  REM Kill it if it is still running after the graceful shutdown
@@ -771,6 +766,8 @@ IF EXIST "!SOLR_LOGS_DIR!\solr_gc.log" (
771
766
  move /Y "!SOLR_LOGS_DIR!\solr_gc.log" "!SOLR_LOGS_DIR!\solr_gc_log_!now_ts!"
772
767
  )
773
768
 
769
+ IF NOT "%ZK_HOST%"=="" set SOLR_MODE=solrcloud
770
+
774
771
  IF "%SOLR_MODE%"=="solrcloud" (
775
772
  IF "%ZK_CLIENT_TIMEOUT%"=="" set "ZK_CLIENT_TIMEOUT=15000"
776
773
 
@@ -785,6 +782,10 @@ IF "%SOLR_MODE%"=="solrcloud" (
785
782
  IF EXIST "%SOLR_HOME%\collection1\core.properties" set "CLOUD_MODE_OPTS=!CLOUD_MODE_OPTS! -Dbootstrap_confdir=./solr/collection1/conf -Dcollection.configName=myconf -DnumShards=1"
786
783
  ) ELSE (
787
784
  set CLOUD_MODE_OPTS=
785
+ IF NOT EXIST "%SOLR_HOME%\solr.xml" (
786
+ set "SCRIPT_ERROR=Solr home directory %SOLR_HOME% must contain solr.xml!"
787
+ goto err
788
+ )
788
789
  )
789
790
 
790
791
  REM These are useful for attaching remove profilers like VisualVM/JConsole
@@ -849,7 +850,7 @@ IF "%verbose%"=="1" (
849
850
  @echo.
850
851
  )
851
852
 
852
- set START_OPTS=-Duser.timezone=%SOLR_TIMEZONE% -Djava.net.preferIPv4Stack=true
853
+ set START_OPTS=-Duser.timezone=%SOLR_TIMEZONE%
853
854
  set START_OPTS=%START_OPTS% !GC_TUNE! %GC_LOG_OPTS%
854
855
  IF NOT "!CLOUD_MODE_OPTS!"=="" set "START_OPTS=%START_OPTS% !CLOUD_MODE_OPTS!"
855
856
  IF NOT "%REMOTE_JMX_OPTS%"=="" set "START_OPTS=%START_OPTS% %REMOTE_JMX_OPTS%"
@@ -857,8 +858,7 @@ IF NOT "%SOLR_ADDL_ARGS%"=="" set "START_OPTS=%START_OPTS% %SOLR_ADDL_ARGS%"
857
858
  IF NOT "%SOLR_HOST_ARG%"=="" set "START_OPTS=%START_OPTS% %SOLR_HOST_ARG%"
858
859
  IF NOT "%SOLR_OPTS%"=="" set "START_OPTS=%START_OPTS% %SOLR_OPTS%"
859
860
  IF NOT "%SOLR_SSL_OPTS%"=="" (
860
- set "SSL_PORT_PROP=-Djetty.ssl.port=%SOLR_PORT%"
861
- IF DEFINED SOLR_SSL_PORT set "SSL_PORT_PROP=-Djetty.ssl.port=%SOLR_SSL_PORT%"
861
+ set "SSL_PORT_PROP=-Dsolr.jetty.https.port=%SOLR_PORT%"
862
862
  set "START_OPTS=%START_OPTS% %SOLR_SSL_OPTS% !SSL_PORT_PROP!"
863
863
  )
864
864
 
@@ -874,218 +874,41 @@ IF NOT EXIST "%SOLR_SERVER_DIR%\tmp" (
874
874
  mkdir "%SOLR_SERVER_DIR%\tmp"
875
875
  )
876
876
 
877
- @echo.
878
- CALL :safe_echo "Starting Solr on port %SOLR_PORT% from %SOLR_SERVER_DIR%"
879
- @echo.
877
+ IF "%JAVA_VENDOR%" == "IBM J9" (
878
+ set "GCLOG_OPT=-Xverbosegclog"
879
+ ) else (
880
+ set "GCLOG_OPT=-Xloggc"
881
+ )
882
+
880
883
  IF "%FG%"=="1" (
881
884
  REM run solr in the foreground
882
885
  title "Solr-%SOLR_PORT%"
883
886
  echo %SOLR_PORT%>"%SOLR_TIP%"\bin\solr-%SOLR_PORT%.port
884
- "%JAVA%" %SERVEROPT% -Xss256k %SOLR_JAVA_MEM% %START_OPTS% -Xloggc:"!SOLR_LOGS_DIR!"/solr_gc.log -Dlog4j.configuration="%LOG4J_CONFIG%" -DSTOP.PORT=!STOP_PORT! -DSTOP.KEY=%STOP_KEY% ^
885
- -Djetty.port=%SOLR_PORT% -Dsolr.solr.home="%SOLR_HOME%" -Dsolr.install.dir="%SOLR_TIP%" -Djetty.home="%SOLR_SERVER_DIR%" -Djava.io.tmpdir="%SOLR_SERVER_DIR%\tmp" -jar start.jar
887
+ "%JAVA%" %SERVEROPT% -Xss256k %SOLR_JAVA_MEM% %START_OPTS% %GCLOG_OPT%:"!SOLR_LOGS_DIR!"/solr_gc.log -Dlog4j.configuration="%LOG4J_CONFIG%" -DSTOP.PORT=!STOP_PORT! -DSTOP.KEY=%STOP_KEY% ^
888
+ -Djetty.port=%SOLR_PORT% -Dsolr.solr.home="%SOLR_HOME%" -Dsolr.install.dir="%SOLR_TIP%" -Djetty.home="%SOLR_SERVER_DIR%" -Djava.io.tmpdir="%SOLR_SERVER_DIR%\tmp" -jar start.jar "%SOLR_JETTY_CONFIG%"
886
889
  ) ELSE (
887
- START /B "Solr-%SOLR_PORT%" /D "%SOLR_SERVER_DIR%" "%JAVA%" %SERVEROPT% -Xss256k %SOLR_JAVA_MEM% %START_OPTS% -Xloggc:"!SOLR_LOGS_DIR!"/solr_gc.log -Dlog4j.configuration="%LOG4J_CONFIG%" -DSTOP.PORT=!STOP_PORT! -DSTOP.KEY=%STOP_KEY% ^
888
- -Djetty.port=%SOLR_PORT% -Dsolr.solr.home="%SOLR_HOME%" -Dsolr.install.dir="%SOLR_TIP%" -Djetty.home="%SOLR_SERVER_DIR%" -Djava.io.tmpdir="%SOLR_SERVER_DIR%\tmp" -jar start.jar > "!SOLR_LOGS_DIR!\solr-%SOLR_PORT%-console.log"
890
+ START /B "Solr-%SOLR_PORT%" /D "%SOLR_SERVER_DIR%" "%JAVA%" %SERVEROPT% -Xss256k %SOLR_JAVA_MEM% %START_OPTS% %GCLOG_OPT%:"!SOLR_LOGS_DIR!"/solr_gc.log -Dlog4j.configuration="%LOG4J_CONFIG%" -DSTOP.PORT=!STOP_PORT! -DSTOP.KEY=%STOP_KEY% ^
891
+ -Djetty.port=%SOLR_PORT% -Dsolr.solr.home="%SOLR_HOME%" -Dsolr.install.dir="%SOLR_TIP%" -Djetty.home="%SOLR_SERVER_DIR%" -Djava.io.tmpdir="%SOLR_SERVER_DIR%\tmp" -jar start.jar "%SOLR_JETTY_CONFIG%" > "!SOLR_LOGS_DIR!\solr-%SOLR_PORT%-console.log"
889
892
  echo %SOLR_PORT%>"%SOLR_TIP%"\bin\solr-%SOLR_PORT%.port
890
- )
891
-
892
- set EXAMPLE_NAME=%EXAMPLE%
893
- set CREATE_EXAMPLE_CONFIG=
894
- IF "%EXAMPLE%"=="schemaless" (
895
- set EXAMPLE_NAME=gettingstarted
896
- set CREATE_EXAMPLE_CONFIG=data_driven_schema_configs
897
- )
898
- IF "%EXAMPLE%"=="techproducts" (
899
- set CREATE_EXAMPLE_CONFIG=sample_techproducts_configs
900
- )
901
893
 
902
- IF NOT "!CREATE_EXAMPLE_CONFIG!"=="" (
903
- timeout /T 10
904
- IF "%SOLR_MODE%"=="solrcloud" (
905
- "%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
906
- -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
907
- org.apache.solr.util.SolrCLI create_collection -name !EXAMPLE_NAME! -shards 1 -replicationFactor 1 ^
908
- -confdir !CREATE_EXAMPLE_CONFIG! -configsetsDir "%SOLR_SERVER_DIR%\solr\configsets" -solrUrl !SOLR_URL_SCHEME!://localhost:%SOLR_PORT%/solr
909
- ) ELSE (
910
- "%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
911
- -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
912
- org.apache.solr.util.SolrCLI create_core -name !EXAMPLE_NAME! -solrUrl !SOLR_URL_SCHEME!://localhost:%SOLR_PORT%/solr ^
913
- -confdir !CREATE_EXAMPLE_CONFIG! -configsetsDir "%SOLR_SERVER_DIR%\solr\configsets"
914
- )
915
- )
916
-
917
- IF "%EXAMPLE%"=="techproducts" (
918
- @echo.
919
- @echo Indexing tech product example docs from "%SOLR_TIP%\example\exampledocs"
920
- "%JAVA%" %SOLR_SSL_OPTS% -Durl=!SOLR_URL_SCHEME!://localhost:%SOLR_PORT%/solr/%EXAMPLE%/update -jar "%SOLR_TIP%/example/exampledocs/post.jar" "%SOLR_TIP%/example/exampledocs/*.xml"
921
- )
922
-
923
- @echo.
924
- IF NOT "%EXAMPLE%"=="" (
925
- @echo Solr %EXAMPLE% example launched successfully.
894
+ REM now wait to see Solr come online ...
895
+ "%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
896
+ -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
897
+ org.apache.solr.util.SolrCLI status -maxWaitSecs 30 -solr !SOLR_URL_SCHEME!://%SOLR_TOOL_HOST%:%SOLR_PORT%/solr
926
898
  )
927
- @echo Direct your Web browser to !SOLR_URL_SCHEME!://localhost:%SOLR_PORT%/solr to visit the Solr Admin UI
928
- @echo.
929
899
 
930
900
  goto done
931
901
 
932
- :cloud_example_start
933
- REM Launch interactive session to guide the user through the SolrCloud example
934
-
935
- CLS
936
- @echo.
937
- @echo Welcome to the SolrCloud example
938
- @echo.
939
- @echo.
940
-
941
- IF "%NO_USER_PROMPT%"=="1" (
942
- set CLOUD_NUM_NODES=2
943
- @echo Starting up %CLOUD_NUM_NODES% Solr nodes for your example SolrCloud cluster.
944
- goto start_cloud_nodes
945
- ) ELSE (
946
- @echo This interactive session will help you launch a SolrCloud cluster on your local workstation.
947
- @echo.
948
- SET /P "USER_INPUT=To begin, how many Solr nodes would you like to run in your local cluster (specify 1-4 nodes) [2]: "
949
- goto while_num_nodes_not_valid
950
- )
951
-
952
- :while_num_nodes_not_valid
953
- IF "%USER_INPUT%"=="" set USER_INPUT=2
954
- SET /A INPUT_AS_NUM=!USER_INPUT!*1
955
- IF %INPUT_AS_NUM% GEQ 1 IF %INPUT_AS_NUM% LEQ 4 set CLOUD_NUM_NODES=%INPUT_AS_NUM%
956
- IF NOT DEFINED CLOUD_NUM_NODES (
957
- SET USER_INPUT=
958
- SET /P "USER_INPUT=Please enter a number between 1 and 4 [2]: "
959
- goto while_num_nodes_not_valid
960
- )
961
- @echo Ok, let's start up %CLOUD_NUM_NODES% Solr nodes for your example SolrCloud cluster.
962
-
963
- :start_cloud_nodes
964
-
965
- set "CLOUD_EXAMPLE_DIR=%SOLR_TIP%\example\cloud"
966
-
967
- @echo Creating Solr home "%CLOUD_EXAMPLE_DIR%\node1\solr"
968
- mkdir "%CLOUD_EXAMPLE_DIR%\node1\solr"
969
- copy "%DEFAULT_SERVER_DIR%\solr\solr.xml" "%CLOUD_EXAMPLE_DIR%\node1\solr\solr.xml"
970
- copy "%DEFAULT_SERVER_DIR%\solr\zoo.cfg" "%CLOUD_EXAMPLE_DIR%\node1\solr\zoo.cfg"
971
-
972
- for /l %%x in (2, 1, !CLOUD_NUM_NODES!) do (
973
- IF NOT EXIST "%SOLR_TIP%\node%%x" (
974
- @echo Cloning "%CLOUD_EXAMPLE_DIR%\node1" into "%CLOUD_EXAMPLE_DIR%\node%%x"
975
- xcopy /Q /E /I "%CLOUD_EXAMPLE_DIR%\node1" "%CLOUD_EXAMPLE_DIR%\node%%x"
976
- )
977
- )
978
-
979
- for /l %%x in (1, 1, !CLOUD_NUM_NODES!) do (
980
- set USER_INPUT=
981
- set /A idx=%%x-1
982
- set DEF_PORT=8983
983
- IF %%x EQU 2 (
984
- set DEF_PORT=7574
985
- ) ELSE (
986
- IF %%x EQU 3 (
987
- set DEF_PORT=8984
988
- ) ELSE (
989
- IF %%x EQU 4 (
990
- set DEF_PORT=7575
991
- )
992
- )
993
- )
994
-
995
- IF "%NO_USER_PROMPT%"=="1" (
996
- set NODE_PORT=!DEF_PORT!
997
- ) ELSE (
998
- set /P "USER_INPUT=Please enter the port for node%%x [!DEF_PORT!]: "
999
- IF "!USER_INPUT!"=="" set USER_INPUT=!DEF_PORT!
1000
- set NODE_PORT=!USER_INPUT!
1001
- echo node%%x port: !NODE_PORT!
1002
- @echo.
1003
- )
1004
-
1005
- IF NOT "!SOLR_HEAP!"=="" (
1006
- set "DASHM=-m !SOLR_HEAP!"
1007
- ) ELSE (
1008
- set "DASHM="
1009
- )
1010
-
1011
- IF %%x EQU 1 (
1012
- set EXAMPLE=
1013
- IF NOT "!ZK_HOST!"=="" (
1014
- set "DASHZ=-z !ZK_HOST!"
1015
- ) ELSE (
1016
- set "DASHZ="
1017
- )
1018
- @echo Starting node1 on port !NODE_PORT! using command:
1019
- @echo solr -cloud -p !NODE_PORT! -s example\node1\solr !DASHZ! !DASHM!
1020
- START "Solr-!NODE_PORT!" /D "%SDIR%" solr -f -cloud -p !NODE_PORT! !DASHZ! !DASHM! -s "%CLOUD_EXAMPLE_DIR%\node1\solr"
1021
- set NODE1_PORT=!NODE_PORT!
1022
- echo !NODE_PORT!>"%SOLR_TIP%"\bin\solr-!NODE_PORT!.port
1023
- ) ELSE (
1024
- IF "!ZK_HOST!"=="" (
1025
- set /A ZK_PORT=!NODE1_PORT!+1000
1026
- set "ZK_HOST=localhost:!ZK_PORT!"
1027
- )
1028
- @echo Starting node%%x on port !NODE_PORT! using command:
1029
- @echo solr -cloud -p !NODE_PORT! -s example\node%%x\solr -z !ZK_HOST! !DASHM!
1030
- START "Solr-!NODE_PORT!" /D "%SDIR%" solr -f -cloud -p !NODE_PORT! -z !ZK_HOST! !DASHM! -s "%CLOUD_EXAMPLE_DIR%\node%%x\solr"
1031
- echo !NODE_PORT!>"%SOLR_TIP%"\bin\solr-!NODE_PORT!.port
1032
- )
1033
-
1034
- timeout /T 10
1035
- )
1036
-
1037
- set USER_INPUT=
1038
- echo.
1039
- echo Now let's create a new collection for indexing documents in your %CLOUD_NUM_NODES%-node cluster.
1040
- IF "%NO_USER_PROMPT%"=="1" (
1041
- set CLOUD_COLLECTION=gettingstarted
1042
- set CLOUD_NUM_SHARDS=2
1043
- set CLOUD_REPFACT=2
1044
- set CLOUD_CONFIG=data_driven_schema_configs
1045
- goto create_collection
1046
- ) ELSE (
1047
- goto get_create_collection_params
1048
- )
1049
-
1050
- :get_create_collection_params
1051
- set /P "USER_INPUT=Please provide a name for your new collection: [gettingstarted] "
1052
- IF "!USER_INPUT!"=="" set USER_INPUT=gettingstarted
1053
- set CLOUD_COLLECTION=!USER_INPUT!
1054
- echo !CLOUD_COLLECTION!
1055
- set USER_INPUT=
1056
- echo.
1057
- set /P "USER_INPUT=How many shards would you like to split !CLOUD_COLLECTION! into? [2] "
1058
- IF "!USER_INPUT!"=="" set USER_INPUT=2
1059
- set CLOUD_NUM_SHARDS=!USER_INPUT!
1060
- echo !CLOUD_NUM_SHARDS!
1061
- set USER_INPUT=
1062
- echo.
1063
- set /P "USER_INPUT=How many replicas per shard would you like to create? [2] "
1064
- IF "!USER_INPUT!"=="" set USER_INPUT=2
1065
- set CLOUD_REPFACT=!USER_INPUT!
1066
- echo !CLOUD_REPFACT!
1067
- set USER_INPUT=
1068
- echo.
1069
- set /P "USER_INPUT=Please choose a configuration for the !CLOUD_COLLECTION! collection, available options are: basic_configs, data_driven_schema_configs, or sample_techproducts_configs [data_driven_schema_configs]"
1070
- IF "!USER_INPUT!"=="" set USER_INPUT=data_driven_schema_configs
1071
- set CLOUD_CONFIG=!USER_INPUT!
1072
- echo !CLOUD_CONFIG!
1073
- goto create_collection
902
+ :run_example
903
+ REM Run the requested example
1074
904
 
1075
- :create_collection
1076
905
  "%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
1077
906
  -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
1078
- org.apache.solr.util.SolrCLI create_collection -name !CLOUD_COLLECTION! -shards !CLOUD_NUM_SHARDS! -replicationFactor !CLOUD_REPFACT! ^
1079
- -confdir !CLOUD_CONFIG! -configsetsDir "%SOLR_SERVER_DIR%\solr\configsets" -zkHost %zk_host%
907
+ org.apache.solr.util.SolrCLI run_example -script "%SDIR%\solr.cmd" -e %EXAMPLE% -d "%SOLR_SERVER_DIR%" -urlScheme !SOLR_URL_SCHEME! !PASS_TO_RUN_EXAMPLE!
1080
908
 
1081
- echo.
1082
- echo SolrCloud example is running, please visit !SOLR_URL_SCHEME!://localhost:%NODE1_PORT%/solr"
1083
- echo.
1084
-
1085
- REM End of interactive cloud example
909
+ REM End of run_example
1086
910
  goto done
1087
911
 
1088
-
1089
912
  :get_info
1090
913
  REM Find all Java processes, correlate with those listening on a port
1091
914
  REM and then try to contact via that port using the status tool
@@ -1102,7 +925,7 @@ for /f "usebackq" %%i in (`dir /b "%SOLR_TIP%\bin" ^| findstr /i "^solr-.*\.port
1102
925
  echo Found Solr process %%k running on port !SOME_SOLR_PORT!
1103
926
  "%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
1104
927
  -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
1105
- org.apache.solr.util.SolrCLI status -solr !SOLR_URL_SCHEME!://localhost:!SOME_SOLR_PORT!/solr
928
+ org.apache.solr.util.SolrCLI status -solr !SOLR_URL_SCHEME!://%SOLR_TOOL_HOST%:!SOME_SOLR_PORT!/solr
1106
929
  @echo.
1107
930
  )
1108
931
  )
@@ -1231,13 +1054,13 @@ if "!CREATE_PORT!"=="" (
1231
1054
  if "%SCRIPT_CMD%"=="create_core" (
1232
1055
  "%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
1233
1056
  -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
1234
- org.apache.solr.util.SolrCLI create_core -name !CREATE_NAME! -solrUrl !SOLR_URL_SCHEME!://localhost:!CREATE_PORT!/solr ^
1057
+ org.apache.solr.util.SolrCLI create_core -name !CREATE_NAME! -solrUrl !SOLR_URL_SCHEME!://%SOLR_TOOL_HOST%:!CREATE_PORT!/solr ^
1235
1058
  -confdir !CREATE_CONFDIR! -configsetsDir "%SOLR_TIP%\server\solr\configsets"
1236
1059
  ) else (
1237
1060
  "%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
1238
1061
  -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
1239
1062
  org.apache.solr.util.SolrCLI create -name !CREATE_NAME! -shards !CREATE_NUM_SHARDS! -replicationFactor !CREATE_REPFACT! ^
1240
- -confname !CREATE_CONFNAME! -confdir !CREATE_CONFDIR! -configsetsDir "%SOLR_TIP%\server\solr\configsets" -solrUrl !SOLR_URL_SCHEME!://localhost:!CREATE_PORT!/solr
1063
+ -confname !CREATE_CONFNAME! -confdir !CREATE_CONFDIR! -configsetsDir "%SOLR_TIP%\server\solr\configsets" -solrUrl !SOLR_URL_SCHEME!://%SOLR_TOOL_HOST%:!CREATE_PORT!/solr
1241
1064
  )
1242
1065
 
1243
1066
  goto done
@@ -1303,7 +1126,7 @@ if "!DELETE_CONFIG!"=="" (
1303
1126
  "%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
1304
1127
  -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
1305
1128
  org.apache.solr.util.SolrCLI delete -name !DELETE_NAME! -deleteConfig !DELETE_CONFIG! ^
1306
- -solrUrl !SOLR_URL_SCHEME!://localhost:!DELETE_PORT!/solr
1129
+ -solrUrl !SOLR_URL_SCHEME!://%SOLR_TOOL_HOST%:!DELETE_PORT!/solr
1307
1130
 
1308
1131
  goto done
1309
1132
 
@@ -1351,29 +1174,52 @@ goto done
1351
1174
  exit /b 1
1352
1175
 
1353
1176
  :done
1354
-
1355
1177
  ENDLOCAL
1356
-
1357
- GOTO :eof
1178
+ exit /b 0
1358
1179
 
1359
1180
  REM Tests what Java we have and sets some global variables
1360
- :resolve_java_version
1181
+ :resolve_java_info
1182
+
1183
+ CALL :resolve_java_vendor
1361
1184
 
1362
1185
  set JAVA_MAJOR_VERSION=0
1363
1186
  set JAVA_VERSION_INFO=
1364
1187
  set JAVA_BUILD=0
1188
+
1365
1189
  "%JAVA%" -version 2>&1 | findstr /i "version" > javavers
1366
1190
  set /p JAVAVEROUT=<javavers
1367
1191
  del javavers
1368
- for /f "tokens=3" %%g in ("!JAVAVEROUT!") do (
1369
- set JAVA_VERSION_INFO=%%g
1192
+
1193
+ for /f "tokens=3" %%a in ("!JAVAVEROUT!") do (
1194
+ set JAVA_VERSION_INFO=%%a
1195
+ REM Remove surrounding quotes
1370
1196
  set JAVA_VERSION_INFO=!JAVA_VERSION_INFO:"=!
1371
- for /f "delims=_ tokens=1-3" %%v in ("!JAVA_VERSION_INFO!") do (
1372
- set JAVA_MAJOR=!JAVA_VERSION_INFO:~0,3!
1373
- set /a JAVA_BUILD=%%w
1374
- set /a JAVA_MAJOR_VERSION=!JAVA_MAJOR:~2,1!*1
1197
+
1198
+ REM Extract the major Java version, e.g. 7, 8, 9, 10 ...
1199
+ for /f "tokens=2 delims=." %%a in ("!JAVA_VERSION_INFO!") do (
1200
+ set JAVA_MAJOR_VERSION=%%a
1375
1201
  )
1202
+
1203
+ REM Don't look for "_{build}" if we're on IBM J9.
1204
+ if NOT "%JAVA_VENDOR%" == "IBM J9" (
1205
+ for /f "delims=_ tokens=2" %%a in ("!JAVA_VERSION_INFO!") do (
1206
+ set /a JAVA_BUILD=%%a
1207
+ )
1208
+ )
1209
+ )
1210
+ GOTO :eof
1211
+
1212
+ REM Set which JVM vendor we have
1213
+ :resolve_java_vendor
1214
+ set "JAVA_VENDOR=Oracle"
1215
+ "%JAVA%" -version 2>&1 | findstr /i "IBM J9" > javares
1216
+ set /p JAVA_VENDOR_OUT=<javares
1217
+ del javares
1218
+ if NOT "%JAVA_VENDOR_OUT%" == "" (
1219
+ set "JAVA_VENDOR=IBM J9"
1376
1220
  )
1221
+
1222
+ set JAVA_VENDOR_OUT=
1377
1223
  GOTO :eof
1378
1224
 
1379
1225
  REM Safe echo which does not mess with () in strings
@@ -1381,4 +1227,4 @@ REM Safe echo which does not mess with () in strings
1381
1227
  set "eout=%1"
1382
1228
  set eout=%eout:"=%
1383
1229
  echo !eout!
1384
- GOTO :eof
1230
+ GOTO :eof