smartmachine 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (229) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.rdoc +0 -0
  3. data/README.rdoc +87 -0
  4. data/bin/buildpacker +8 -0
  5. data/bin/prereceiver +8 -0
  6. data/bin/smartmachine +81 -0
  7. data/bin/smartrunner +28 -0
  8. data/lib/smart_machine.rb +24 -0
  9. data/lib/smart_machine/apps.rb +14 -0
  10. data/lib/smart_machine/apps/app.rb +182 -0
  11. data/lib/smart_machine/apps/rails.rb +250 -0
  12. data/lib/smart_machine/base.rb +11 -0
  13. data/lib/smart_machine/boot.rb +31 -0
  14. data/lib/smart_machine/buildpacker.rb +106 -0
  15. data/lib/smart_machine/credentials.rb +126 -0
  16. data/lib/smart_machine/docker.rb +144 -0
  17. data/lib/smart_machine/engine.rb +82 -0
  18. data/lib/smart_machine/engine/Dockerfile +27 -0
  19. data/lib/smart_machine/engine/buildpacks/rails/Dockerfile +21 -0
  20. data/lib/smart_machine/gem_version.rb +17 -0
  21. data/lib/smart_machine/grids.rb +15 -0
  22. data/lib/smart_machine/grids/elasticsearch.rb +97 -0
  23. data/lib/smart_machine/grids/elasticsearch/.keep +0 -0
  24. data/lib/smart_machine/grids/minio.rb +77 -0
  25. data/lib/smart_machine/grids/minio/.keep +0 -0
  26. data/lib/smart_machine/grids/mysql.rb +66 -0
  27. data/lib/smart_machine/grids/mysql/docker-entrypoint-initdb.d/.keep +0 -0
  28. data/lib/smart_machine/grids/nginx.rb +137 -0
  29. data/lib/smart_machine/grids/nginx/.keep +0 -0
  30. data/lib/smart_machine/grids/prereceiver.rb +170 -0
  31. data/lib/smart_machine/grids/prereceiver/Dockerfile +20 -0
  32. data/lib/smart_machine/grids/prereceiver/fcgiwrap/APKBUILD +49 -0
  33. data/lib/smart_machine/grids/prereceiver/fcgiwrap/fcgiwrap.confd +6 -0
  34. data/lib/smart_machine/grids/prereceiver/fcgiwrap/fcgiwrap.initd +43 -0
  35. data/lib/smart_machine/grids/prereceiver/fcgiwrap/fcgiwrap.pre-install +7 -0
  36. data/lib/smart_machine/grids/prereceiver/fcgiwrap/packages/main/x86_64/APKINDEX.tar.gz +0 -0
  37. data/lib/smart_machine/grids/prereceiver/fcgiwrap/packages/main/x86_64/fcgiwrap-1.1.1-r4.apk +0 -0
  38. data/lib/smart_machine/grids/prereceiver/fcgiwrap/packages/main/x86_64/fcgiwrap-doc-1.1.1-r4.apk +0 -0
  39. data/lib/smart_machine/grids/prereceiver/fcgiwrap/packages/main/x86_64/fcgiwrap-openrc-1.1.1-r4.apk +0 -0
  40. data/lib/smart_machine/grids/redis.rb +58 -0
  41. data/lib/smart_machine/grids/redis/.keep +0 -0
  42. data/lib/smart_machine/grids/solr.rb +99 -0
  43. data/lib/smart_machine/grids/solr/config/.keep +0 -0
  44. data/lib/smart_machine/grids/solr/config/README.txt +77 -0
  45. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/contractions_ca.txt +8 -0
  46. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/contractions_fr.txt +15 -0
  47. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/contractions_ga.txt +5 -0
  48. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/contractions_it.txt +23 -0
  49. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/hyphenations_ga.txt +5 -0
  50. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stemdict_nl.txt +6 -0
  51. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stoptags_ja.txt +420 -0
  52. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_ar.txt +125 -0
  53. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_bg.txt +193 -0
  54. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_ca.txt +220 -0
  55. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_cz.txt +172 -0
  56. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_da.txt +110 -0
  57. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_de.txt +294 -0
  58. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_el.txt +78 -0
  59. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_en.txt +54 -0
  60. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_es.txt +356 -0
  61. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_eu.txt +99 -0
  62. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_fa.txt +313 -0
  63. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_fi.txt +97 -0
  64. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_fr.txt +186 -0
  65. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_ga.txt +110 -0
  66. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_gl.txt +161 -0
  67. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_hi.txt +235 -0
  68. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_hu.txt +211 -0
  69. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_hy.txt +46 -0
  70. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_id.txt +359 -0
  71. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_it.txt +303 -0
  72. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_ja.txt +127 -0
  73. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_lv.txt +172 -0
  74. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_nl.txt +119 -0
  75. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_no.txt +194 -0
  76. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_pt.txt +253 -0
  77. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_ro.txt +233 -0
  78. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_ru.txt +243 -0
  79. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_sv.txt +133 -0
  80. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_th.txt +119 -0
  81. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/stopwords_tr.txt +212 -0
  82. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/lang/userdict_ja.txt +29 -0
  83. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/managed-schema +1007 -0
  84. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/params.json +20 -0
  85. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/protwords.txt +21 -0
  86. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/solrconfig.xml +1355 -0
  87. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/stopwords.txt +14 -0
  88. data/lib/smart_machine/grids/solr/config/configsets/_default/conf/synonyms.txt +29 -0
  89. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/_rest_managed.json +1 -0
  90. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/_schema_analysis_stopwords_english.json +38 -0
  91. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/_schema_analysis_synonyms_english.json +11 -0
  92. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/clustering/carrot2/README.txt +11 -0
  93. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/clustering/carrot2/kmeans-attributes.xml +19 -0
  94. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/clustering/carrot2/lingo-attributes.xml +24 -0
  95. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/clustering/carrot2/stc-attributes.xml +19 -0
  96. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/currency.xml +67 -0
  97. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/elevate.xml +42 -0
  98. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/contractions_ca.txt +8 -0
  99. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/contractions_fr.txt +15 -0
  100. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/contractions_ga.txt +5 -0
  101. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/contractions_it.txt +23 -0
  102. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/hyphenations_ga.txt +5 -0
  103. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stemdict_nl.txt +6 -0
  104. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stoptags_ja.txt +420 -0
  105. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_ar.txt +125 -0
  106. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_bg.txt +193 -0
  107. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_ca.txt +220 -0
  108. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_ckb.txt +136 -0
  109. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_cz.txt +172 -0
  110. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_da.txt +110 -0
  111. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_de.txt +294 -0
  112. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_el.txt +78 -0
  113. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_en.txt +54 -0
  114. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_es.txt +356 -0
  115. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_eu.txt +99 -0
  116. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_fa.txt +313 -0
  117. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_fi.txt +97 -0
  118. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_fr.txt +186 -0
  119. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_ga.txt +110 -0
  120. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_gl.txt +161 -0
  121. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_hi.txt +235 -0
  122. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_hu.txt +211 -0
  123. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_hy.txt +46 -0
  124. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_id.txt +359 -0
  125. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_it.txt +303 -0
  126. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_ja.txt +127 -0
  127. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_lv.txt +172 -0
  128. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_nl.txt +119 -0
  129. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_no.txt +194 -0
  130. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_pt.txt +253 -0
  131. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_ro.txt +233 -0
  132. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_ru.txt +243 -0
  133. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_sv.txt +133 -0
  134. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_th.txt +119 -0
  135. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/stopwords_tr.txt +212 -0
  136. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/lang/userdict_ja.txt +29 -0
  137. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/managed-schema +1187 -0
  138. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/mapping-FoldToASCII.txt +3813 -0
  139. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/mapping-ISOLatin1Accent.txt +246 -0
  140. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/params.json +11 -0
  141. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/protwords.txt +21 -0
  142. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/solrconfig.xml +1616 -0
  143. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/spellings.txt +2 -0
  144. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/stopwords.txt +14 -0
  145. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/synonyms.txt +29 -0
  146. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/update-script.js +53 -0
  147. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/README.txt +101 -0
  148. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/VM_global_library.vm +186 -0
  149. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/browse.vm +33 -0
  150. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/cluster.vm +19 -0
  151. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/cluster_results.vm +31 -0
  152. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/debug.vm +28 -0
  153. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/did_you_mean.vm +11 -0
  154. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/error.vm +11 -0
  155. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/facet_fields.vm +24 -0
  156. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/facet_pivot.vm +12 -0
  157. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/facet_queries.vm +12 -0
  158. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/facet_ranges.vm +23 -0
  159. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/facets.vm +10 -0
  160. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/footer.vm +43 -0
  161. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/head.vm +37 -0
  162. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/header.vm +7 -0
  163. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/hit.vm +25 -0
  164. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/hit_grouped.vm +43 -0
  165. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/hit_plain.vm +25 -0
  166. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/join_doc.vm +20 -0
  167. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/jquery.autocomplete.css +48 -0
  168. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/jquery.autocomplete.js +763 -0
  169. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/layout.vm +24 -0
  170. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/main.css +231 -0
  171. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/mime_type_lists.vm +68 -0
  172. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/pagination_bottom.vm +22 -0
  173. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/pagination_top.vm +29 -0
  174. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/product_doc.vm +32 -0
  175. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/query.vm +42 -0
  176. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/query_form.vm +64 -0
  177. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/query_group.vm +43 -0
  178. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/query_spatial.vm +75 -0
  179. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/results_list.vm +22 -0
  180. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/richtext_doc.vm +153 -0
  181. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/suggest.vm +8 -0
  182. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/velocity/tabs.vm +50 -0
  183. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/xslt/example.xsl +132 -0
  184. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/xslt/example_atom.xsl +67 -0
  185. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/xslt/example_rss.xsl +66 -0
  186. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/xslt/luke.xsl +337 -0
  187. data/lib/smart_machine/grids/solr/config/configsets/sample_techproducts_configs/conf/xslt/updateXml.xsl +70 -0
  188. data/lib/smart_machine/grids/solr/config/configsets/sunspot/conf/_rest_managed.json +1 -0
  189. data/lib/smart_machine/grids/solr/config/configsets/sunspot/conf/admin-extra.html +31 -0
  190. data/lib/smart_machine/grids/solr/config/configsets/sunspot/conf/currency.xml +67 -0
  191. data/lib/smart_machine/grids/solr/config/configsets/sunspot/conf/elevate.xml +36 -0
  192. data/lib/smart_machine/grids/solr/config/configsets/sunspot/conf/lang/stopwords_en.txt +54 -0
  193. data/lib/smart_machine/grids/solr/config/configsets/sunspot/conf/mapping-ISOLatin1Accent.txt +246 -0
  194. data/lib/smart_machine/grids/solr/config/configsets/sunspot/conf/protwords.txt +21 -0
  195. data/lib/smart_machine/grids/solr/config/configsets/sunspot/conf/schema.xml +278 -0
  196. data/lib/smart_machine/grids/solr/config/configsets/sunspot/conf/scripts.conf +24 -0
  197. data/lib/smart_machine/grids/solr/config/configsets/sunspot/conf/solrconfig.xml +632 -0
  198. data/lib/smart_machine/grids/solr/config/configsets/sunspot/conf/spellings.txt +2 -0
  199. data/lib/smart_machine/grids/solr/config/configsets/sunspot/conf/synonyms.txt +29 -0
  200. data/lib/smart_machine/grids/solr/config/lib/.keep +0 -0
  201. data/lib/smart_machine/grids/solr/config/solr.xml +53 -0
  202. data/lib/smart_machine/grids/solr/config/zoo.cfg +31 -0
  203. data/lib/smart_machine/grids/solr/docker-entrypoint-initdb.d/.keep +0 -0
  204. data/lib/smart_machine/grids/solr/sunspot/conf/schema.xml +278 -0
  205. data/lib/smart_machine/grids/solr/sunspot/conf/solrconfig.xml +632 -0
  206. data/lib/smart_machine/logger.rb +35 -0
  207. data/lib/smart_machine/machine.rb +192 -0
  208. data/lib/smart_machine/ssh.rb +43 -0
  209. data/lib/smart_machine/sync.rb +108 -0
  210. data/lib/smart_machine/templates/dotsmartmachine/apps/containers/.keep +0 -0
  211. data/lib/smart_machine/templates/dotsmartmachine/apps/repositories/.keep +0 -0
  212. data/lib/smart_machine/templates/dotsmartmachine/config/environment.rb +18 -0
  213. data/lib/smart_machine/templates/dotsmartmachine/config/users.yml +4 -0
  214. data/lib/smart_machine/templates/dotsmartmachine/grids/elasticsearch/data/.keep +0 -0
  215. data/lib/smart_machine/templates/dotsmartmachine/grids/elasticsearch/logs/.keep +0 -0
  216. data/lib/smart_machine/templates/dotsmartmachine/grids/minio/data/.keep +0 -0
  217. data/lib/smart_machine/templates/dotsmartmachine/grids/mysql/data/.keep +0 -0
  218. data/lib/smart_machine/templates/dotsmartmachine/grids/nginx/certificates/.keep +0 -0
  219. data/lib/smart_machine/templates/dotsmartmachine/grids/nginx/fastcgi.conf +11 -0
  220. data/lib/smart_machine/templates/dotsmartmachine/grids/nginx/htpasswd/.keep +0 -0
  221. data/lib/smart_machine/templates/dotsmartmachine/grids/nginx/nginx.tmpl +373 -0
  222. data/lib/smart_machine/templates/dotsmartmachine/grids/prereceiver/pre-receive +17 -0
  223. data/lib/smart_machine/templates/dotsmartmachine/grids/redis/data/.keep +0 -0
  224. data/lib/smart_machine/templates/dotsmartmachine/grids/solr/solr/.keep +0 -0
  225. data/lib/smart_machine/templates/dotsmartmachine/tmp/.keep +0 -0
  226. data/lib/smart_machine/user.rb +38 -0
  227. data/lib/smart_machine/version.rb +10 -0
  228. metadata +297 -12
  229. data/README.md +0 -9
@@ -0,0 +1,14 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright ownership.
4
+ # The ASF licenses this file to You under the Apache License, Version 2.0
5
+ # (the "License"); you may not use this file except in compliance with
6
+ # the License. You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
@@ -0,0 +1,29 @@
1
+ # The ASF licenses this file to You under the Apache License, Version 2.0
2
+ # (the "License"); you may not use this file except in compliance with
3
+ # the License. You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+
13
+ #-----------------------------------------------------------------------
14
+ #some test synonym mappings unlikely to appear in real input text
15
+ aaafoo => aaabar
16
+ bbbfoo => bbbfoo bbbbar
17
+ cccfoo => cccbar cccbaz
18
+ fooaaa,baraaa,bazaaa
19
+
20
+ # Some synonym groups specific to this example
21
+ GB,gib,gigabyte,gigabytes
22
+ MB,mib,megabyte,megabytes
23
+ Television, Televisions, TV, TVs
24
+ #notice we use "gib" instead of "GiB" so any WordDelimiterGraphFilter coming
25
+ #after us won't split it into two words.
26
+
27
+ # Synonym mappings can be used for spelling correction too
28
+ pixima => pixma
29
+
@@ -0,0 +1,53 @@
1
+ /*
2
+ This is a basic skeleton JavaScript update processor.
3
+
4
+ In order for this to be executed, it must be properly wired into solrconfig.xml; by default it is commented out in
5
+ the example solrconfig.xml and must be uncommented to be enabled.
6
+
7
+ See http://wiki.apache.org/solr/ScriptUpdateProcessor for more details.
8
+ */
9
+
10
+ function processAdd(cmd) {
11
+
12
+ doc = cmd.solrDoc; // org.apache.solr.common.SolrInputDocument
13
+ id = doc.getFieldValue("id");
14
+ logger.info("update-script#processAdd: id=" + id);
15
+
16
+ // Set a field value:
17
+ // doc.setField("foo_s", "whatever");
18
+
19
+ // Get a configuration parameter:
20
+ // config_param = params.get('config_param'); // "params" only exists if processor configured with <lst name="params">
21
+
22
+ // Get a request parameter:
23
+ // some_param = req.getParams().get("some_param")
24
+
25
+ // Add a field of field names that match a pattern:
26
+ // - Potentially useful to determine the fields/attributes represented in a result set, via faceting on field_name_ss
27
+ // field_names = doc.getFieldNames().toArray();
28
+ // for(i=0; i < field_names.length; i++) {
29
+ // field_name = field_names[i];
30
+ // if (/attr_.*/.test(field_name)) { doc.addField("attribute_ss", field_names[i]); }
31
+ // }
32
+
33
+ }
34
+
35
+ function processDelete(cmd) {
36
+ // no-op
37
+ }
38
+
39
+ function processMergeIndexes(cmd) {
40
+ // no-op
41
+ }
42
+
43
+ function processCommit(cmd) {
44
+ // no-op
45
+ }
46
+
47
+ function processRollback(cmd) {
48
+ // no-op
49
+ }
50
+
51
+ function finish() {
52
+ // no-op
53
+ }
@@ -0,0 +1,101 @@
1
+ Introduction
2
+ ------------
3
+ Solr Search Velocity Templates
4
+
5
+ A quick demo of using Solr using http://wiki.apache.org/solr/VelocityResponseWriter
6
+
7
+ You typically access these templates via:
8
+ http://localhost:8983/solr/collection1/browse
9
+
10
+ It's called "browse" because you can click around with your mouse
11
+ without needing to type any search terms. And of course it
12
+ also works as a standard search app as well.
13
+
14
+ Known Limitations
15
+ -----------------
16
+ * The /browse and the VelocityResponseWriter component
17
+ serve content directly from Solr, which usually requires
18
+ Solr's HTTP API to be exposed. Advanced users could
19
+ potentially access other parts of Solr directly.
20
+ * There are some hard coded fields in these templates.
21
+ Since these templates live under conf, they should be
22
+ considered part of the overall configuration, and
23
+ must be coordinated with schema.xml and solrconfig.xml
24
+
25
+ Velocity Info
26
+ -------------
27
+ Java-based template language.
28
+
29
+ It's nice in this context because change to the templates
30
+ are immediately visible in browser on the next visit.
31
+
32
+ Links:
33
+ http://velocity.apache.org
34
+ http://wiki.apache.org/velocity/
35
+ http://velocity.apache.org/engine/releases/velocity-1.7/user-guide.html
36
+
37
+
38
+ File List
39
+ ---------
40
+
41
+ System and Misc:
42
+ VM_global_library.vm - Macros used other templates,
43
+ exact filename is important for Velocity to see it
44
+ error.vm - shows errors, if any
45
+ debug.vm - includes toggle links for "explain" and "all fields"
46
+ activated by debug link in footer.vm
47
+ README.txt - this file
48
+
49
+ Overall Page Composition:
50
+ browse.vm - Main entry point into templates
51
+ layout.vm - overall HTML page layout
52
+ head.vm - elements in the <head> section of the HTML document
53
+ header.vm - top section of page visible to users
54
+ footer.vm - bottom section of page visible to users,
55
+ includes debug and help links
56
+ main.css - CSS style for overall pages
57
+ see also jquery.autocomplete.css
58
+
59
+ Query Form and Options:
60
+ query_form.vm - renders query form
61
+ query_group.vm - group by fields
62
+ e.g.: Manufacturer or Poplularity
63
+ query_spatial.vm - select box for location based Geospacial search
64
+
65
+ Spelling Suggestions:
66
+ did_you_mean.vm - hyperlinked spelling suggestions in results
67
+ suggest.vm - dynamic spelling suggestions
68
+ as you type in the search form
69
+ jquery.autocomplete.js - supporting files for dynamic suggestions
70
+ jquery.autocomplete.css - Most CSS is defined in main.css
71
+
72
+
73
+ Search Results, General:
74
+ (see also browse.vm)
75
+ tabs.vm - provides navigation to advanced search options
76
+ pagination_top.vm - paging and staticis at top of results
77
+ pagination_bottom.vm - paging and staticis at bottom of results
78
+ results_list.vm
79
+ hit.vm - called for each matching doc,
80
+ decides which template to use
81
+ hit_grouped.vm - display results grouped by field values
82
+ product_doc.vm - display a Product
83
+ join_doc.vm - display a joined document
84
+ richtext_doc.vm - display a complex/misc. document
85
+ hit_plain.vm - basic display of all fields,
86
+ edit results_list.vm to enable this
87
+
88
+
89
+ Search Results, Facets & Clusters:
90
+ facets.vm - calls the 4 facet and 1 cluster template
91
+ facet_fields.vm - display facets based on field values
92
+ e.g.: fields specified by &facet.field=
93
+ facet_queries.vm - display facets based on specific facet queries
94
+ e.g.: facets specified by &facet.query=
95
+ facet_ranges.vm - display facets based on ranges
96
+ e.g.: ranges specified by &facet.range=
97
+ facet_pivot.vm - display pivot based facets
98
+ e.g.: facets specified by &facet.pivot=
99
+ cluster.vm - if clustering is available
100
+ then call cluster_results.vm
101
+ cluster_results.vm - actual rendering of clusters
@@ -0,0 +1,186 @@
1
+ #**
2
+ * Global macros used by other templates.
3
+ * This file must be named VM_global_library.vm
4
+ * in order for Velocity to find it.
5
+ *#
6
+
7
+ #macro(param $key)$request.params.get($key)#end
8
+
9
+ #macro(url_root)/solr#end
10
+
11
+ ## TODO: s/url_for_solr/url_for_core/ and s/url_root/url_for_solr/
12
+ #macro(core_name)$request.core.name#end
13
+ #macro(url_for_solr)#{url_root}#if($request.core.name != "")/$request.core.name#end#end
14
+ #macro(url_for_home)#url_for_solr/browse#end
15
+
16
+ #macro(q)&q=$!{esc.url($params.get('q'))}#end
17
+
18
+ #macro(fqs $p)#foreach($fq in $p)#if($velocityCount>1)&#{end}fq=$esc.url($fq)#end#end
19
+
20
+ #macro(debug)#if($request.params.get('debugQuery'))&debugQuery=true#end#end
21
+
22
+ #macro(boostPrice)#if($request.params.get('bf') == 'price')&bf=price#end#end
23
+
24
+ #macro(annotate)#if($request.params.get('annotateBrowse'))&annotateBrowse=true#end#end
25
+
26
+ #macro(annTitle $msg)#if($annotate == true)title="$msg"#end#end
27
+
28
+ #macro(spatial)#if($request.params.get('sfield'))&sfield=store#end#if($request.params.get('pt'))&pt=$request.params.get('pt')#end#if($request.params.get('d'))&d=$request.params.get('d')#end#end
29
+
30
+ #macro(qOpts)#set($queryOpts = $request.params.get("queryOpts"))#if($queryOpts && $queryOpts != "")&queryOpts=$queryOpts#end#end
31
+
32
+ #macro(group)#if($request.params.getBool("group") == true)&group=true#end#if($request.params.get("group.field"))#foreach($grp in $request.params.getParams('group.field'))&group.field=$grp#end#end#end
33
+
34
+ #macro(sort $p)#if($p)#foreach($s in $p)&sort=$esc.url($s)#end#end#end
35
+
36
+ #macro(lensNoQ)?#if($request.params.getParams('fq') and $list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end#sort($request.params.getParams('sort'))#debug#boostPrice#annotate#spatial#qOpts#group#end
37
+ #macro(lens)#lensNoQ#q#end
38
+
39
+
40
+ #macro(url_for_lens)#{url_for_home}#lens#end
41
+
42
+ #macro(url_for_start $start)#url_for_home#lens&start=$start#end
43
+
44
+ #macro(url_for_filters $p)#url_for_home?#q#boostPrice#spatial#qOpts#if($list.size($p) > 0)&#fqs($p)#end#debug#end
45
+
46
+ #macro(url_for_nested_facet_query $field)#url_for_home#lens&fq=$esc.url($field)#end
47
+
48
+ ## TODO: convert to use {!raw f=$field}$value (with escaping of course)
49
+ #macro(url_for_facet_filter $field $value)#url_for_home#lens&fq=#if($value!=$null)$esc.url($field):%22$esc.url($value)%22#else-$esc.url($field):[*+TO+*]#end#end
50
+
51
+ #macro(url_for_facet_date_filter $field $value)#url_for_home#lens&fq=$esc.url($field):$esc.url($value)#end
52
+
53
+ #macro(url_for_facet_range_filter $field $value)#url_for_home#lens&fq=$esc.url($field):$esc.url($value)#end
54
+
55
+
56
+ #macro(link_to_previous_page $text)
57
+ #if($page.current_page_number > 1)
58
+ #set($prev_start = $page.start - $page.results_per_page)
59
+ <a class="prev-page" href="#url_for_start($prev_start)">$text</a>
60
+ #end
61
+ #end
62
+
63
+ #macro(link_to_next_page $text)
64
+ #if($page.current_page_number < $page.page_count)
65
+ #set($next_start = $page.start + $page.results_per_page)
66
+ <a class="next-page" href="#url_for_start($next_start)">$text</a>
67
+ #end
68
+ #end
69
+
70
+ #macro(link_to_page $page_number $text)
71
+ #if($page_number == $page.current_page_number)
72
+ $text
73
+ #else
74
+ #if($page_number <= $page.page_count)
75
+ #set($page_start = $page_number * $page.results_per_page - $page.results_per_page)
76
+ <a class="page" href="#url_for_start($page_start)">$text</a>
77
+ #end
78
+ #end
79
+ #end
80
+
81
+ #macro(display_facet_query $field, $display, $fieldName)
82
+ #if($field.size() > 0)
83
+ <span class="facet-field">$display</span>
84
+ <ul>
85
+ #foreach ($facet in $field)
86
+ #if ($facet.value > 0)
87
+ #set($facetURL = "#url_for_nested_facet_query($facet.key)")
88
+ #if ($facetURL != '')
89
+ <li><a href="$facetURL">$facet.key</a> ($facet.value)</li>
90
+ #end
91
+ #end
92
+ #end
93
+ </ul>
94
+ #end
95
+ #end
96
+
97
+
98
+ #macro(display_facet_range $field, $display, $fieldName, $start, $end, $gap, $before, $after)
99
+ <span class="facet-field">$display</span>
100
+ <ul>
101
+ #if($before && $before != "")
102
+ #set($value = "[* TO " + "#format_value($start)" + "}")
103
+ #set($facetURL = "#url_for_facet_range_filter($fieldName, $value)")
104
+ <li><a href="$facetURL">Less than #format_value($start)</a> ($before)</li>
105
+ #end
106
+ #foreach ($facet in $field)
107
+ #set($rangeEnd = "#range_get_to_value($facet.key, $gap)")
108
+ #set($value = "[" + $facet.key + " TO " + $rangeEnd + "}")
109
+ #set($facetURL = "#url_for_facet_range_filter($fieldName, $value)")
110
+ #if ($facetURL != '')
111
+ <li><a href="$facetURL">$facet.key - #format_value($rangeEnd)</a> ($facet.value)</li>
112
+ #end
113
+ #end
114
+ #if($end && $end != "" && $after > 0)
115
+ #set($value = "[" + "#format_value($end)" + " TO *}")
116
+ #set($facetURL = "#url_for_facet_range_filter($fieldName, $value)")
117
+ <li><a href="$facetURL">More than #format_value($end)</a> ($after)</li>
118
+ #end
119
+ </ul>
120
+ #end
121
+
122
+ ## $pivots is a list of facet_pivot
123
+ #macro(display_facet_pivot $pivots, $display)
124
+ #if($pivots.size() > 0)
125
+ <span class="facet-field">$display</span>
126
+ <ul>
127
+ #foreach ($pivot in $pivots)
128
+ #foreach ($entry in $pivot.value)
129
+ <a href="#url_for_facet_filter($entry.field, $entry.value)">$entry.field::#if($entry.value!=$null)$entry.value#else<em>missing</em>#end</a> ($entry.count)
130
+ <ul>
131
+ #foreach($nest in $entry.pivot)
132
+ <li>
133
+ #if($nest.value != $null)
134
+ <a href="#url_for_facet_filter($entry.field, $entry.value)&fq=$esc.url($nest.field):%22$esc.url($nest.value)%22">$nest.field::$nest.value</a>
135
+ #else
136
+ <a href="#url_for_facet_filter($entry.field, $entry.value)&fq=-$esc.url($nest.field):[*+TO+*]">$nest.field::<em>missing</em></a>
137
+ #end
138
+ ($nest.count)
139
+ </li>
140
+ #end
141
+ </ul>
142
+ #end
143
+ #end
144
+ </ul>
145
+ #end
146
+ #end
147
+
148
+ #macro(field $f)
149
+ #if($response.response.highlighting.get($docId).get($f).get(0))
150
+ #set($pad = "")
151
+ #foreach($v in $response.response.highlighting.get($docId).get($f))
152
+ $pad$v##
153
+ #set($pad = " ... ")
154
+ #end
155
+ #else
156
+ #foreach($v in $doc.getFieldValues($f))
157
+ $v##
158
+ #end
159
+ #end
160
+ #end
161
+
162
+ #macro(utc_date $theDate)
163
+ $date.format("yyyy-MM-dd'T'HH:mm:ss'Z'",$theDate,$date.getLocale(),$date.getTimeZone().getTimeZone("UTC"))##
164
+ #end
165
+
166
+ #macro(format_value $val)
167
+ #if(${val.class.name} == "java.util.Date")
168
+ #utc_date($val)##
169
+ #else
170
+ $val##
171
+ #end
172
+ #end
173
+
174
+ #macro(range_get_to_value $inval, $gapval)
175
+ #if(${gapval.class.name} == "java.lang.String")
176
+ #if($gapval.startsWith("+"))
177
+ $inval$gapval## Typically date gaps start with +
178
+ #else
179
+ $inval+$gapval## If the gap does not start with a "+", we add it, such as for currency value
180
+ #end
181
+ #elseif(${gapval.class.name} == "java.lang.Float" || ${inval.class.name} == "java.lang.Float")
182
+ $math.toDouble($math.add($inval,$gapval))##
183
+ #else
184
+ $math.add($inval,$gapval)##
185
+ #end
186
+ #end
@@ -0,0 +1,33 @@
1
+ #**
2
+ * Main entry point into the /browse templates
3
+ *#
4
+
5
+ #set($searcher = $request.searcher)
6
+ #set($params = $request.params)
7
+ #set($clusters = $response.response.clusters)
8
+ #set($mltResults = $response.response.get("moreLikeThis"))
9
+ #set($annotate = $params.get("annotateBrowse"))
10
+ #parse('query_form.vm')
11
+ #parse('did_you_mean.vm')
12
+
13
+ <div class="navigators">
14
+ #parse("facets.vm")
15
+ </div>
16
+
17
+ <div class="pagination">
18
+ #parse("pagination_top.vm")
19
+ </div>
20
+
21
+ ## Show Error Message, if any
22
+ <div class="error">
23
+ #parse("error.vm")
24
+ </div>
25
+
26
+ ## Render Results, actual matching docs
27
+ <div class="results">
28
+ #parse("results_list.vm")
29
+ </div>
30
+
31
+ <div class="pagination">
32
+ #parse("pagination_bottom.vm")
33
+ </div>
@@ -0,0 +1,19 @@
1
+ #**
2
+ * Check if Clustering is Enabled and then
3
+ * call cluster_results.vm
4
+ *#
5
+
6
+ <h2 #annTitle("Clusters generated by Carrot2 using the /clustering RequestHandler")>
7
+ Clusters
8
+ </h2>
9
+
10
+ ## Div tag has placeholder text by default
11
+ <div id="clusters">
12
+ Run Solr with option -Dsolr.clustering.enabled=true to see clustered search results.
13
+ </div>
14
+
15
+ ## Replace the div content *if* Carrot^2 is available
16
+ <script type="text/javascript">
17
+ $('#clusters').load("#url_for_solr/clustering#lens",
18
+ {'wt':'velocity', 'v.template':"cluster_results"});
19
+ </script>