sunspot_solr 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (410) hide show
  1. checksums.yaml +7 -0
  2. data/bin/sunspot-solr +0 -4
  3. data/lib/sunspot/solr/installer.rb +1 -1
  4. data/lib/sunspot/solr/installer/config_installer.rb +55 -21
  5. data/lib/sunspot/solr/java.rb +1 -1
  6. data/lib/sunspot/solr/server.rb +21 -21
  7. data/solr/.gitignore +2 -0
  8. data/solr/README.txt +157 -18
  9. data/solr/bin/init.d/solr +78 -0
  10. data/solr/bin/install_solr_service.sh +270 -0
  11. data/solr/bin/oom_solr.sh +30 -0
  12. data/solr/bin/post +218 -0
  13. data/solr/bin/solr +1531 -0
  14. data/solr/bin/solr.cmd +1384 -0
  15. data/solr/bin/solr.in.cmd +89 -0
  16. data/solr/bin/solr.in.sh +103 -0
  17. data/solr/server/README.txt +113 -0
  18. data/solr/{contexts/solr.xml → server/contexts/solr-jetty-context.xml} +1 -0
  19. data/solr/server/etc/jetty-https-ssl.xml +159 -0
  20. data/solr/{etc → server/etc}/jetty.xml +0 -0
  21. data/solr/{etc → server/etc}/webdefault.xml +1 -1
  22. data/solr/server/lib/ext/jcl-over-slf4j-1.7.7.jar +0 -0
  23. data/solr/server/lib/ext/jul-to-slf4j-1.7.7.jar +0 -0
  24. data/solr/server/lib/ext/log4j-1.2.17.jar +0 -0
  25. data/solr/server/lib/ext/slf4j-api-1.7.7.jar +0 -0
  26. data/solr/server/lib/ext/slf4j-log4j12-1.7.7.jar +0 -0
  27. data/solr/{lib/jetty-continuation-8.1.8.v20121106.jar → server/lib/jetty-continuation-8.1.10.v20130312.jar} +0 -0
  28. data/solr/{lib/jetty-deploy-8.1.8.v20121106.jar → server/lib/jetty-deploy-8.1.10.v20130312.jar} +0 -0
  29. data/solr/server/lib/jetty-http-8.1.10.v20130312.jar +0 -0
  30. data/solr/{lib/jetty-io-8.1.8.v20121106.jar → server/lib/jetty-io-8.1.10.v20130312.jar} +0 -0
  31. data/solr/{lib/jetty-jmx-8.1.8.v20121106.jar → server/lib/jetty-jmx-8.1.10.v20130312.jar} +0 -0
  32. data/solr/{lib/jetty-security-8.1.8.v20121106.jar → server/lib/jetty-security-8.1.10.v20130312.jar} +0 -0
  33. data/solr/server/lib/jetty-server-8.1.10.v20130312.jar +0 -0
  34. data/solr/server/lib/jetty-servlet-8.1.10.v20130312.jar +0 -0
  35. data/solr/{lib/jetty-util-8.1.8.v20121106.jar → server/lib/jetty-util-8.1.10.v20130312.jar} +0 -0
  36. data/solr/{lib/jetty-webapp-8.1.8.v20121106.jar → server/lib/jetty-webapp-8.1.10.v20130312.jar} +0 -0
  37. data/solr/server/lib/jetty-xml-8.1.10.v20130312.jar +0 -0
  38. data/solr/{lib → server/lib}/servlet-api-3.0.jar +0 -0
  39. data/solr/server/resources/log4j.properties +24 -0
  40. data/solr/server/solr-webapp/webapp/.gitignore +1 -0
  41. data/solr/server/solr-webapp/webapp/WEB-INF/lib/antlr-runtime-3.5.jar +0 -0
  42. data/solr/server/solr-webapp/webapp/WEB-INF/lib/asm-4.1.jar +0 -0
  43. data/solr/server/solr-webapp/webapp/WEB-INF/lib/asm-commons-4.1.jar +0 -0
  44. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-cli-1.2.jar +0 -0
  45. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-codec-1.10.jar +0 -0
  46. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-collections-3.2.1.jar +0 -0
  47. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-configuration-1.6.jar +0 -0
  48. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-fileupload-1.2.1.jar +0 -0
  49. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-io-2.4.jar +0 -0
  50. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-lang-2.6.jar +0 -0
  51. data/solr/server/solr-webapp/webapp/WEB-INF/lib/concurrentlinkedhashmap-lru-1.2.jar +0 -0
  52. data/solr/server/solr-webapp/webapp/WEB-INF/lib/dom4j-1.6.1.jar +0 -0
  53. data/solr/server/solr-webapp/webapp/WEB-INF/lib/guava-14.0.1.jar +0 -0
  54. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-annotations-2.3.0.jar +0 -0
  55. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-auth-2.3.0.jar +0 -0
  56. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-common-2.3.0.jar +0 -0
  57. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-hdfs-2.3.0.jar +0 -0
  58. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hppc-0.5.2.jar +0 -0
  59. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpclient-4.3.1.jar +0 -0
  60. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpcore-4.3.jar +0 -0
  61. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpmime-4.3.1.jar +0 -0
  62. data/solr/server/solr-webapp/webapp/WEB-INF/lib/joda-time-2.2.jar +0 -0
  63. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-analyzers-common-5.0.0.jar +0 -0
  64. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-analyzers-kuromoji-5.0.0.jar +0 -0
  65. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-analyzers-phonetic-5.0.0.jar +0 -0
  66. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-backward-codecs-5.0.0.jar +0 -0
  67. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-codecs-5.0.0.jar +0 -0
  68. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-core-5.0.0.jar +0 -0
  69. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-expressions-5.0.0.jar +0 -0
  70. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-grouping-5.0.0.jar +0 -0
  71. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-highlighter-5.0.0.jar +0 -0
  72. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-join-5.0.0.jar +0 -0
  73. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-memory-5.0.0.jar +0 -0
  74. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-misc-5.0.0.jar +0 -0
  75. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-queries-5.0.0.jar +0 -0
  76. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-queryparser-5.0.0.jar +0 -0
  77. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-spatial-5.0.0.jar +0 -0
  78. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-suggest-5.0.0.jar +0 -0
  79. data/solr/server/solr-webapp/webapp/WEB-INF/lib/noggit-0.6.jar +0 -0
  80. data/solr/server/solr-webapp/webapp/WEB-INF/lib/org.restlet-2.1.1.jar +0 -0
  81. data/solr/server/solr-webapp/webapp/WEB-INF/lib/org.restlet.ext.servlet-2.1.1.jar +0 -0
  82. data/solr/server/solr-webapp/webapp/WEB-INF/lib/protobuf-java-2.5.0.jar +0 -0
  83. data/solr/server/solr-webapp/webapp/WEB-INF/lib/solr-core-5.0.0.jar +0 -0
  84. data/solr/server/solr-webapp/webapp/WEB-INF/lib/solr-solrj-5.0.0.jar +0 -0
  85. data/solr/server/solr-webapp/webapp/WEB-INF/lib/spatial4j-0.4.1.jar +0 -0
  86. data/solr/server/solr-webapp/webapp/WEB-INF/lib/stax2-api-3.1.4.jar +0 -0
  87. data/solr/server/solr-webapp/webapp/WEB-INF/lib/woodstox-core-asl-4.4.1.jar +0 -0
  88. data/solr/server/solr-webapp/webapp/WEB-INF/lib/zookeeper-3.4.6.jar +0 -0
  89. data/solr/server/solr-webapp/webapp/WEB-INF/web.xml +181 -0
  90. data/solr/server/solr-webapp/webapp/WEB-INF/weblogic.xml +28 -0
  91. data/solr/server/solr-webapp/webapp/admin.html +163 -0
  92. data/solr/server/solr-webapp/webapp/css/chosen.css +421 -0
  93. data/solr/server/solr-webapp/webapp/css/styles/analysis.css +311 -0
  94. data/solr/server/solr-webapp/webapp/css/styles/cloud.css +410 -0
  95. data/solr/server/solr-webapp/webapp/css/styles/common.css +701 -0
  96. data/solr/server/solr-webapp/webapp/css/styles/cores.css +244 -0
  97. data/solr/server/solr-webapp/webapp/css/styles/dashboard.css +155 -0
  98. data/solr/server/solr-webapp/webapp/css/styles/dataimport.css +403 -0
  99. data/solr/server/solr-webapp/webapp/css/styles/documents.css +197 -0
  100. data/solr/server/solr-webapp/webapp/css/styles/files.css +54 -0
  101. data/solr/server/solr-webapp/webapp/css/styles/index.css +207 -0
  102. data/solr/server/solr-webapp/webapp/css/styles/java-properties.css +52 -0
  103. data/solr/server/solr-webapp/webapp/css/styles/logging.css +391 -0
  104. data/solr/server/solr-webapp/webapp/css/styles/menu.css +328 -0
  105. data/solr/server/solr-webapp/webapp/css/styles/plugins.css +195 -0
  106. data/solr/server/solr-webapp/webapp/css/styles/query.css +173 -0
  107. data/solr/server/solr-webapp/webapp/css/styles/replication.css +515 -0
  108. data/solr/server/solr-webapp/webapp/css/styles/schema-browser.css +578 -0
  109. data/solr/server/solr-webapp/webapp/css/styles/threads.css +172 -0
  110. data/solr/server/solr-webapp/webapp/favicon.ico +0 -0
  111. data/solr/server/solr-webapp/webapp/img/ZeroClipboard.swf +0 -0
  112. data/solr/server/solr-webapp/webapp/img/chosen-sprite.png +0 -0
  113. data/solr/server/solr-webapp/webapp/img/div.gif +0 -0
  114. data/solr/server/solr-webapp/webapp/img/favicon.ico +0 -0
  115. data/solr/server/solr-webapp/webapp/img/filetypes/7z.png +0 -0
  116. data/solr/server/solr-webapp/webapp/img/filetypes/README +27 -0
  117. data/solr/server/solr-webapp/webapp/img/filetypes/ai.png +0 -0
  118. data/solr/server/solr-webapp/webapp/img/filetypes/aiff.png +0 -0
  119. data/solr/server/solr-webapp/webapp/img/filetypes/asc.png +0 -0
  120. data/solr/server/solr-webapp/webapp/img/filetypes/audio.png +0 -0
  121. data/solr/server/solr-webapp/webapp/img/filetypes/bin.png +0 -0
  122. data/solr/server/solr-webapp/webapp/img/filetypes/bz2.png +0 -0
  123. data/solr/server/solr-webapp/webapp/img/filetypes/c.png +0 -0
  124. data/solr/server/solr-webapp/webapp/img/filetypes/cfc.png +0 -0
  125. data/solr/server/solr-webapp/webapp/img/filetypes/cfm.png +0 -0
  126. data/solr/server/solr-webapp/webapp/img/filetypes/chm.png +0 -0
  127. data/solr/server/solr-webapp/webapp/img/filetypes/class.png +0 -0
  128. data/solr/server/solr-webapp/webapp/img/filetypes/conf.png +0 -0
  129. data/solr/server/solr-webapp/webapp/img/filetypes/cpp.png +0 -0
  130. data/solr/server/solr-webapp/webapp/img/filetypes/cs.png +0 -0
  131. data/solr/server/solr-webapp/webapp/img/filetypes/css.png +0 -0
  132. data/solr/server/solr-webapp/webapp/img/filetypes/csv.png +0 -0
  133. data/solr/server/solr-webapp/webapp/img/filetypes/deb.png +0 -0
  134. data/solr/server/solr-webapp/webapp/img/filetypes/divx.png +0 -0
  135. data/solr/server/solr-webapp/webapp/img/filetypes/doc.png +0 -0
  136. data/solr/server/solr-webapp/webapp/img/filetypes/dot.png +0 -0
  137. data/solr/server/solr-webapp/webapp/img/filetypes/eml.png +0 -0
  138. data/solr/server/solr-webapp/webapp/img/filetypes/enc.png +0 -0
  139. data/solr/server/solr-webapp/webapp/img/filetypes/file.png +0 -0
  140. data/solr/server/solr-webapp/webapp/img/filetypes/gif.png +0 -0
  141. data/solr/server/solr-webapp/webapp/img/filetypes/gz.png +0 -0
  142. data/solr/server/solr-webapp/webapp/img/filetypes/hlp.png +0 -0
  143. data/solr/server/solr-webapp/webapp/img/filetypes/htm.png +0 -0
  144. data/solr/server/solr-webapp/webapp/img/filetypes/html.png +0 -0
  145. data/solr/server/solr-webapp/webapp/img/filetypes/image.png +0 -0
  146. data/solr/server/solr-webapp/webapp/img/filetypes/iso.png +0 -0
  147. data/solr/server/solr-webapp/webapp/img/filetypes/jar.png +0 -0
  148. data/solr/server/solr-webapp/webapp/img/filetypes/java.png +0 -0
  149. data/solr/server/solr-webapp/webapp/img/filetypes/jpeg.png +0 -0
  150. data/solr/server/solr-webapp/webapp/img/filetypes/jpg.png +0 -0
  151. data/solr/server/solr-webapp/webapp/img/filetypes/js.png +0 -0
  152. data/solr/server/solr-webapp/webapp/img/filetypes/lua.png +0 -0
  153. data/solr/server/solr-webapp/webapp/img/filetypes/m.png +0 -0
  154. data/solr/server/solr-webapp/webapp/img/filetypes/mm.png +0 -0
  155. data/solr/server/solr-webapp/webapp/img/filetypes/mov.png +0 -0
  156. data/solr/server/solr-webapp/webapp/img/filetypes/mp3.png +0 -0
  157. data/solr/server/solr-webapp/webapp/img/filetypes/mpg.png +0 -0
  158. data/solr/server/solr-webapp/webapp/img/filetypes/odc.png +0 -0
  159. data/solr/server/solr-webapp/webapp/img/filetypes/odf.png +0 -0
  160. data/solr/server/solr-webapp/webapp/img/filetypes/odg.png +0 -0
  161. data/solr/server/solr-webapp/webapp/img/filetypes/odi.png +0 -0
  162. data/solr/server/solr-webapp/webapp/img/filetypes/odp.png +0 -0
  163. data/solr/server/solr-webapp/webapp/img/filetypes/ods.png +0 -0
  164. data/solr/server/solr-webapp/webapp/img/filetypes/odt.png +0 -0
  165. data/solr/server/solr-webapp/webapp/img/filetypes/ogg.png +0 -0
  166. data/solr/server/solr-webapp/webapp/img/filetypes/pdf.png +0 -0
  167. data/solr/server/solr-webapp/webapp/img/filetypes/pgp.png +0 -0
  168. data/solr/server/solr-webapp/webapp/img/filetypes/php.png +0 -0
  169. data/solr/server/solr-webapp/webapp/img/filetypes/pl.png +0 -0
  170. data/solr/server/solr-webapp/webapp/img/filetypes/png.png +0 -0
  171. data/solr/server/solr-webapp/webapp/img/filetypes/ppt.png +0 -0
  172. data/solr/server/solr-webapp/webapp/img/filetypes/ps.png +0 -0
  173. data/solr/server/solr-webapp/webapp/img/filetypes/py.png +0 -0
  174. data/solr/server/solr-webapp/webapp/img/filetypes/ram.png +0 -0
  175. data/solr/server/solr-webapp/webapp/img/filetypes/rar.png +0 -0
  176. data/solr/server/solr-webapp/webapp/img/filetypes/rb.png +0 -0
  177. data/solr/server/solr-webapp/webapp/img/filetypes/rm.png +0 -0
  178. data/solr/server/solr-webapp/webapp/img/filetypes/rpm.png +0 -0
  179. data/solr/server/solr-webapp/webapp/img/filetypes/rtf.png +0 -0
  180. data/solr/server/solr-webapp/webapp/img/filetypes/sig.png +0 -0
  181. data/solr/server/solr-webapp/webapp/img/filetypes/sql.png +0 -0
  182. data/solr/server/solr-webapp/webapp/img/filetypes/swf.png +0 -0
  183. data/solr/server/solr-webapp/webapp/img/filetypes/sxc.png +0 -0
  184. data/solr/server/solr-webapp/webapp/img/filetypes/sxd.png +0 -0
  185. data/solr/server/solr-webapp/webapp/img/filetypes/sxi.png +0 -0
  186. data/solr/server/solr-webapp/webapp/img/filetypes/sxw.png +0 -0
  187. data/solr/server/solr-webapp/webapp/img/filetypes/tar.png +0 -0
  188. data/solr/server/solr-webapp/webapp/img/filetypes/tex.png +0 -0
  189. data/solr/server/solr-webapp/webapp/img/filetypes/tgz.png +0 -0
  190. data/solr/server/solr-webapp/webapp/img/filetypes/txt.png +0 -0
  191. data/solr/server/solr-webapp/webapp/img/filetypes/vcf.png +0 -0
  192. data/solr/server/solr-webapp/webapp/img/filetypes/video.png +0 -0
  193. data/solr/server/solr-webapp/webapp/img/filetypes/vsd.png +0 -0
  194. data/solr/server/solr-webapp/webapp/img/filetypes/wav.png +0 -0
  195. data/solr/server/solr-webapp/webapp/img/filetypes/wma.png +0 -0
  196. data/solr/server/solr-webapp/webapp/img/filetypes/wmv.png +0 -0
  197. data/solr/server/solr-webapp/webapp/img/filetypes/xls.png +0 -0
  198. data/solr/server/solr-webapp/webapp/img/filetypes/xml.png +0 -0
  199. data/solr/server/solr-webapp/webapp/img/filetypes/xpi.png +0 -0
  200. data/solr/server/solr-webapp/webapp/img/filetypes/xvid.png +0 -0
  201. data/solr/server/solr-webapp/webapp/img/filetypes/zip.png +0 -0
  202. data/solr/server/solr-webapp/webapp/img/ico/arrow-000-small.png +0 -0
  203. data/solr/server/solr-webapp/webapp/img/ico/arrow-circle.png +0 -0
  204. data/solr/server/solr-webapp/webapp/img/ico/arrow-switch.png +0 -0
  205. data/solr/server/solr-webapp/webapp/img/ico/asterisk.png +0 -0
  206. data/solr/server/solr-webapp/webapp/img/ico/battery.png +0 -0
  207. data/solr/server/solr-webapp/webapp/img/ico/block-small.png +0 -0
  208. data/solr/server/solr-webapp/webapp/img/ico/block.png +0 -0
  209. data/solr/server/solr-webapp/webapp/img/ico/book-open-text.png +0 -0
  210. data/solr/server/solr-webapp/webapp/img/ico/box.png +0 -0
  211. data/solr/server/solr-webapp/webapp/img/ico/bug.png +0 -0
  212. data/solr/server/solr-webapp/webapp/img/ico/chart.png +0 -0
  213. data/solr/server/solr-webapp/webapp/img/ico/chevron-small-expand.png +0 -0
  214. data/solr/server/solr-webapp/webapp/img/ico/chevron-small.png +0 -0
  215. data/solr/server/solr-webapp/webapp/img/ico/clipboard-list.png +0 -0
  216. data/solr/server/solr-webapp/webapp/img/ico/clipboard-paste-document-text.png +0 -0
  217. data/solr/server/solr-webapp/webapp/img/ico/clipboard-paste.png +0 -0
  218. data/solr/server/solr-webapp/webapp/img/ico/clock-select-remain.png +0 -0
  219. data/solr/server/solr-webapp/webapp/img/ico/clock-select.png +0 -0
  220. data/solr/server/solr-webapp/webapp/img/ico/construction.png +0 -0
  221. data/solr/server/solr-webapp/webapp/img/ico/cross-0.png +0 -0
  222. data/solr/server/solr-webapp/webapp/img/ico/cross-1.png +0 -0
  223. data/solr/server/solr-webapp/webapp/img/ico/cross-button.png +0 -0
  224. data/solr/server/solr-webapp/webapp/img/ico/cross.png +0 -0
  225. data/solr/server/solr-webapp/webapp/img/ico/dashboard.png +0 -0
  226. data/solr/server/solr-webapp/webapp/img/ico/database--plus.png +0 -0
  227. data/solr/server/solr-webapp/webapp/img/ico/database.png +0 -0
  228. data/solr/server/solr-webapp/webapp/img/ico/databases.png +0 -0
  229. data/solr/server/solr-webapp/webapp/img/ico/disk-black.png +0 -0
  230. data/solr/server/solr-webapp/webapp/img/ico/document-convert.png +0 -0
  231. data/solr/server/solr-webapp/webapp/img/ico/document-import.png +0 -0
  232. data/solr/server/solr-webapp/webapp/img/ico/document-list.png +0 -0
  233. data/solr/server/solr-webapp/webapp/img/ico/document-text.png +0 -0
  234. data/solr/server/solr-webapp/webapp/img/ico/documents-stack.png +0 -0
  235. data/solr/server/solr-webapp/webapp/img/ico/download-cloud.png +0 -0
  236. data/solr/server/solr-webapp/webapp/img/ico/drive-upload.png +0 -0
  237. data/solr/server/solr-webapp/webapp/img/ico/exclamation-button.png +0 -0
  238. data/solr/server/solr-webapp/webapp/img/ico/eye.png +0 -0
  239. data/solr/server/solr-webapp/webapp/img/ico/folder-export.png +0 -0
  240. data/solr/server/solr-webapp/webapp/img/ico/folder-tree.png +0 -0
  241. data/solr/server/solr-webapp/webapp/img/ico/folder.png +0 -0
  242. data/solr/server/solr-webapp/webapp/img/ico/funnel-small.png +0 -0
  243. data/solr/server/solr-webapp/webapp/img/ico/funnel.png +0 -0
  244. data/solr/server/solr-webapp/webapp/img/ico/gear.png +0 -0
  245. data/solr/server/solr-webapp/webapp/img/ico/globe-network.png +0 -0
  246. data/solr/server/solr-webapp/webapp/img/ico/globe.png +0 -0
  247. data/solr/server/solr-webapp/webapp/img/ico/hammer-screwdriver.png +0 -0
  248. data/solr/server/solr-webapp/webapp/img/ico/hammer.png +0 -0
  249. data/solr/server/solr-webapp/webapp/img/ico/hand.png +0 -0
  250. data/solr/server/solr-webapp/webapp/img/ico/highlighter-text.png +0 -0
  251. data/solr/server/solr-webapp/webapp/img/ico/home.png +0 -0
  252. data/solr/server/solr-webapp/webapp/img/ico/hourglass--exclamation.png +0 -0
  253. data/solr/server/solr-webapp/webapp/img/ico/hourglass.png +0 -0
  254. data/solr/server/solr-webapp/webapp/img/ico/inbox-document-text.png +0 -0
  255. data/solr/server/solr-webapp/webapp/img/ico/information-button.png +0 -0
  256. data/solr/server/solr-webapp/webapp/img/ico/information-small.png +0 -0
  257. data/solr/server/solr-webapp/webapp/img/ico/information-white.png +0 -0
  258. data/solr/server/solr-webapp/webapp/img/ico/information.png +0 -0
  259. data/solr/server/solr-webapp/webapp/img/ico/jar.png +0 -0
  260. data/solr/server/solr-webapp/webapp/img/ico/magnifier.png +0 -0
  261. data/solr/server/solr-webapp/webapp/img/ico/mail.png +0 -0
  262. data/solr/server/solr-webapp/webapp/img/ico/memory.png +0 -0
  263. data/solr/server/solr-webapp/webapp/img/ico/minus-button.png +0 -0
  264. data/solr/server/solr-webapp/webapp/img/ico/molecule.png +0 -0
  265. data/solr/server/solr-webapp/webapp/img/ico/network-cloud.png +0 -0
  266. data/solr/server/solr-webapp/webapp/img/ico/network-status-away.png +0 -0
  267. data/solr/server/solr-webapp/webapp/img/ico/network-status-busy.png +0 -0
  268. data/solr/server/solr-webapp/webapp/img/ico/network-status-offline.png +0 -0
  269. data/solr/server/solr-webapp/webapp/img/ico/network-status.png +0 -0
  270. data/solr/server/solr-webapp/webapp/img/ico/network.png +0 -0
  271. data/solr/server/solr-webapp/webapp/img/ico/node-design.png +0 -0
  272. data/solr/server/solr-webapp/webapp/img/ico/node-master.png +0 -0
  273. data/solr/server/solr-webapp/webapp/img/ico/node-select.png +0 -0
  274. data/solr/server/solr-webapp/webapp/img/ico/node-slave.png +0 -0
  275. data/solr/server/solr-webapp/webapp/img/ico/node.png +0 -0
  276. data/solr/server/solr-webapp/webapp/img/ico/pencil-small.png +0 -0
  277. data/solr/server/solr-webapp/webapp/img/ico/pencil.png +0 -0
  278. data/solr/server/solr-webapp/webapp/img/ico/plus-button.png +0 -0
  279. data/solr/server/solr-webapp/webapp/img/ico/processor.png +0 -0
  280. data/solr/server/solr-webapp/webapp/img/ico/prohibition.png +0 -0
  281. data/solr/server/solr-webapp/webapp/img/ico/property.png +0 -0
  282. data/solr/server/solr-webapp/webapp/img/ico/question-small-white.png +0 -0
  283. data/solr/server/solr-webapp/webapp/img/ico/question-white.png +0 -0
  284. data/solr/server/solr-webapp/webapp/img/ico/question.png +0 -0
  285. data/solr/server/solr-webapp/webapp/img/ico/receipt-invoice.png +0 -0
  286. data/solr/server/solr-webapp/webapp/img/ico/receipt.png +0 -0
  287. data/solr/server/solr-webapp/webapp/img/ico/script-code.png +0 -0
  288. data/solr/server/solr-webapp/webapp/img/ico/server-cast.png +0 -0
  289. data/solr/server/solr-webapp/webapp/img/ico/server.png +0 -0
  290. data/solr/server/solr-webapp/webapp/img/ico/sitemap.png +0 -0
  291. data/solr/server/solr-webapp/webapp/img/ico/slash.png +0 -0
  292. data/solr/server/solr-webapp/webapp/img/ico/status-away.png +0 -0
  293. data/solr/server/solr-webapp/webapp/img/ico/status-busy.png +0 -0
  294. data/solr/server/solr-webapp/webapp/img/ico/status-offline.png +0 -0
  295. data/solr/server/solr-webapp/webapp/img/ico/status.png +0 -0
  296. data/solr/server/solr-webapp/webapp/img/ico/system-monitor--exclamation.png +0 -0
  297. data/solr/server/solr-webapp/webapp/img/ico/system-monitor.png +0 -0
  298. data/solr/server/solr-webapp/webapp/img/ico/table.png +0 -0
  299. data/solr/server/solr-webapp/webapp/img/ico/terminal.png +0 -0
  300. data/solr/server/solr-webapp/webapp/img/ico/tick-circle.png +0 -0
  301. data/solr/server/solr-webapp/webapp/img/ico/tick-red.png +0 -0
  302. data/solr/server/solr-webapp/webapp/img/ico/tick.png +0 -0
  303. data/solr/server/solr-webapp/webapp/img/ico/toggle-small-expand.png +0 -0
  304. data/solr/server/solr-webapp/webapp/img/ico/toggle-small.png +0 -0
  305. data/solr/server/solr-webapp/webapp/img/ico/toolbox.png +0 -0
  306. data/solr/server/solr-webapp/webapp/img/ico/ui-accordion.png +0 -0
  307. data/solr/server/solr-webapp/webapp/img/ico/ui-address-bar.png +0 -0
  308. data/solr/server/solr-webapp/webapp/img/ico/ui-check-box-uncheck.png +0 -0
  309. data/solr/server/solr-webapp/webapp/img/ico/ui-check-box.png +0 -0
  310. data/solr/server/solr-webapp/webapp/img/ico/ui-radio-button-uncheck.png +0 -0
  311. data/solr/server/solr-webapp/webapp/img/ico/ui-radio-button.png +0 -0
  312. data/solr/server/solr-webapp/webapp/img/ico/ui-text-field-select.png +0 -0
  313. data/solr/server/solr-webapp/webapp/img/ico/users.png +0 -0
  314. data/solr/server/solr-webapp/webapp/img/ico/wooden-box.png +0 -0
  315. data/solr/server/solr-webapp/webapp/img/ico/zone.png +0 -0
  316. data/solr/server/solr-webapp/webapp/img/loader-light.gif +0 -0
  317. data/solr/server/solr-webapp/webapp/img/loader.gif +0 -0
  318. data/solr/server/solr-webapp/webapp/img/lucene-ico.png +0 -0
  319. data/solr/server/solr-webapp/webapp/img/solr-ico.png +0 -0
  320. data/solr/server/solr-webapp/webapp/img/solr.svg +39 -0
  321. data/solr/server/solr-webapp/webapp/img/tree.png +0 -0
  322. data/solr/server/solr-webapp/webapp/js/lib/ZeroClipboard.js +342 -0
  323. data/solr/server/solr-webapp/webapp/js/lib/chosen.js +982 -0
  324. data/solr/server/solr-webapp/webapp/js/lib/console.js +29 -0
  325. data/solr/server/solr-webapp/webapp/js/lib/d3.js +9373 -0
  326. data/solr/server/solr-webapp/webapp/js/lib/highlight.js +31 -0
  327. data/solr/server/solr-webapp/webapp/js/lib/jquery-1.7.2.min.js +30 -0
  328. data/solr/server/solr-webapp/webapp/js/lib/jquery.ajaxfileupload.js +184 -0
  329. data/solr/server/solr-webapp/webapp/js/lib/jquery.blockUI.js +523 -0
  330. data/solr/server/solr-webapp/webapp/js/lib/jquery.cookie.js +71 -0
  331. data/solr/server/solr-webapp/webapp/js/lib/jquery.form.js +806 -0
  332. data/solr/server/solr-webapp/webapp/js/lib/jquery.jstree.js +3534 -0
  333. data/solr/server/solr-webapp/webapp/js/lib/jquery.sammy.js +1863 -0
  334. data/solr/server/solr-webapp/webapp/js/lib/jquery.timeago.js +189 -0
  335. data/solr/server/solr-webapp/webapp/js/lib/linker.js +48 -0
  336. data/solr/server/solr-webapp/webapp/js/lib/order.js +216 -0
  337. data/solr/server/solr-webapp/webapp/js/main.js +58 -0
  338. data/solr/server/solr-webapp/webapp/js/require.js +11349 -0
  339. data/solr/server/solr-webapp/webapp/js/scripts/analysis.js +545 -0
  340. data/solr/server/solr-webapp/webapp/js/scripts/app.js +679 -0
  341. data/solr/server/solr-webapp/webapp/js/scripts/cloud.js +877 -0
  342. data/solr/server/solr-webapp/webapp/js/scripts/cores.js +719 -0
  343. data/solr/server/solr-webapp/webapp/js/scripts/dashboard.js +562 -0
  344. data/solr/server/solr-webapp/webapp/js/scripts/dataimport.js +812 -0
  345. data/solr/server/solr-webapp/webapp/js/scripts/documents.js +370 -0
  346. data/solr/server/solr-webapp/webapp/js/scripts/files.js +265 -0
  347. data/solr/server/solr-webapp/webapp/js/scripts/index.js +340 -0
  348. data/solr/server/solr-webapp/webapp/js/scripts/java-properties.js +106 -0
  349. data/solr/server/solr-webapp/webapp/js/scripts/logging.js +576 -0
  350. data/solr/server/solr-webapp/webapp/js/scripts/ping.js +72 -0
  351. data/solr/server/solr-webapp/webapp/js/scripts/plugins.js +462 -0
  352. data/solr/server/solr-webapp/webapp/js/scripts/query.js +229 -0
  353. data/solr/server/solr-webapp/webapp/js/scripts/replication.js +527 -0
  354. data/solr/server/solr-webapp/webapp/js/scripts/schema-browser.js +1229 -0
  355. data/solr/server/solr-webapp/webapp/js/scripts/threads.js +158 -0
  356. data/solr/server/solr-webapp/webapp/tpl/analysis.html +83 -0
  357. data/solr/server/solr-webapp/webapp/tpl/cloud.html +87 -0
  358. data/solr/server/solr-webapp/webapp/tpl/cores.html +226 -0
  359. data/solr/server/solr-webapp/webapp/tpl/dashboard.html +201 -0
  360. data/solr/server/solr-webapp/webapp/tpl/dataimport.html +183 -0
  361. data/solr/server/solr-webapp/webapp/tpl/documents.html +107 -0
  362. data/solr/server/solr-webapp/webapp/tpl/files.html +44 -0
  363. data/solr/server/solr-webapp/webapp/tpl/index.html +250 -0
  364. data/solr/server/solr-webapp/webapp/tpl/logging.html +23 -0
  365. data/solr/server/solr-webapp/webapp/tpl/plugins.html +39 -0
  366. data/solr/server/solr-webapp/webapp/tpl/query.html +361 -0
  367. data/solr/server/solr-webapp/webapp/tpl/replication.html +216 -0
  368. data/solr/server/solr-webapp/webapp/tpl/schema-browser.html +192 -0
  369. data/solr/server/solr-webapp/webapp/tpl/threads.html +56 -0
  370. data/solr/server/solr/README.txt +77 -0
  371. data/solr/server/solr/solr.xml +51 -0
  372. data/solr/server/solr/zoo.cfg +17 -0
  373. data/solr/server/start.jar +0 -0
  374. data/solr/server/webapps/solr.war +0 -0
  375. data/solr/solr/README.txt +77 -0
  376. data/solr/solr/configsets/sunspot/conf/_rest_managed.json +1 -0
  377. data/solr/solr/{conf → configsets/sunspot/conf}/admin-extra.html +0 -0
  378. data/solr/solr/configsets/sunspot/conf/currency.xml +67 -0
  379. data/solr/solr/{conf → configsets/sunspot/conf}/elevate.xml +0 -0
  380. data/solr/solr/{conf/stopwords.txt → configsets/sunspot/conf/lang/stopwords_en.txt} +1 -5
  381. data/solr/solr/{conf → configsets/sunspot/conf}/mapping-ISOLatin1Accent.txt +0 -0
  382. data/solr/solr/{conf → configsets/sunspot/conf}/protwords.txt +0 -0
  383. data/solr/solr/{conf → configsets/sunspot/conf}/schema.xml +36 -33
  384. data/solr/solr/{conf → configsets/sunspot/conf}/scripts.conf +0 -0
  385. data/solr/solr/{conf → configsets/sunspot/conf}/solrconfig.xml +269 -318
  386. data/solr/solr/{conf → configsets/sunspot/conf}/spellings.txt +0 -0
  387. data/solr/solr/{conf → configsets/sunspot/conf}/synonyms.txt +3 -5
  388. data/solr/solr/default/core.properties +3 -0
  389. data/solr/solr/development/core.properties +3 -0
  390. data/solr/solr/solr.xml +49 -6
  391. data/solr/solr/test/core.properties +3 -0
  392. data/solr/solr/zoo.cfg +17 -0
  393. data/spec/server_spec.rb +0 -6
  394. data/sunspot_solr.gemspec +1 -1
  395. metadata +390 -48
  396. data/solr/lib/jetty-http-8.1.8.v20121106.jar +0 -0
  397. data/solr/lib/jetty-server-8.1.8.v20121106.jar +0 -0
  398. data/solr/lib/jetty-servlet-8.1.8.v20121106.jar +0 -0
  399. data/solr/lib/jetty-xml-8.1.8.v20121106.jar +0 -0
  400. data/solr/lib/jsp-2.1/ant-1.6.5.jar +0 -0
  401. data/solr/lib/jsp-2.1/core-3.1.1.jar +0 -0
  402. data/solr/lib/jsp-2.1/jsp-2.1.jar +0 -0
  403. data/solr/lib/jsp-2.1/jsp-api-2.1.jar +0 -0
  404. data/solr/solr/conf/xslt/example.xsl +0 -132
  405. data/solr/solr/conf/xslt/example_atom.xsl +0 -67
  406. data/solr/solr/conf/xslt/example_rss.xsl +0 -66
  407. data/solr/solr/conf/xslt/luke.xsl +0 -337
  408. data/solr/solr/default/README.txt +0 -54
  409. data/solr/start.jar +0 -0
  410. data/solr/webapps/solr.war +0 -0
data/solr/bin/solr.cmd ADDED
@@ -0,0 +1,1384 @@
1
+ @REM
2
+ @REM Licensed to the Apache Software Foundation (ASF) under one or more
3
+ @REM contributor license agreements. See the NOTICE file distributed with
4
+ @REM this work for additional information regarding copyright ownership.
5
+ @REM The ASF licenses this file to You under the Apache License, Version 2.0
6
+ @REM (the "License"); you may not use this file except in compliance with
7
+ @REM the License. You may obtain a copy of the License at
8
+ @REM
9
+ @REM http://www.apache.org/licenses/LICENSE-2.0
10
+ @REM
11
+ @REM Unless required by applicable law or agreed to in writing, software
12
+ @REM distributed under the License is distributed on an "AS IS" BASIS,
13
+ @REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ @REM See the License for the specific language governing permissions and
15
+ @REM limitations under the License.
16
+
17
+ @echo off
18
+
19
+ IF "%OS%"=="Windows_NT" setlocal enabledelayedexpansion enableextensions
20
+
21
+ REM Determine top-level Solr directory
22
+ set SDIR=%~dp0
23
+ IF "%SDIR:~-1%"=="\" set SDIR=%SDIR:~0,-1%
24
+ set SOLR_TIP=%SDIR%\..
25
+ pushd %SOLR_TIP%
26
+ set SOLR_TIP=%CD%
27
+ popd
28
+
29
+ REM Used to report errors before exiting the script
30
+ set SCRIPT_ERROR=
31
+ set NO_USER_PROMPT=0
32
+
33
+ REM Allow user to import vars from an include file
34
+ REM vars set in the include file can be overridden with
35
+ REM command line args
36
+ IF "%SOLR_INCLUDE%"=="" set "SOLR_INCLUDE=%SOLR_TIP%\bin\solr.in.cmd"
37
+ IF EXIST "%SOLR_INCLUDE%" CALL "%SOLR_INCLUDE%"
38
+
39
+ REM URL scheme for contacting Solr
40
+ 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
+
44
+ REM Verify Java is available
45
+ IF DEFINED SOLR_JAVA_HOME set "JAVA_HOME=%SOLR_JAVA_HOME%"
46
+ REM Try to detect JAVA_HOME from the registry
47
+ IF NOT DEFINED JAVA_HOME (
48
+ FOR /F "skip=2 tokens=2*" %%A IN ('REG QUERY "HKLM\Software\JavaSoft\Java Runtime Environment" /v CurrentVersion') DO set CurVer=%%B
49
+ FOR /F "skip=2 tokens=2*" %%A IN ('REG QUERY "HKLM\Software\JavaSoft\Java Runtime Environment\!CurVer!" /v JavaHome') DO (
50
+ set "JAVA_HOME=%%B"
51
+ )
52
+ )
53
+ IF NOT DEFINED JAVA_HOME goto need_java_home
54
+ set JAVA_HOME=%JAVA_HOME:"=%
55
+ IF %JAVA_HOME:~-1%==\ SET JAVA_HOME=%JAVA_HOME:~0,-1%
56
+ IF NOT EXIST "%JAVA_HOME%\bin\java.exe" (
57
+ set "SCRIPT_ERROR=java.exe not found in %JAVA_HOME%\bin. Please set JAVA_HOME to a valid JRE / JDK directory."
58
+ goto err
59
+ )
60
+ set "JAVA=%JAVA_HOME%\bin\java"
61
+ CALL :resolve_java_version
62
+ IF !JAVA_MAJOR_VERSION! LSS 7 (
63
+ set "SCRIPT_ERROR=Java 1.7 or later is required to run Solr. Current Java version is: !JAVA_VERSION_INFO!"
64
+ goto err
65
+ )
66
+
67
+ set "DEFAULT_SERVER_DIR=%SOLR_TIP%\server"
68
+
69
+ set FIRST_ARG=%1
70
+
71
+ IF [%1]==[] goto usage
72
+
73
+ IF "%1"=="-help" goto usage
74
+ IF "%1"=="-usage" goto usage
75
+ IF "%1"=="/?" goto usage
76
+ IF "%1"=="-i" goto get_info
77
+ IF "%1"=="-info" goto get_info
78
+ IF "%1"=="status" goto get_info
79
+
80
+ REM Only allow the command to be the first argument, assume start if not supplied
81
+ IF "%1"=="start" goto set_script_cmd
82
+ IF "%1"=="stop" goto set_script_cmd
83
+ IF "%1"=="restart" goto set_script_cmd
84
+ IF "%1"=="healthcheck" (
85
+ REM healthcheck uses different arg parsing strategy
86
+ set SCRIPT_CMD=healthcheck
87
+ SHIFT
88
+ goto parse_healthcheck_args
89
+ )
90
+ IF "%1"=="create" (
91
+ set SCRIPT_CMD=create
92
+ SHIFT
93
+ goto parse_create_args
94
+ )
95
+ IF "%1"=="create_core" (
96
+ set SCRIPT_CMD=create_core
97
+ SHIFT
98
+ goto parse_create_args
99
+ )
100
+ IF "%1"=="create_collection" (
101
+ set SCRIPT_CMD=create_collection
102
+ SHIFT
103
+ goto parse_create_args
104
+ )
105
+ IF "%1"=="delete" (
106
+ set SCRIPT_CMD=delete
107
+ SHIFT
108
+ goto parse_delete_args
109
+ )
110
+ goto parse_args
111
+
112
+ :usage
113
+ IF NOT "%SCRIPT_ERROR%"=="" ECHO %SCRIPT_ERROR%
114
+ IF [%FIRST_ARG%]==[] goto script_usage
115
+ IF "%FIRST_ARG%"=="-help" goto script_usage
116
+ IF "%FIRST_ARG%"=="-usage" goto script_usage
117
+ IF "%FIRST_ARG%"=="/?" goto script_usage
118
+ IF "%SCRIPT_CMD%"=="start" goto start_usage
119
+ IF "%SCRIPT_CMD%"=="restart" goto start_usage
120
+ IF "%SCRIPT_CMD%"=="stop" goto stop_usage
121
+ IF "%SCRIPT_CMD%"=="healthcheck" goto healthcheck_usage
122
+ IF "%SCRIPT_CMD%"=="create" goto create_usage
123
+ IF "%SCRIPT_CMD%"=="create_core" goto create_core_usage
124
+ IF "%SCRIPT_CMD%"=="create_collection" goto create_collection_usage
125
+ IF "%SCRIPT_CMD%"=="delete" goto delete_usage
126
+ goto done
127
+
128
+ :script_usage
129
+ @echo.
130
+ @echo Usage: solr COMMAND OPTIONS
131
+ @echo where COMMAND is one of: start, stop, restart, healthcheck, create, create_core, create_collection, delete
132
+ @echo.
133
+ @echo Standalone server example (start Solr running in the background on port 8984):
134
+ @echo.
135
+ @echo solr start -p 8984
136
+ @echo.
137
+ @echo SolrCloud example (start Solr running in SolrCloud mode using localhost:2181 to connect to ZooKeeper, with 1g max heap size and remote Java debug options enabled):
138
+ @echo.
139
+ @echo solr start -c -m 1g -z localhost:2181 -a "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044"
140
+ @echo.
141
+ @echo Pass -help after any COMMAND to see command-specific usage information,
142
+ @echo such as: solr start -help or solr stop -help
143
+ @echo.
144
+ goto done
145
+
146
+ :start_usage
147
+ @echo.
148
+ @echo Usage: solr %SCRIPT_CMD% [-f] [-c] [-h hostname] [-p port] [-d directory] [-z zkHost] [-m memory] [-e example] [-s solr.solr.home] [-a "additional-options"] [-V]
149
+ @echo.
150
+ @echo -f Start Solr in foreground; default starts Solr in the background
151
+ @echo and sends stdout / stderr to solr-PORT-console.log
152
+ @echo.
153
+ @echo -c or -cloud Start Solr in SolrCloud mode; if -z not supplied, an embedded ZooKeeper
154
+ @echo instance is started on Solr port+1000, such as 9983 if Solr is bound to 8983
155
+ @echo.
156
+ @echo -h host Specify the hostname for this Solr instance
157
+ @echo.
158
+ @echo -p port Specify the port to start the Solr HTTP listener on; default is 8983
159
+ @echo.
160
+ @echo -d dir Specify the Solr server directory; defaults to example
161
+ @echo.
162
+ @echo -z zkHost ZooKeeper connection string; only used when running in SolrCloud mode using -c
163
+ @echo To launch an embedded ZooKeeper instance, don't pass this parameter.
164
+ @echo.
165
+ @echo -m memory Sets the min (-Xms) and max (-Xmx) heap size for the JVM, such as: -m 4g
166
+ @echo results in: -Xms4g -Xmx4g; by default, this script sets the heap size to 512m
167
+ @echo.
168
+ @echo -s dir Sets the solr.solr.home system property; Solr will create core directories under
169
+ @echo this directory. This allows you to run multiple Solr instances on the same host
170
+ @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.
172
+ @echo This parameter is ignored when running examples (-e), as the solr.solr.home depends
173
+ @echo on which example is run.
174
+ @echo.
175
+ @echo -e example Name of the example to run; available examples:
176
+ @echo cloud: SolrCloud example
177
+ @echo techproducts: Comprehensive example illustrating many of Solr's core capabilities
178
+ @echo dih: Data Import Handler
179
+ @echo schemaless: Schema-less example
180
+ @echo.
181
+ @echo -a opts Additional parameters to pass to the JVM when starting Solr, such as to setup
182
+ @echo Java debug options. For example, to enable a Java debugger to attach to the Solr JVM
183
+ @echo you could pass: -a "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=18983"
184
+ @echo In most cases, you should wrap the additional parameters in double quotes.
185
+ @echo.
186
+ @echo -noprompt Don't prompt for input; accept all defaults when running examples that accept user input
187
+ @echo.
188
+ @echo -V Verbose messages from this script
189
+ @echo.
190
+ goto done
191
+
192
+ :stop_usage
193
+ @echo.
194
+ @echo Usage: solr stop [-k key] [-p port]
195
+ @echo.
196
+ @echo -k key Stop key; default is solrrocks
197
+ @echo.
198
+ @echo -p port Specify the port the Solr HTTP listener is bound to
199
+ @echo.
200
+ @echo -all Find and stop all running Solr servers on this host
201
+ @echo.
202
+ goto done
203
+
204
+ :healthcheck_usage
205
+ @echo.
206
+ @echo Usage: solr healthcheck [-c collection] [-z zkHost]
207
+ @echo.
208
+ @echo -c collection Collection to run healthcheck against.
209
+ @echo.
210
+ @echo -z zkHost ZooKeeper connection string; default is localhost:9983
211
+ @echo.
212
+ goto done
213
+
214
+ :create_usage
215
+ echo.
216
+ echo Usage: solr create [-c name] [-d confdir] [-n confname] [-shards #] [-replicationFactor #] [-p port]
217
+ echo.
218
+ echo Create a core or collection depending on whether Solr is running in standalone (core) or SolrCloud
219
+ echo mode (collection). In other words, this action detects which mode Solr is running in, and then takes
220
+ echo the appropriate action (either create_core or create_collection). For detailed usage instructions, do:
221
+ echo.
222
+ echo bin\solr create_core -help
223
+ echo.
224
+ echo or
225
+ echo.
226
+ echo bin\solr create_collection -help
227
+ echo.
228
+ goto done
229
+
230
+ :delete_usage
231
+ echo.
232
+ echo Usage: solr delete [-c name] [-deleteConfig boolean] [-p port]
233
+ echo.
234
+ echo Deletes a core or collection depending on whether Solr is running in standalone (core) or SolrCloud
235
+ echo mode (collection). If you're deleting a collection in SolrCloud mode, the default behavior is to also
236
+ echo delete the configuration directory from ZooKeeper so long as it is not being used by another collection.
237
+ echo You can override this behavior by passing -deleteConfig false when running this command.
238
+ echo.
239
+ echo -c name Name of core to create
240
+ echo.
241
+ echo -deleteConfig boolean Delete the configuration directory from ZooKeeper; default is true
242
+ echo.
243
+ echo -p port Port of a local Solr instance where you want to create the new core
244
+ echo If not specified, the script will search the local system for a running
245
+ echo Solr instance and will use the port of the first server it finds.
246
+ echo.
247
+ goto done
248
+
249
+ :create_core_usage
250
+ echo.
251
+ echo Usage: solr create_core [-c name] [-d confdir] [-p port]
252
+ echo.
253
+ echo -c name Name of core to create
254
+ echo.
255
+ echo -d confdir Configuration directory to copy when creating the new core, built-in options are:
256
+ echo.
257
+ echo basic_configs: Minimal Solr configuration
258
+ echo data_driven_schema_configs: Managed schema with field-guessing support enabled
259
+ echo sample_techproducts_configs: Example configuration with many optional features enabled to
260
+ echo demonstrate the full power of Solr
261
+ echo.
262
+ echo If not specified, default is: data_driven_schema_configs
263
+ echo.
264
+ echo Alternatively, you can pass the path to your own configuration directory instead of using
265
+ echo one of the built-in configurations, such as: bin\solr create_core -c mycore -d c:/tmp/myconfig
266
+ echo.
267
+ echo -p port Port of a local Solr instance where you want to create the new core
268
+ echo If not specified, the script will search the local system for a running
269
+ echo Solr instance and will use the port of the first server it finds.
270
+ echo.
271
+ goto done
272
+
273
+ :create_collection_usage
274
+ echo.
275
+ echo Usage: solr create_collection [-c name] [-d confdir] [-n confname] [-shards #] [-replicationFactor #] [-p port]
276
+ echo.
277
+ echo -c name Name of collection to create
278
+ echo.
279
+ echo -d confdir Configuration directory to copy when creating the new collection, built-in options are:
280
+ echo.
281
+ echo basic_configs: Minimal Solr configuration
282
+ echo data_driven_schema_configs: Managed schema with field-guessing support enabled
283
+ echo sample_techproducts_configs: Example configuration with many optional features enabled to
284
+ echo demonstrate the full power of Solr
285
+ echo.
286
+ echo If not specified, default is: data_driven_schema_configs
287
+ echo.
288
+ echo Alternatively, you can pass the path to your own configuration directory instead of using
289
+ echo one of the built-in configurations, such as: bin\solr create_collection -c mycoll -d c:/tmp/myconfig
290
+ echo.
291
+ echo By default the script will upload the specified confdir directory into ZooKeeper using the same
292
+ echo name as the collection (-c) option. Alternatively, if you want to reuse an existing directory
293
+ echo or create a confdir in ZooKeeper that can be shared by multiple collections, use the -n option
294
+ echo.
295
+ echo -n configName Name the configuration directory in ZooKeeper; by default, the configuration
296
+ echo will be uploaded to ZooKeeper using the collection name (-c), but if you want
297
+ echo to use an existing directory or override the name of the configuration in
298
+ echo ZooKeeper, then use the -c option.
299
+ echo.
300
+ echo -shards # Number of shards to split the collection into
301
+ echo.
302
+ echo -replicationFactor # Number of copies of each document in the collection
303
+ echo.
304
+ echo -p port Port of a local Solr instance where you want to create the new collection
305
+ echo If not specified, the script will search the local system for a running
306
+ echo Solr instance and will use the port of the first server it finds.
307
+ echo.
308
+ goto done
309
+
310
+ REM Really basic command-line arg parsing
311
+ :parse_args
312
+
313
+ set "arg=%~1"
314
+ set "firstTwo=%arg:~0,2%"
315
+ IF "%SCRIPT_CMD%"=="" set SCRIPT_CMD=start
316
+ IF [%1]==[] goto process_script_cmd
317
+ IF "%1"=="-help" goto usage
318
+ IF "%1"=="-usage" goto usage
319
+ IF "%1"=="/?" goto usage
320
+ IF "%1"=="-f" goto set_foreground_mode
321
+ IF "%1"=="-foreground" goto set_foreground_mode
322
+ IF "%1"=="-V" goto set_verbose
323
+ IF "%1"=="-verbose" goto set_verbose
324
+ IF "%1"=="-c" goto set_cloud_mode
325
+ IF "%1"=="-cloud" goto set_cloud_mode
326
+ IF "%1"=="-d" goto set_server_dir
327
+ IF "%1"=="-dir" goto set_server_dir
328
+ IF "%1"=="-s" goto set_solr_home_dir
329
+ IF "%1"=="-solr.home" goto set_solr_home_dir
330
+ IF "%1"=="-e" goto set_example
331
+ IF "%1"=="-example" goto set_example
332
+ IF "%1"=="-h" goto set_host
333
+ IF "%1"=="-host" goto set_host
334
+ IF "%1"=="-m" goto set_memory
335
+ IF "%1"=="-memory" goto set_memory
336
+ IF "%1"=="-p" goto set_port
337
+ IF "%1"=="-port" goto set_port
338
+ IF "%1"=="-z" goto set_zookeeper
339
+ IF "%1"=="-zkhost" goto set_zookeeper
340
+ IF "%1"=="-a" goto set_addl_opts
341
+ IF "%1"=="-addlopts" goto set_addl_opts
342
+ IF "%1"=="-noprompt" goto set_noprompt
343
+ IF "%1"=="-k" goto set_stop_key
344
+ IF "%1"=="-key" goto set_stop_key
345
+ IF "%1"=="-all" goto set_stop_all
346
+ IF "%firstTwo%"=="-D" goto set_passthru
347
+ IF NOT "%1"=="" goto invalid_cmd_line
348
+
349
+ :set_script_cmd
350
+ set SCRIPT_CMD=%1
351
+ SHIFT
352
+ goto parse_args
353
+
354
+ :set_foreground_mode
355
+ set FG=1
356
+ SHIFT
357
+ goto parse_args
358
+
359
+ :set_verbose
360
+ set verbose=1
361
+ SHIFT
362
+ goto parse_args
363
+
364
+ :set_cloud_mode
365
+ set SOLR_MODE=solrcloud
366
+ SHIFT
367
+ goto parse_args
368
+
369
+ :set_server_dir
370
+
371
+ set "arg=%~2"
372
+ IF "%arg%"=="" (
373
+ set SCRIPT_ERROR=Directory name is required!
374
+ goto invalid_cmd_line
375
+ )
376
+ set firstChar=%arg:~0,1%
377
+ IF "%firstChar%"=="-" (
378
+ set SCRIPT_ERROR=Expected directory but found %2 instead!
379
+ goto invalid_cmd_line
380
+ )
381
+
382
+ REM See if they are using a short-hand name relative from the Solr tip directory
383
+ IF EXIST "%SOLR_TIP%\%~2" (
384
+ set "SOLR_SERVER_DIR=%SOLR_TIP%\%~2"
385
+ ) ELSE (
386
+ set "SOLR_SERVER_DIR=%~2"
387
+ )
388
+ SHIFT
389
+ SHIFT
390
+ goto parse_args
391
+
392
+ :set_solr_home_dir
393
+
394
+ set "arg=%~2"
395
+ IF "%arg%"=="" (
396
+ set SCRIPT_ERROR=Directory name is required!
397
+ goto invalid_cmd_line
398
+ )
399
+
400
+ set firstChar=%arg:~0,1%
401
+ IF "%firstChar%"=="-" (
402
+ set SCRIPT_ERROR=Expected directory but found %2 instead!
403
+ goto invalid_cmd_line
404
+ )
405
+ set "SOLR_HOME=%~2"
406
+ SHIFT
407
+ SHIFT
408
+ goto parse_args
409
+
410
+ :set_example
411
+
412
+ set "arg=%~2"
413
+ IF "%arg%"=="" (
414
+ set SCRIPT_ERROR=Example name is required!
415
+ goto invalid_cmd_line
416
+ )
417
+
418
+ set firstChar=%arg:~0,1%
419
+ IF "%firstChar%"=="-" (
420
+ set SCRIPT_ERROR=Expected example name but found %2 instead!
421
+ goto invalid_cmd_line
422
+ )
423
+
424
+ set EXAMPLE=%~2
425
+ SHIFT
426
+ SHIFT
427
+ goto parse_args
428
+
429
+ :set_memory
430
+
431
+ set "arg=%~2"
432
+ IF "%arg%"=="" (
433
+ set SCRIPT_ERROR=Memory setting is required!
434
+ goto invalid_cmd_line
435
+ )
436
+
437
+ set firstChar=%arg:~0,1%
438
+ IF "%firstChar%"=="-" (
439
+ set SCRIPT_ERROR=Expected memory setting but found %2 instead!
440
+ goto invalid_cmd_line
441
+ )
442
+
443
+ set SOLR_HEAP=%~2
444
+ SHIFT
445
+ SHIFT
446
+ goto parse_args
447
+
448
+ :set_host
449
+ set "arg=%~2"
450
+ IF "%arg%"=="" (
451
+ set SCRIPT_ERROR=Hostname is required!
452
+ goto invalid_cmd_line
453
+ )
454
+
455
+ set firstChar=%arg:~0,1%
456
+ IF "%firstChar%"=="-" (
457
+ set SCRIPT_ERROR=Expected hostname but found %2 instead!
458
+ goto invalid_cmd_line
459
+ )
460
+
461
+ set SOLR_HOST=%~2
462
+ SHIFT
463
+ SHIFT
464
+ goto parse_args
465
+
466
+ :set_port
467
+ set "arg=%~2"
468
+ IF "%arg%"=="" (
469
+ set SCRIPT_ERROR=Port is required!
470
+ goto invalid_cmd_line
471
+ )
472
+
473
+ set firstChar=%arg:~0,1%
474
+ IF "%firstChar%"=="-" (
475
+ set SCRIPT_ERROR=Expected port but found %2 instead!
476
+ goto invalid_cmd_line
477
+ )
478
+
479
+ set SOLR_PORT=%~2
480
+ SHIFT
481
+ SHIFT
482
+ goto parse_args
483
+
484
+ :set_stop_key
485
+ set "arg=%~2"
486
+ IF "%arg%"=="" (
487
+ set SCRIPT_ERROR=Stop key is required!
488
+ goto invalid_cmd_line
489
+ )
490
+
491
+ set firstChar=%arg:~0,1%
492
+ IF "%firstChar%"=="-" (
493
+ set SCRIPT_ERROR=Expected stop key but found %2 instead!
494
+ goto invalid_cmd_line
495
+ )
496
+ set STOP_KEY=%~2
497
+ SHIFT
498
+ SHIFT
499
+ goto parse_args
500
+
501
+ :set_stop_all
502
+ set STOP_ALL=1
503
+ SHIFT
504
+ goto parse_args
505
+
506
+ :set_zookeeper
507
+
508
+ set "arg=%~2"
509
+ IF "%arg%"=="" (
510
+ set SCRIPT_ERROR=ZooKeeper connection string is required!
511
+ goto invalid_cmd_line
512
+ )
513
+
514
+ set firstChar=%arg:~0,1%
515
+ IF "%firstChar%"=="-" (
516
+ set SCRIPT_ERROR=Expected ZooKeeper connection string but found %2 instead!
517
+ goto invalid_cmd_line
518
+ )
519
+
520
+ set "ZK_HOST=%~2"
521
+ SHIFT
522
+ SHIFT
523
+ goto parse_args
524
+
525
+ :set_addl_opts
526
+ set "arg=%~2"
527
+ set "SOLR_ADDL_ARGS=%~2"
528
+ SHIFT
529
+ SHIFT
530
+ goto parse_args
531
+
532
+ :set_passthru
533
+ set "PASSTHRU=%~1=%~2"
534
+ IF NOT "%SOLR_OPTS%"=="" (
535
+ set "SOLR_OPTS=%SOLR_OPTS% %PASSTHRU%"
536
+ ) ELSE (
537
+ set "SOLR_OPTS=%PASSTHRU%"
538
+ )
539
+ SHIFT
540
+ SHIFT
541
+ goto parse_args
542
+
543
+ :set_noprompt
544
+ set NO_USER_PROMPT=1
545
+ SHIFT
546
+ goto parse_args
547
+
548
+ REM Perform the requested command after processing args
549
+ :process_script_cmd
550
+
551
+ IF "%verbose%"=="1" (
552
+ CALL :safe_echo "Using Solr root directory: %SOLR_TIP%"
553
+ CALL :safe_echo "Using Java: %JAVA%"
554
+ "%JAVA%" -version
555
+ @echo.
556
+ )
557
+
558
+ IF NOT "%SOLR_HOST%"=="" (
559
+ set SOLR_HOST_ARG=-Dhost=%SOLR_HOST%
560
+ ) ELSE (
561
+ set SOLR_HOST_ARG=
562
+ )
563
+
564
+ IF "%SOLR_SERVER_DIR%"=="" set "SOLR_SERVER_DIR=%DEFAULT_SERVER_DIR%"
565
+
566
+ IF NOT EXIST "%SOLR_SERVER_DIR%" (
567
+ set "SCRIPT_ERROR=Solr server directory %SOLR_SERVER_DIR% not found!"
568
+ goto err
569
+ )
570
+
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
+ )
602
+
603
+ :start_solr
604
+ IF "%SOLR_HOME%"=="" set "SOLR_HOME=%SOLR_SERVER_DIR%\solr"
605
+ IF NOT EXIST "%SOLR_HOME%\" (
606
+ IF EXIST "%SOLR_SERVER_DIR%\%SOLR_HOME%" (
607
+ set "SOLR_HOME=%SOLR_SERVER_DIR%\%SOLR_HOME%"
608
+ ) ELSE IF EXIST "%cd%\%SOLR_HOME%" (
609
+ set "SOLR_HOME=%cd%\%SOLR_HOME%"
610
+ ) ELSE (
611
+ set "SCRIPT_ERROR=Solr home directory %SOLR_HOME% not found!"
612
+ goto err
613
+ )
614
+ )
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
+ IF "%STOP_KEY%"=="" set STOP_KEY=solrrocks
622
+
623
+ @REM This is quite hacky, but examples rely on a different log4j.properties
624
+ @REM so that we can write logs for examples to %SOLR_HOME%\..\logs
625
+ set "SOLR_LOGS_DIR=%SOLR_SERVER_DIR%\logs"
626
+ set "EXAMPLE_DIR=%SOLR_TIP%\example"
627
+ set LOG4J_CONFIG=
628
+ set TMP=!SOLR_HOME:%EXAMPLE_DIR%=!
629
+ IF NOT "%TMP%"=="%SOLR_HOME%" (
630
+ set "SOLR_LOGS_DIR=%SOLR_HOME%\..\logs"
631
+ set "LOG4J_CONFIG=file:%EXAMPLE_DIR%\resources\log4j.properties"
632
+ )
633
+
634
+ set IS_RESTART=0
635
+ IF "%SCRIPT_CMD%"=="restart" (
636
+ IF "%SOLR_PORT%"=="" (
637
+ set "SCRIPT_ERROR=Must specify the port when trying to restart Solr."
638
+ goto err
639
+ )
640
+ set SCRIPT_CMD=stop
641
+ set IS_RESTART=1
642
+ )
643
+
644
+ @REM stop logic here
645
+ IF "%SCRIPT_CMD%"=="stop" (
646
+ IF "%SOLR_PORT%"=="" (
647
+ IF "%STOP_ALL%"=="1" (
648
+ set found_it=0
649
+ for /f "usebackq" %%i in (`dir /b "%SOLR_TIP%\bin" ^| findstr /i "^solr-.*\.port$"`) do (
650
+ set SOME_SOLR_PORT=
651
+ For /F "Delims=" %%J In ('type "%SOLR_TIP%\bin\%%i"') do set SOME_SOLR_PORT=%%~J
652
+ if NOT "!SOME_SOLR_PORT!"=="" (
653
+ for /f "tokens=2,5" %%j in ('netstat -aon ^| find "TCP " ^| find ":!SOME_SOLR_PORT! "') do (
654
+ @REM j is the ip:port and k is the pid
655
+ IF NOT "%%k"=="0" (
656
+ @REM split the ip:port var by colon to see if the ip is 0.0.0.0
657
+ for /f "delims=: tokens=1,2" %%x IN ("%%j") do (
658
+ @REM x is the ip
659
+ IF "%%x"=="0.0.0.0" (
660
+ set found_it=1
661
+ @echo Stopping Solr process %%k running on port !SOME_SOLR_PORT!
662
+ set /A STOP_PORT=!SOME_SOLR_PORT! - 1000
663
+ "%JAVA%" %SOLR_SSL_OPTS% -Djetty.home="%SOLR_SERVER_DIR%" -jar "%SOLR_SERVER_DIR%\start.jar" STOP.PORT=!STOP_PORT! STOP.KEY=%STOP_KEY% --stop
664
+ del "%SOLR_TIP%"\bin\solr-!SOME_SOLR_PORT!.port
665
+ timeout /T 5
666
+ REM Kill it if it is still running after the graceful shutdown
667
+ For /f "tokens=2,5" %%M in ('netstat -nao ^| find "TCP " ^| find ":!SOME_SOLR_PORT! "') do (
668
+ IF "%%N"=="%%k" (
669
+ for /f "delims=: tokens=1,2" %%a IN ("%%M") do (
670
+ IF "%%a"=="0.0.0.0" (
671
+ @echo Forcefully killing process %%N
672
+ taskkill /f /PID %%N
673
+ )
674
+ )
675
+ )
676
+ )
677
+ )
678
+ )
679
+ )
680
+ )
681
+ )
682
+ )
683
+ if "!found_it!"=="0" echo No Solr nodes found to stop.
684
+ ) ELSE (
685
+ set "SCRIPT_ERROR=Must specify the port when trying to stop Solr, or use -all to stop all running nodes on this host."
686
+ goto err
687
+ )
688
+ ) ELSE (
689
+ set found_it=0
690
+ For /f "tokens=2,5" %%M in ('netstat -nao ^| find "TCP " ^| find ":%SOLR_PORT% "') do (
691
+ IF NOT "%%N"=="0" (
692
+ for /f "delims=: tokens=1,2" %%x IN ("%%M") do (
693
+ IF "%%x"=="0.0.0.0" (
694
+ set found_it=1
695
+ @echo Stopping Solr process %%N running on port %SOLR_PORT%
696
+ 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
698
+ del "%SOLR_TIP%"\bin\solr-%SOLR_PORT%.port
699
+ timeout /T 5
700
+ REM Kill it if it is still running after the graceful shutdown
701
+ For /f "tokens=2,5" %%j in ('netstat -nao ^| find "TCP " ^| find ":%SOLR_PORT% "') do (
702
+ IF "%%N"=="%%k" (
703
+ for /f "delims=: tokens=1,2" %%a IN ("%%j") do (
704
+ IF "%%a"=="0.0.0.0" (
705
+ @echo Forcefully killing process %%N
706
+ taskkill /f /PID %%N
707
+ )
708
+ )
709
+ )
710
+ )
711
+ )
712
+ )
713
+ )
714
+ )
715
+ if "!found_it!"=="0" echo No Solr found running on port %SOLR_PORT%
716
+ )
717
+
718
+ IF "!IS_RESTART!"=="0" goto done
719
+ )
720
+
721
+ IF "!IS_RESTART!"=="1" set SCRIPT_CMD=start
722
+
723
+ IF "%SOLR_PORT%"=="" set SOLR_PORT=8983
724
+ IF "%STOP_PORT%"=="" set /A STOP_PORT=%SOLR_PORT% - 1000
725
+
726
+ IF "%SCRIPT_CMD%"=="start" (
727
+ REM see if Solr is already running using netstat
728
+ For /f "tokens=2,5" %%j in ('netstat -aon ^| find "TCP " ^| find ":%SOLR_PORT% "') do (
729
+ IF NOT "%%k"=="0" (
730
+ for /f "delims=: tokens=1,2" %%x IN ("%%j") do (
731
+ IF "%%x"=="0.0.0.0" (
732
+ set "SCRIPT_ERROR=Process %%k is already listening on port %SOLR_PORT%. If this is Solr, please stop it first before starting (or use restart). If this is not Solr, then please choose a different port using -p PORT"
733
+ goto err
734
+ )
735
+ )
736
+ )
737
+ )
738
+ )
739
+
740
+ @REM determine if -server flag is supported by current JVM
741
+ "%JAVA%" -server -version > nul 2>&1
742
+ IF ERRORLEVEL 1 (
743
+ set IS_JDK=false
744
+ set "SERVEROPT="
745
+ @echo WARNING: You are using a JRE without support for -server option. Please upgrade to latest JDK for best performance
746
+ @echo.
747
+ ) ELSE (
748
+ set IS_JDK=true
749
+ set "SERVEROPT=-server"
750
+ )
751
+ "%JAVA%" -d64 -version > nul 2>&1
752
+ IF ERRORLEVEL 1 (
753
+ set "IS_64BIT=false"
754
+ @echo WARNING: 32-bit Java detected. Not recommended for production. Point your JAVA_HOME to a 64-bit JDK
755
+ @echo.
756
+ ) ELSE (
757
+ set IS_64bit=true
758
+ )
759
+
760
+ REM backup log files (use current timestamp for backup name)
761
+ For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
762
+ For /f "tokens=1-2 delims=/:" %%a in ("%TIME%") do (set mytime=%%a%%b)
763
+ set now_ts=!mydate!_!mytime!
764
+ IF EXIST "!SOLR_LOGS_DIR!\solr.log" (
765
+ echo Backing up !SOLR_LOGS_DIR!\solr.log
766
+ move /Y "!SOLR_LOGS_DIR!\solr.log" "!SOLR_LOGS_DIR!\solr_log_!now_ts!"
767
+ )
768
+
769
+ IF EXIST "!SOLR_LOGS_DIR!\solr_gc.log" (
770
+ echo Backing up !SOLR_LOGS_DIR!\solr_gc.log
771
+ move /Y "!SOLR_LOGS_DIR!\solr_gc.log" "!SOLR_LOGS_DIR!\solr_gc_log_!now_ts!"
772
+ )
773
+
774
+ IF "%SOLR_MODE%"=="solrcloud" (
775
+ IF "%ZK_CLIENT_TIMEOUT%"=="" set "ZK_CLIENT_TIMEOUT=15000"
776
+
777
+ set "CLOUD_MODE_OPTS=-DzkClientTimeout=!ZK_CLIENT_TIMEOUT!"
778
+
779
+ IF NOT "%ZK_HOST%"=="" (
780
+ set "CLOUD_MODE_OPTS=!CLOUD_MODE_OPTS! -DzkHost=%ZK_HOST%"
781
+ ) ELSE (
782
+ IF "%verbose%"=="1" echo Configuring SolrCloud to launch an embedded ZooKeeper using -DzkRun
783
+ set "CLOUD_MODE_OPTS=!CLOUD_MODE_OPTS! -DzkRun"
784
+ )
785
+ 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
+ ) ELSE (
787
+ set CLOUD_MODE_OPTS=
788
+ )
789
+
790
+ REM These are useful for attaching remove profilers like VisualVM/JConsole
791
+ IF "%ENABLE_REMOTE_JMX_OPTS%"=="true" (
792
+ IF "!RMI_PORT!"=="" set RMI_PORT=1%SOLR_PORT%
793
+ set REMOTE_JMX_OPTS=-Dcom.sun.management.jmxremote ^
794
+ -Dcom.sun.management.jmxremote.local.only=false ^
795
+ -Dcom.sun.management.jmxremote.ssl=false ^
796
+ -Dcom.sun.management.jmxremote.authenticate=false ^
797
+ -Dcom.sun.management.jmxremote.port=!RMI_PORT! ^
798
+ -Dcom.sun.management.jmxremote.rmi.port=!RMI_PORT!
799
+
800
+ IF NOT "%SOLR_HOST%"=="" set REMOTE_JMX_OPTS=%REMOTE_JMX_OPTS% -Djava.rmi.server.hostname=%SOLR_HOST%
801
+ ) ELSE (
802
+ set REMOTE_JMX_OPTS=
803
+ )
804
+
805
+ IF NOT "%SOLR_HEAP%"=="" set SOLR_JAVA_MEM=-Xms%SOLR_HEAP% -Xmx%SOLR_HEAP%
806
+ IF "%SOLR_JAVA_MEM%"=="" set SOLR_JAVA_MEM=-Xms512m -Xmx512m
807
+ IF "%SOLR_TIMEZONE%"=="" set SOLR_TIMEZONE=UTC
808
+
809
+ IF "!JAVA_MAJOR_VERSION!"=="7" (
810
+ set "GC_TUNE=%GC_TUNE% -XX:CMSFullGCsBeforeCompaction=1 -XX:CMSTriggerPermRatio=80"
811
+ IF !JAVA_BUILD! GEQ 40 (
812
+ IF !JAVA_BUILD! LEQ 51 (
813
+ set "GC_TUNE=!GC_TUNE! -XX:-UseSuperWord"
814
+ @echo WARNING: Java version !JAVA_VERSION_INFO! has known bugs with Lucene and requires the -XX:-UseSuperWord flag. Please consider upgrading your JVM.
815
+ )
816
+ )
817
+ )
818
+
819
+ IF "%verbose%"=="1" (
820
+ @echo Starting Solr using the following settings:
821
+ CALL :safe_echo " JAVA = %JAVA%"
822
+ CALL :safe_echo " SOLR_SERVER_DIR = %SOLR_SERVER_DIR%"
823
+ CALL :safe_echo " SOLR_HOME = %SOLR_HOME%"
824
+ @echo SOLR_HOST = %SOLR_HOST%
825
+ @echo SOLR_PORT = %SOLR_PORT%
826
+ @echo STOP_PORT = %STOP_PORT%
827
+ @echo SOLR_JAVA_MEM = %SOLR_JAVA_MEM%
828
+ @echo GC_TUNE = !GC_TUNE!
829
+ @echo GC_LOG_OPTS = %GC_LOG_OPTS%
830
+ @echo SOLR_TIMEZONE = %SOLR_TIMEZONE%
831
+
832
+ IF "%SOLR_MODE%"=="solrcloud" (
833
+ @echo CLOUD_MODE_OPTS = %CLOUD_MODE_OPTS%
834
+ )
835
+
836
+ IF NOT "%SOLR_OPTS%"=="" (
837
+ @echo SOLR_OPTS = %SOLR_OPTS%
838
+ )
839
+
840
+ IF NOT "%SOLR_ADDL_ARGS%"=="" (
841
+ CALL :safe_echo " SOLR_ADDL_ARGS = %SOLR_ADDL_ARGS%"
842
+ )
843
+
844
+ IF "%ENABLE_REMOTE_JMX_OPTS%"=="true" (
845
+ @echo RMI_PORT = !RMI_PORT!
846
+ @echo REMOTE_JMX_OPTS = %REMOTE_JMX_OPTS%
847
+ )
848
+
849
+ @echo.
850
+ )
851
+
852
+ set START_OPTS=-Duser.timezone=%SOLR_TIMEZONE% -Djava.net.preferIPv4Stack=true
853
+ set START_OPTS=%START_OPTS% !GC_TUNE! %GC_LOG_OPTS%
854
+ IF NOT "!CLOUD_MODE_OPTS!"=="" set "START_OPTS=%START_OPTS% !CLOUD_MODE_OPTS!"
855
+ IF NOT "%REMOTE_JMX_OPTS%"=="" set "START_OPTS=%START_OPTS% %REMOTE_JMX_OPTS%"
856
+ IF NOT "%SOLR_ADDL_ARGS%"=="" set "START_OPTS=%START_OPTS% %SOLR_ADDL_ARGS%"
857
+ IF NOT "%SOLR_HOST_ARG%"=="" set "START_OPTS=%START_OPTS% %SOLR_HOST_ARG%"
858
+ IF NOT "%SOLR_OPTS%"=="" set "START_OPTS=%START_OPTS% %SOLR_OPTS%"
859
+ 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%"
862
+ set "START_OPTS=%START_OPTS% %SOLR_SSL_OPTS% !SSL_PORT_PROP!"
863
+ )
864
+
865
+ IF NOT DEFINED LOG4J_CONFIG set "LOG4J_CONFIG=file:%SOLR_SERVER_DIR%\resources\log4j.properties"
866
+
867
+ cd "%SOLR_SERVER_DIR%"
868
+
869
+ IF NOT EXIST "!SOLR_LOGS_DIR!" (
870
+ mkdir "!SOLR_LOGS_DIR!"
871
+ )
872
+
873
+ IF NOT EXIST "%SOLR_SERVER_DIR%\tmp" (
874
+ mkdir "%SOLR_SERVER_DIR%\tmp"
875
+ )
876
+
877
+ @echo.
878
+ CALL :safe_echo "Starting Solr on port %SOLR_PORT% from %SOLR_SERVER_DIR%"
879
+ @echo.
880
+ IF "%FG%"=="1" (
881
+ REM run solr in the foreground
882
+ title "Solr-%SOLR_PORT%"
883
+ 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
886
+ ) 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"
889
+ 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
+
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.
926
+ )
927
+ @echo Direct your Web browser to !SOLR_URL_SCHEME!://localhost:%SOLR_PORT%/solr to visit the Solr Admin UI
928
+ @echo.
929
+
930
+ goto done
931
+
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
1074
+
1075
+ :create_collection
1076
+ "%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
1077
+ -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%
1080
+
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
1086
+ goto done
1087
+
1088
+
1089
+ :get_info
1090
+ REM Find all Java processes, correlate with those listening on a port
1091
+ REM and then try to contact via that port using the status tool
1092
+ for /f "usebackq" %%i in (`dir /b "%SOLR_TIP%\bin" ^| findstr /i "^solr-.*\.port$"`) do (
1093
+ set SOME_SOLR_PORT=
1094
+ For /F "Delims=" %%J In ('type "%SOLR_TIP%\bin\%%i"') do set SOME_SOLR_PORT=%%~J
1095
+ if NOT "!SOME_SOLR_PORT!"=="" (
1096
+ for /f "tokens=2,5" %%j in ('netstat -aon ^| find "TCP " ^| find ":!SOME_SOLR_PORT! "') do (
1097
+ IF NOT "%%k"=="0" (
1098
+ for /f "delims=: tokens=1,2" %%x IN ("%%j") do (
1099
+ if "%%x"=="0.0.0.0" (
1100
+ @echo.
1101
+ set has_info=1
1102
+ echo Found Solr process %%k running on port !SOME_SOLR_PORT!
1103
+ "%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
1104
+ -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
1106
+ @echo.
1107
+ )
1108
+ )
1109
+ )
1110
+ )
1111
+ )
1112
+ )
1113
+ if NOT "!has_info!"=="1" echo No running Solr nodes found.
1114
+ set has_info=
1115
+ goto done
1116
+
1117
+ :parse_healthcheck_args
1118
+ IF [%1]==[] goto run_healthcheck
1119
+ IF "%1"=="-c" goto set_healthcheck_collection
1120
+ IF "%1"=="-collection" goto set_healthcheck_collection
1121
+ IF "%1"=="-z" goto set_healthcheck_zk
1122
+ IF "%1"=="-zkhost" goto set_healthcheck_zk
1123
+ IF "%1"=="-help" goto usage
1124
+ IF "%1"=="-usage" goto usage
1125
+ IF "%1"=="/?" goto usage
1126
+ goto run_healthcheck
1127
+
1128
+ :set_healthcheck_collection
1129
+ set HEALTHCHECK_COLLECTION=%~2
1130
+ SHIFT
1131
+ SHIFT
1132
+ goto parse_healthcheck_args
1133
+
1134
+ :set_healthcheck_zk
1135
+ set HEALTHCHECK_ZK_HOST=%~2
1136
+ SHIFT
1137
+ SHIFT
1138
+ goto parse_healthcheck_args
1139
+
1140
+ :run_healthcheck
1141
+ IF NOT DEFINED HEALTHCHECK_COLLECTION goto healthcheck_usage
1142
+ IF NOT DEFINED HEALTHCHECK_ZK_HOST set "HEALTHCHECK_ZK_HOST=localhost:9983"
1143
+ "%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
1144
+ -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
1145
+ org.apache.solr.util.SolrCLI healthcheck -collection !HEALTHCHECK_COLLECTION! -zkHost !HEALTHCHECK_ZK_HOST!
1146
+ goto done
1147
+
1148
+ :parse_create_args
1149
+ IF [%1]==[] goto run_create
1150
+ IF "%1"=="-c" goto set_create_name
1151
+ IF "%1"=="-core" goto set_create_name
1152
+ IF "%1"=="-collection" goto set_create_name
1153
+ IF "%1"=="-d" goto set_create_confdir
1154
+ IF "%1"=="-confdir" goto set_create_confdir
1155
+ IF "%1"=="-n" goto set_create_confname
1156
+ IF "%1"=="-confname" goto set_create_confname
1157
+ IF "%1"=="-s" goto set_create_shards
1158
+ IF "%1"=="-shards" goto set_create_shards
1159
+ IF "%1"=="-rf" goto set_create_rf
1160
+ IF "%1"=="-replicationFactor" goto set_create_rf
1161
+ IF "%1"=="-p" goto set_create_port
1162
+ IF "%1"=="-port" goto set_create_port
1163
+ IF "%1"=="-help" goto usage
1164
+ IF "%1"=="-usage" goto usage
1165
+ IF "%1"=="/?" goto usage
1166
+ goto run_create
1167
+
1168
+ :set_create_name
1169
+ set CREATE_NAME=%~2
1170
+ SHIFT
1171
+ SHIFT
1172
+ goto parse_create_args
1173
+
1174
+ :set_create_confdir
1175
+ set CREATE_CONFDIR=%~2
1176
+ SHIFT
1177
+ SHIFT
1178
+ goto parse_create_args
1179
+
1180
+ :set_create_confname
1181
+ set CREATE_CONFNAME=%~2
1182
+ SHIFT
1183
+ SHIFT
1184
+ goto parse_create_args
1185
+
1186
+ :set_create_port
1187
+ set CREATE_PORT=%~2
1188
+ SHIFT
1189
+ SHIFT
1190
+ goto parse_create_args
1191
+
1192
+ :set_create_shards
1193
+ set CREATE_NUM_SHARDS=%~2
1194
+ SHIFT
1195
+ SHIFT
1196
+ goto parse_create_args
1197
+
1198
+ :set_create_rf
1199
+ set CREATE_REPFACT=%~2
1200
+ SHIFT
1201
+ SHIFT
1202
+ goto parse_create_args
1203
+
1204
+ :run_create
1205
+ IF "!CREATE_NAME!"=="" (
1206
+ set "SCRIPT_ERROR=Name (-c) is a required parameter for %SCRIPT_CMD%"
1207
+ goto invalid_cmd_line
1208
+ )
1209
+ IF "!CREATE_CONFDIR!"=="" set CREATE_CONFDIR=data_driven_schema_configs
1210
+ IF "!CREATE_NUM_SHARDS!"=="" set CREATE_NUM_SHARDS=1
1211
+ IF "!CREATE_REPFACT!"=="" set CREATE_REPFACT=1
1212
+ IF "!CREATE_CONFNAME!"=="" set CREATE_CONFNAME=!CREATE_NAME!
1213
+
1214
+ REM Find a port that Solr is running on
1215
+ if "!CREATE_PORT!"=="" (
1216
+ for /f "usebackq" %%i in (`dir /b "%SOLR_TIP%\bin" ^| findstr /i "^solr-.*\.port$"`) do (
1217
+ set SOME_SOLR_PORT=
1218
+ For /F "Delims=" %%J In ('type "%SOLR_TIP%\bin\%%i"') do set SOME_SOLR_PORT=%%~J
1219
+ if NOT "!SOME_SOLR_PORT!"=="" (
1220
+ for /f "tokens=2,5" %%j in ('netstat -aon ^| find "TCP " ^| find ":!SOME_SOLR_PORT! "') do (
1221
+ IF NOT "%%k"=="0" set CREATE_PORT=!SOME_SOLR_PORT!
1222
+ )
1223
+ )
1224
+ )
1225
+ )
1226
+ if "!CREATE_PORT!"=="" (
1227
+ set "SCRIPT_ERROR=Could not find a running Solr instance on this host! Please use the -p option to specify the port."
1228
+ goto err
1229
+ )
1230
+
1231
+ if "%SCRIPT_CMD%"=="create_core" (
1232
+ "%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
1233
+ -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 ^
1235
+ -confdir !CREATE_CONFDIR! -configsetsDir "%SOLR_TIP%\server\solr\configsets"
1236
+ ) else (
1237
+ "%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
1238
+ -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
1239
+ 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
1241
+ )
1242
+
1243
+ goto done
1244
+
1245
+ :parse_delete_args
1246
+ IF [%1]==[] goto run_delete
1247
+ IF "%1"=="-c" goto set_delete_name
1248
+ IF "%1"=="-core" goto set_delete_name
1249
+ IF "%1"=="-collection" goto set_delete_name
1250
+ IF "%1"=="-p" goto set_delete_port
1251
+ IF "%1"=="-port" goto set_delete_port
1252
+ IF "%1"=="-deleteConfig" goto set_delete_config
1253
+ IF "%1"=="-help" goto usage
1254
+ IF "%1"=="-usage" goto usage
1255
+ IF "%1"=="/?" goto usage
1256
+ goto run_delete
1257
+
1258
+ :set_delete_name
1259
+ set DELETE_NAME=%~2
1260
+ SHIFT
1261
+ SHIFT
1262
+ goto parse_delete_args
1263
+
1264
+ :set_delete_port
1265
+ set DELETE_PORT=%~2
1266
+ SHIFT
1267
+ SHIFT
1268
+ goto parse_delete_args
1269
+
1270
+ :set_delete_config
1271
+ set DELETE_CONFIG=%~2
1272
+ SHIFT
1273
+ SHIFT
1274
+ goto parse_delete_args
1275
+
1276
+ :run_delete
1277
+ IF "!DELETE_NAME!"=="" (
1278
+ set "SCRIPT_ERROR=Name (-c) is a required parameter for %SCRIPT_CMD%"
1279
+ goto invalid_cmd_line
1280
+ )
1281
+
1282
+ REM Find a port that Solr is running on
1283
+ if "!DELETE_PORT!"=="" (
1284
+ for /f "usebackq" %%i in (`dir /b "%SOLR_TIP%\bin" ^| findstr /i "^solr-.*\.port$"`) do (
1285
+ set SOME_SOLR_PORT=
1286
+ For /F "Delims=" %%J In ('type "%SOLR_TIP%\bin\%%i"') do set SOME_SOLR_PORT=%%~J
1287
+ if NOT "!SOME_SOLR_PORT!"=="" (
1288
+ for /f "tokens=2,5" %%j in ('netstat -aon ^| find "TCP " ^| find ":!SOME_SOLR_PORT! "') do (
1289
+ IF NOT "%%k"=="0" set DELETE_PORT=!SOME_SOLR_PORT!
1290
+ )
1291
+ )
1292
+ )
1293
+ )
1294
+ if "!DELETE_PORT!"=="" (
1295
+ set "SCRIPT_ERROR=Could not find a running Solr instance on this host! Please use the -p option to specify the port."
1296
+ goto err
1297
+ )
1298
+
1299
+ if "!DELETE_CONFIG!"=="" (
1300
+ set DELETE_CONFIG=true
1301
+ )
1302
+
1303
+ "%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
1304
+ -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
1305
+ org.apache.solr.util.SolrCLI delete -name !DELETE_NAME! -deleteConfig !DELETE_CONFIG! ^
1306
+ -solrUrl !SOLR_URL_SCHEME!://localhost:!DELETE_PORT!/solr
1307
+
1308
+ goto done
1309
+
1310
+
1311
+ :invalid_cmd_line
1312
+ @echo.
1313
+ IF "!SCRIPT_ERROR!"=="" (
1314
+ @echo Invalid command-line option: %1
1315
+ ) ELSE (
1316
+ @echo ERROR: !SCRIPT_ERROR!
1317
+ )
1318
+ @echo.
1319
+ IF "%FIRST_ARG%"=="start" (
1320
+ goto start_usage
1321
+ ) ELSE IF "%FIRST_ARG:~0,1%" == "-" (
1322
+ goto start_usage
1323
+ ) ELSE IF "%FIRST_ARG%"=="restart" (
1324
+ goto start_usage
1325
+ ) ELSE IF "%FIRST_ARG%"=="stop" (
1326
+ goto stop_usage
1327
+ ) ELSE IF "%FIRST_ARG%"=="healthcheck" (
1328
+ goto healthcheck_usage
1329
+ ) ELSE IF "%FIRST_ARG%"=="create" (
1330
+ goto create_usage
1331
+ ) ELSE IF "%FIRST_ARG%"=="create_core" (
1332
+ goto create_core_usage
1333
+ ) ELSE IF "%FIRST_ARG%"=="create_collection" (
1334
+ goto create_collection_usage
1335
+ ) ELSE (
1336
+ goto script_usage
1337
+ )
1338
+
1339
+ :need_java_home
1340
+ @echo Please set the JAVA_HOME environment variable to the path where you installed Java 1.7+
1341
+ goto done
1342
+
1343
+ :need_java_vers
1344
+ @echo Java 1.7 or later is required to run Solr.
1345
+ goto done
1346
+
1347
+ :err
1348
+ @echo.
1349
+ @echo ERROR: !SCRIPT_ERROR!
1350
+ @echo.
1351
+ exit /b 1
1352
+
1353
+ :done
1354
+
1355
+ ENDLOCAL
1356
+
1357
+ GOTO :eof
1358
+
1359
+ REM Tests what Java we have and sets some global variables
1360
+ :resolve_java_version
1361
+
1362
+ set JAVA_MAJOR_VERSION=0
1363
+ set JAVA_VERSION_INFO=
1364
+ set JAVA_BUILD=0
1365
+ "%JAVA%" -version 2>&1 | findstr /i "version" > javavers
1366
+ set /p JAVAVEROUT=<javavers
1367
+ del javavers
1368
+ for /f "tokens=3" %%g in ("!JAVAVEROUT!") do (
1369
+ set JAVA_VERSION_INFO=%%g
1370
+ 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
1375
+ )
1376
+ )
1377
+ GOTO :eof
1378
+
1379
+ REM Safe echo which does not mess with () in strings
1380
+ :safe_echo
1381
+ set "eout=%1"
1382
+ set eout=%eout:"=%
1383
+ echo !eout!
1384
+ GOTO :eof