- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
构建我的第一个 Rails 应用程序并在让 Elasticsearch 在 Heroku 上运行时遇到问题。
本地工作完美。
在 Heroku 上我可以打开搜索页面,但是当我尝试执行搜索时出现以下错误:
Heroku 日志显示:
2015-05-18T12:05:15.969673+00:00 app[web.1]: ActionView::Template::Error ([404] {"error":"IndexMissingException[[homes] missing]","status":404}):
2015-05-18T12:05:15.969674+00:00 app[web.1]: 9: <% end %>
2015-05-18T12:05:15.969676+00:00 app[web.1]: 10:
2015-05-18T12:05:15.969677+00:00 app[web.1]: 11: <ul>
2015-05-18T12:05:15.969678+00:00 app[web.1]: 12: <% @homes.each do |home| %>
2015-05-18T12:05:15.969679+00:00 app[web.1]: 13: <li>
2015-05-18T12:05:15.969680+00:00 app[web.1]: 14: <h3>
2015-05-18T12:05:15.969682+00:00 app[web.1]: 15: <%= link_to home.name, controller: "homes", action: "show", id: home._id%>
2015-05-18T12:05:15.969683+00:00 app[web.1]: app/views/search/search.html.erb:12:in `_app_views_search_search_html_erb___1261310385184340853_69929402195100'
gem :
gem 'elasticsearch-model'
gem 'elasticsearch-rails'
gem 'bonsai-elasticsearch-rails', '~> 0.0.4'
搜索 Controller :
class SearchController < ApplicationController
def search
if params[:q].nil?
@homes = []
else
@homes = Home.search params[:q]
end
end
end
搜索 View :
<h1>Homes Search</h1>
<%= form_for search_path, method: :get do |f| %>
<p>
<%= f.label "Search for" %>
<%= text_field_tag :q, params[:q] %>
<%= submit_tag "Go", name: nil %>
</p>
<% end %>
<ul>
<% @homes.each do |home| %>
<li>
<h3>
<%= link_to home.name, controller: "homes", action: "show", id: home._id%>
</h3>
</li>
<% end %>
</ul>
如有任何建议,我们将不胜感激!
最佳答案
问题类似于this issue .
解决方案涉及
elasticsearch.rake
exists curl -XPOST http://account.region.bonsai.io/homes
关于ruby-on-rails - Elasticsearch & Bonsai : IndexMissingException on Heroku, 在本地运行良好,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30303065/
浏览到:http://127.0.0.1:9200/wham/_search 给我: { "error": "IndexMissingException[[wham] missing]", "
我正在尝试使用elasticSearch + mongoose(即elmongo)在node.js 中实现搜索引擎。每当我尝试运行搜索 api 时,我都会得到“错误”:“IndexMissingExc
我想使用 Elasticsearch 索引和搜索 mysql 数据库,我遵循了本教程 elasticsearch-river-jdbc 首先我下载了elasticsearch并在其插件文件夹中安装
我正在为 ElasticSearch 中的搜索文档编写一些测试,但我收到 IndexMissingException [indexed_store_detail] 缺失。我在测试中创建了一个节点。在测
我正在尝试使用 elasticsearch 后端设置 haystack 搜索我收到以下错误: ./manage.py rebuild_index ... Failed to clear Elasti
构建我的第一个 Rails 应用程序并在让 Elasticsearch 在 Heroku 上运行时遇到问题。 本地工作完美。 在 Heroku 上我可以打开搜索页面,但是当我尝试执行搜索时出现以下错误
我不确定如何让我的产品编入索引,因为我认为这就是我收到此错误的原因: Tire::Search::SearchRequestFailed in SearchController#results 404
我想使用 ElasticSearch + Tire 来搜索存储在 MongoDB 中。 但是,当我尝试执行搜索时出现以下错误: SearchController#index 中的Tire::Searc
我是一名优秀的程序员,十分优秀!