Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elasticsearchを動くようにした #225

Merged
merged 5 commits into from
Jul 7, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" }) %>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

インデントずれてる

<%= f.text_field(:word,
{ value: params.dig(:elasticsearch, :word),
class: "form-control", }) %>
yonta marked this conversation as resolved.
Show resolved Hide resolved
</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