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,64 @@
1
+ #**
2
+ * Renders the main query form
3
+ *#
4
+
5
+ <div class="query-box">
6
+ <form id="query-form" action="#{url_for_home}" method="GET">
7
+
8
+ <div class="inputs">
9
+ <span #annTitle("Add the query using the &q= parameter")>
10
+ Find:
11
+ <input type="text" id="q" name="q" value="$!esc.html($params.get('q'))"/>
12
+ <input type="submit" id="querySubmit"/>
13
+ <input type="reset"/>
14
+ </span>
15
+ <div class="query-boost">
16
+ <span #annTitle("Add the boost function &bf=price to the query")>
17
+ <input type="checkbox" name="bf" value="price"
18
+ #if($request.params.get('bf') == 'price')checked="true"#end
19
+ >
20
+ Boost by Price
21
+ </input>
22
+ </span>
23
+ #parse("query_spatial.vm")
24
+ #parse("query_group.vm")
25
+ </div>
26
+ </div>
27
+
28
+ #if($request.params.get('debugQuery'))
29
+ <input type="hidden" name="debugQuery" value="true"/>
30
+ #end
31
+ #if($annotate == true)
32
+ <input type="hidden" name="annotateBrowse" value="true"/>
33
+ #end
34
+ #foreach($fq in $request.params.getParams('fq'))
35
+ #if ($fq != "{!bbox}")
36
+ <input type="hidden" name="fq" id="allFQs" value="$esc.html($fq)"/>
37
+ #end
38
+ #end
39
+
40
+ <div class="constraints" #annTitle("Lists out the &fq filters. Click to remove.")>
41
+ #foreach($fq in $params.getParams('fq'))
42
+ #set($previous_fq_count=$velocityCount - 1)
43
+ #if($fq != '')
44
+ &gt;
45
+ <a style="{text-decoration: line-through;}"
46
+ href="#url_for_filters($request.params.getParams('fq').subList(0,$previous_fq_count))"
47
+ >$fq</a>
48
+ #end
49
+ #end
50
+ </div>
51
+
52
+ <div class="parsed_query_header">
53
+ #if($request.params.get('debugQuery'))
54
+ <a href="#" onclick='jQuery(this).siblings("div").toggle(); return false;'>toggle parsed query</a>
55
+ <div class="parsed_query" style="display:none">$response.response.debug.parsedquery</div>
56
+ #end
57
+ #set($queryOpts = $request.params.get("queryOpts"))
58
+ #if($queryOpts && $queryOpts != "")
59
+ <input type="hidden" name="queryOpts" value="$queryOpts"/>
60
+ #end
61
+ </div>
62
+
63
+ </form>
64
+ </div>
@@ -0,0 +1,43 @@
1
+ #**
2
+ * Query settings for grouping by fields,
3
+ * e.g.: Manufacturer or Popularity
4
+ *#
5
+
6
+ #set($queryOpts = $params.get("queryOpts"))
7
+
8
+ #if($queryOpts == "group")
9
+ <div>
10
+ #set($groupF = $request.params.get('group.field'))
11
+
12
+ <label #annTitle("Add the &group.field parameter. Multiselect is supported")>
13
+ Group By:
14
+ <select id="group" name="group.field" multiple="true">
15
+ ## TODO: Handle multiple selects correctly
16
+ ## TODO: fix empty / "No Group" selection
17
+
18
+ <option value=""
19
+ #if($groupF == '')selected="true"#end
20
+ >
21
+ No Group
22
+ </option>
23
+
24
+ <option value="manu_exact"
25
+ #if($groupF == 'manu_exact')selected="true"#end
26
+ >
27
+ Manufacturer
28
+ </option>
29
+
30
+ <option value="popularity"
31
+ #if($groupF == 'popularity')selected="true"#end
32
+ >
33
+ Popularity
34
+ </option>
35
+
36
+ </select>
37
+ </label>
38
+
39
+ <input type="hidden" name="group" value="true"/>
40
+
41
+ </div>
42
+
43
+ #end
@@ -0,0 +1,75 @@
1
+ #**
2
+ * Query logic for selecting location / Geospatial search
3
+ *#
4
+
5
+ #set($queryOpts = $params.get("queryOpts"))
6
+
7
+ #if($queryOpts == "spatial")
8
+
9
+ <div>
10
+
11
+ #set($loc = $request.params.get('pt'))
12
+ ## Normalize first trip through to "none" because
13
+ ## an empty string generates an error message later on
14
+ #if( ! $loc )
15
+ #set( $loc = "none" )
16
+ #end
17
+
18
+ #set($dist = $request.params.get('d', "10"))
19
+
20
+ ## Cities for The Select List
21
+ #set( $cities = {
22
+ "none": "No Filter",
23
+ "45.17614,-93.87341": "Buffalo, MN",
24
+ "37.7752,-100.0232": "Dodge City, KS",
25
+ "35.0752,-97.032": "Oklahoma City, OK",
26
+ "37.7752,-122.4232": "San Francisco CA"
27
+ })
28
+
29
+ <label #annTitle("Add the &pt parameter")>
30
+ Location Filter:
31
+ <select id="pt" name="pt">
32
+
33
+ ## Generate <option> tag for each city
34
+ #foreach( $city_lon_lat in $cities.keySet() )
35
+ #set( $city_name = $cities.get($city_lon_lat) )
36
+ <option value="$city_lon_lat"
37
+ #if($loc == $city_lon_lat)selected="true"#end
38
+ >
39
+ $city_name
40
+ </option>
41
+ #end
42
+
43
+ </select>
44
+
45
+ </label>
46
+
47
+ <span #annTitle("Add the &d parameter")>
48
+ Distance (KM):
49
+ <input id="d" name="d" type="text" size="6"
50
+ value="#if($dist != '')${dist}#{else}10#end" ## TODO: isn't the default of 10 above sufficient? no if/else needed?
51
+ />
52
+ </span>
53
+
54
+ <input type="hidden" name="sfield" value="store"/>
55
+ <input type="hidden" id="spatialFQ" name="fq" value=""/>
56
+ <input type="hidden" name="queryOpts" value="spatial"/>
57
+
58
+ </div>
59
+
60
+ <script type="text/javascript">
61
+ $('#query-form').submit(function() {
62
+ if ($("#pt").val() != "none") {
63
+ $("#spatialFQ").val("{!bbox}");
64
+ }
65
+ $fqs = $("#allFQs").val();
66
+ $fqs = $fqs.replace("{!bbox}", "");
67
+ if ($fqs == ''){
68
+ $("#allFQs").remove();
69
+ }
70
+ $("#allFQs").val($fqs);
71
+ return true;
72
+ });
73
+ </script>
74
+
75
+ #end
@@ -0,0 +1,22 @@
1
+ #**
2
+ * Render the main Results List
3
+ *#
4
+
5
+ ## Usually displayed inside <div class="results">
6
+
7
+ #if($response.response.get('grouped'))
8
+
9
+ #foreach($grouping in $response.response.get('grouped'))
10
+ #parse("hit_grouped.vm")
11
+ #end
12
+
13
+ #else
14
+
15
+ #foreach($doc in $response.results)
16
+ #parse("hit.vm")
17
+ ## Can get an extremely simple view of the doc
18
+ ## which might be nicer for debugging
19
+ ##parse("hit_plain.vm")
20
+ #end
21
+
22
+ #end
@@ -0,0 +1,153 @@
1
+ #**
2
+ * Render a complex document in the results list
3
+ *#
4
+
5
+ ## Load Mime-Type List and Mapping
6
+ #parse('mime_type_lists.vm')
7
+ ## Sets:
8
+ ## * supportedMimeTypes, AKA supportedtypes
9
+ ## * mimeExtensionsMap, AKA extMap
10
+
11
+ ## Title
12
+ #if($doc.getFieldValue('title'))
13
+ #set($title = $esc.html($doc.getFirstValue('title')))
14
+ #else
15
+ #set($title = "["+$doc.getFieldValue('id')+"]")
16
+ #end
17
+
18
+ ## URL
19
+ #if($doc.getFieldValue('url'))
20
+ #set($url = $doc.getFieldValue('url'))
21
+ #elseif($doc.getFieldValue('resourcename'))
22
+ #set($url = "file:///$doc.getFieldValue('resourcename')")
23
+ #else
24
+ #set($url = "$doc.getFieldValue('id')")
25
+ #end
26
+
27
+ ## Sort out Mime-Type
28
+ #set($ct = $list.get($doc.getFirstValue('content_type').split(";"),0))
29
+ #set($filename = $doc.getFieldValue('resourcename'))
30
+ #set($filetype = false)
31
+ #set($filetype = $mimeExtensionsMap.get($ct))
32
+
33
+ ## TODO: falling back to file extension is convenient,
34
+ ## except when you don't have an icon for that extension
35
+ ## example "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
36
+ ## document with a .docx extension.
37
+ ## It'd be nice to fall back to an "unknown" or the existing "file" type
38
+ ## We sort of do this below, but only if the filename has no extension
39
+ ## (anything after the last dot).
40
+
41
+ #if(!$filetype)
42
+ #set($filetype = $filename.substring($filename.lastIndexOf(".")).substring(1))
43
+ #end
44
+
45
+ ## #if(!$filetype)
46
+ ## #set($filetype = "file")
47
+ ## #end
48
+ ## #if(!$supportedMimeTypes.contains($filetype))
49
+ ## #set($filetype = "file")
50
+ ## #end
51
+
52
+ ## Row 1: Icon and Title and mlt link
53
+ <div class="result-title">
54
+ ## Icon
55
+ ## Small file type icons from http://www.splitbrain.org/projects/file_icons (public domain)
56
+ <img src="#{url_root}/img/filetypes/${filetype}.png" align="center">
57
+
58
+ ## Title, hyperlinked
59
+ <a href="${url}" target="_blank">
60
+ <b>$title</b></a>
61
+
62
+ ## Link for MLT / More Like This / Find Similar
63
+ <span class="mlt">
64
+ #if($params.getBool('mlt', false) == false)
65
+ <a href="#lensNoQ&q=id:%22$docId%22&mlt=true">
66
+ More Like This</a>
67
+ #end
68
+ </span>
69
+
70
+ </div>
71
+
72
+ ## Row 2?: ID / URL
73
+ <div>
74
+ Id: #field('id')
75
+ </div>
76
+
77
+ ## Resource Name
78
+ <div>
79
+ #if($doc.getFieldValue('resourcename'))
80
+ Resource name: $filename
81
+ #elseif($url)
82
+ URL: $url
83
+ #end
84
+ #if($ct)
85
+ ($ct)
86
+ #end
87
+ </div>
88
+
89
+ ## Author
90
+ #if($doc.getFieldValue('author'))
91
+ <div>
92
+ Author: #field('author')
93
+ </div>
94
+ #end
95
+
96
+ ## Last_Modified Date
97
+ #if($doc.getFieldValue('last_modified'))
98
+ <div>
99
+ last-modified:
100
+ #field('last_modified')
101
+ </div>
102
+ #end
103
+
104
+ ## Main content of doc
105
+ <div class="result-body">
106
+ #field('content')
107
+ </div>
108
+
109
+ ## Display Similar Documents / MLT = More Like This
110
+ <div class="mlt">
111
+ #set($mlt = $mltResults.get($docId))
112
+ #set($mltOn = $params.getBool('mlt'))
113
+ #if($mltOn == true)
114
+ <div class="field-name">
115
+ Similar Items
116
+ </div>
117
+ #end
118
+ ## If has MLT enabled An Entries to show
119
+ #if ($mltOn && $mlt && $mlt.size() > 0)
120
+ <ul>
121
+ #foreach($mltHit in $mlt)
122
+ #set($mltId = $mltHit.getFieldValue('id'))
123
+ <li>
124
+ <div>
125
+ <a href="#url_for_home?q=id:$mltId">
126
+ $mltId</a>
127
+ </div>
128
+ <div>
129
+ <span class="field-name">
130
+ Title:
131
+ </span>
132
+ $mltHit.getFieldValue('title')
133
+ </div>
134
+ <div>
135
+ <span class="field-name">
136
+ Author:
137
+ </span>
138
+ $mltHit.getFieldValue('author')
139
+ <span class="field-name">
140
+ Description:
141
+ </span>
142
+ $mltHit.getFieldValue('description')
143
+ </div>
144
+ </li>
145
+ #end ## end for each mltHit in $mlt
146
+ </ul>
147
+ ## Else MLT Enabled but no mlt results for this query
148
+ #elseif($mltOn && $mlt.size() == 0)
149
+ <div>No Similar Items Found</div>
150
+ #end
151
+ </div> ## div class=mlt
152
+
153
+ #parse('debug.vm')
@@ -0,0 +1,8 @@
1
+ #**
2
+ * Provides cynamic spelling suggestions
3
+ * as you type in the search form
4
+ *#
5
+
6
+ #foreach($t in $response.response.terms.name)
7
+ $t.key
8
+ #end
@@ -0,0 +1,50 @@
1
+ #**
2
+ * Provides navigation/access to Advanced search options
3
+ * Usually displayed near the top of the page
4
+ *#
5
+
6
+ ##TODO: Make some nice tabs here
7
+
8
+ #set($queryOpts = $params.get("queryOpts"))
9
+
10
+ <div class="tabs-bar" #annTitle("Click the link to demonstrate various Solr capabilities")>
11
+
12
+ <span>Type of Search:</span>
13
+
14
+ ##queryOpts=$queryOpts
15
+
16
+ ## return to Simple Search
17
+ ##set( $selected = ($queryOpts && $queryOpts != "") )
18
+ #set( $selected = ! $queryOpts )
19
+ <span class="tab #if($selected)selected#end">
20
+ #if($selected)
21
+ Simple
22
+ #else
23
+ <a href="#url_for_home/?#debug#annotate">
24
+ Simple</a>
25
+ #end
26
+ </span>
27
+
28
+ ## GEO-Spatial / Location Based
29
+ #set( $selected = ($queryOpts == "spatial") )
30
+ <span class="tab #if($selected)selected#end">
31
+ #if($selected)
32
+ Spatial
33
+ #else
34
+ <a href="#url_for_home?&queryOpts=spatial#debug#annotate">
35
+ Spatial</a>
36
+ #end
37
+ </span>
38
+
39
+ ## Group By Field
40
+ #set( $selected = ($queryOpts == "group") )
41
+ <span class="tab #if($selected)selected#end">
42
+ #if($selected)
43
+ Group By
44
+ #else
45
+ <a href="#url_for_home?#debug#annotate&queryOpts=group&group=true&group.field=manu_exact">
46
+ Group By</a>
47
+ #end
48
+ </span>
49
+
50
+ </div>
@@ -0,0 +1,132 @@
1
+ <?xml version='1.0' encoding='UTF-8'?>
2
+
3
+ <!--
4
+ * Licensed to the Apache Software Foundation (ASF) under one or more
5
+ * contributor license agreements. See the NOTICE file distributed with
6
+ * this work for additional information regarding copyright ownership.
7
+ * The ASF licenses this file to You under the Apache License, Version 2.0
8
+ * (the "License"); you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ -->
19
+
20
+ <!--
21
+ Simple transform of Solr query results to HTML
22
+ -->
23
+ <xsl:stylesheet version='1.0'
24
+ xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
25
+ >
26
+
27
+ <xsl:output media-type="text/html" encoding="UTF-8"/>
28
+
29
+ <xsl:variable name="title" select="concat('Solr search results (',response/result/@numFound,' documents)')"/>
30
+
31
+ <xsl:template match='/'>
32
+ <html>
33
+ <head>
34
+ <title><xsl:value-of select="$title"/></title>
35
+ <xsl:call-template name="css"/>
36
+ </head>
37
+ <body>
38
+ <h1><xsl:value-of select="$title"/></h1>
39
+ <div class="note">
40
+ This has been formatted by the sample "example.xsl" transform -
41
+ use your own XSLT to get a nicer page
42
+ </div>
43
+ <xsl:apply-templates select="response/result/doc"/>
44
+ </body>
45
+ </html>
46
+ </xsl:template>
47
+
48
+ <xsl:template match="doc">
49
+ <xsl:variable name="pos" select="position()"/>
50
+ <div class="doc">
51
+ <table width="100%">
52
+ <xsl:apply-templates>
53
+ <xsl:with-param name="pos"><xsl:value-of select="$pos"/></xsl:with-param>
54
+ </xsl:apply-templates>
55
+ </table>
56
+ </div>
57
+ </xsl:template>
58
+
59
+ <xsl:template match="doc/*[@name='score']" priority="100">
60
+ <xsl:param name="pos"></xsl:param>
61
+ <tr>
62
+ <td class="name">
63
+ <xsl:value-of select="@name"/>
64
+ </td>
65
+ <td class="value">
66
+ <xsl:value-of select="."/>
67
+
68
+ <xsl:if test="boolean(//lst[@name='explain'])">
69
+ <xsl:element name="a">
70
+ <!-- can't allow whitespace here -->
71
+ <xsl:attribute name="href">javascript:toggle("<xsl:value-of select="concat('exp-',$pos)" />");</xsl:attribute>?</xsl:element>
72
+ <br/>
73
+ <xsl:element name="div">
74
+ <xsl:attribute name="class">exp</xsl:attribute>
75
+ <xsl:attribute name="id">
76
+ <xsl:value-of select="concat('exp-',$pos)" />
77
+ </xsl:attribute>
78
+ <xsl:value-of select="//lst[@name='explain']/str[position()=$pos]"/>
79
+ </xsl:element>
80
+ </xsl:if>
81
+ </td>
82
+ </tr>
83
+ </xsl:template>
84
+
85
+ <xsl:template match="doc/arr" priority="100">
86
+ <tr>
87
+ <td class="name">
88
+ <xsl:value-of select="@name"/>
89
+ </td>
90
+ <td class="value">
91
+ <ul>
92
+ <xsl:for-each select="*">
93
+ <li><xsl:value-of select="."/></li>
94
+ </xsl:for-each>
95
+ </ul>
96
+ </td>
97
+ </tr>
98
+ </xsl:template>
99
+
100
+
101
+ <xsl:template match="doc/*">
102
+ <tr>
103
+ <td class="name">
104
+ <xsl:value-of select="@name"/>
105
+ </td>
106
+ <td class="value">
107
+ <xsl:value-of select="."/>
108
+ </td>
109
+ </tr>
110
+ </xsl:template>
111
+
112
+ <xsl:template match="*"/>
113
+
114
+ <xsl:template name="css">
115
+ <script>
116
+ function toggle(id) {
117
+ var obj = document.getElementById(id);
118
+ obj.style.display = (obj.style.display != 'block') ? 'block' : 'none';
119
+ }
120
+ </script>
121
+ <style type="text/css">
122
+ body { font-family: "Lucida Grande", sans-serif }
123
+ td.name { font-style: italic; font-size:80%; }
124
+ td { vertical-align: top; }
125
+ ul { margin: 0px; margin-left: 1em; padding: 0px; }
126
+ .note { font-size:80%; }
127
+ .doc { margin-top: 1em; border-top: solid grey 1px; }
128
+ .exp { display: none; font-family: monospace; white-space: pre; }
129
+ </style>
130
+ </xsl:template>
131
+
132
+ </xsl:stylesheet>