Skip to content

Commit

Permalink
Merge pull request #225 from momocus/fix-elastic
Browse files Browse the repository at this point in the history
elasticsearchを動くようにした
  • Loading branch information
yonta authored Jul 7, 2021
2 parents 86f4e00 + cee9460 commit 97bf497
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 21 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Install build tools, posgresql-client, yarn and node
RUN apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
curl=7.64.* build-essential=12.6 gnupg2=2.2.* imagemagick=8:6.9.* && \
curl=7.64.* build-essential=12.6 gnupg2=2.2.* imagemagick=8:6.9.* \
git=1:2.20.* && \
apt-get clean && \
rm -rf /var/cache/apt/archives/* && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ gem "era_ja"

# ElasticSearch
gem "bonsai-elasticsearch-rails"
gem "elasticsearch-model"
gem "elasticsearch-model", github: "indirect/elasticsearch-rails"
gem "elasticsearch-rails"

group :development, :test do
Expand Down
15 changes: 10 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
GIT
remote: https://github.com/indirect/elasticsearch-rails.git
revision: 20efbf2ca6a4d310b3e11638334d85017d923ffe
specs:
elasticsearch-model (7.1.0)
activesupport (> 3)
elasticsearch (~> 7)
hashie

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -135,10 +144,6 @@ GEM
elasticsearch-transport (= 7.13.1)
elasticsearch-api (7.13.1)
multi_json
elasticsearch-model (7.1.1)
activesupport (> 3)
elasticsearch (> 1)
hashie
elasticsearch-rails (7.1.1)
elasticsearch-transport (7.13.1)
faraday (~> 1)
Expand Down Expand Up @@ -426,7 +431,7 @@ DEPENDENCIES
devise
devise-i18n
dotenv-rails
elasticsearch-model
elasticsearch-model!
elasticsearch-rails
enum_help
era_ja
Expand Down
31 changes: 17 additions & 14 deletions app/views/elasticsearch/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<h2><%= link_to(t("views.elasticsearch.title"), elasticsearch_path, { class: "text-dark" }) %></h2>
<h2><%= t("views.elasticsearch.title") %></h2>

<%= form_with({ scope: :elasticsearch,
url: elasticsearch_path,
method: :get,
local: true,
class: "form-inline my-1", }) do |f| %>
<%= f.label("search", class: "sr-only") %>
<%= f.text_field(:word,
{ placeholder: "Keyword",
value: params.dig(:elasticsearch, :word),
class: "form-control mr-sm-2", }) %>
<%= button_tag(type: :submit, class: "btn btn-secondary") do %>
<%= bootstrap_icon("search") %>
<% end %>
<%= form_with(scope: :elasticsearch,
url: elasticsearch_path,
method: :get,
local: true,
class: "row my-1",) do |f| %>
<div class="col-auto">
<%= f.label(:word, { class: "form-label visually-hidden" }) %>
<%= f.text_field(:word,
{ value: params.dig(:elasticsearch, :word),
class: "form-control", }) %>
</div>
<div class="col-auto">
<%= button_tag(type: :submit, class: "btn btn-secondary") do %>
<%= tag.i(class: "bi-search") %>
<% end %>
</div>
<% end %>

<% @sakes.each do |sake| %>
Expand Down

0 comments on commit 97bf497

Please sign in to comment.