简体   繁体   English

无法使用LocomotiveCMS-搜索工作

[英]Unable to get LocomotiveCMS-Search to work

I am having multiple issues getting locomotivecms-search to run. 我在运行locomotivecms-search时遇到多个问题。

First one is that after I have added the locomotive-search gem and ran the install with the bundler which has installed the gem, I do not see any changes happening in the back-office. 第一个是,在我添加了机车搜索gem并使用已安装gem的bundler运行安装后,我看不到后台发生任何更改。 I do not see any options for making the pages searchable. 我看不到任何使页面可搜索的选项。

The second problem is tied with the Wagon which I use for development. 第二个问题与我用于开发的Wagon有关。 I tried installing the gem locomotivecms-search-wagon, but without success. 我尝试安装gem locomotivecms-search-wagon,但没有成功。

Here is exactly what I have done in more details. 这正是我所做的更多详细信息。

I have added the locomotive_search gem to the engine and ran bundle install without problems. 我已经将locomotive_search gem添加到引擎中,并成功进行了捆绑安装。

gem 'locomotivecms-search', '>= 0.3.5', require: 'locomotive/search/mongoid'

bundle install

As per instructions on the Documentation website ( http://doc.locomotivecms.com/guides/search ), I tried adding a gem for Wagon, however, it was not found. 按照文档网站( http://doc.locomotivecms.com/guides/search )上的说明,我尝试为Wagon添加一个gem,但是找不到它。

gem 'locomotivecms-search-wagon', '~> 0.3.5'

bundle install

The bundler returned following output: 捆绑程序返回以下输出:

Fetching gem metadata from https://rubygems.org/........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Could not find gem 'locomotivecms-search-wagon (~> 0.3.5) ruby' in the gems available on this machine.

So, I proceeded. 所以,我继续。 I added the search form which when submitted would send request to /?t=SEARCH_TERM 我添加了搜索表单,该表单在提交后会将请求发送到/?t = SEARCH_TERM

I created the indexes by running the rake db:mongoid:create_indexes 我通过运行rake db:mongoid:create_indexes创建了索引

I then created a search page and made the contents of it resemble the code found at the bottom of this page: http://doc.locomotivecms.com/guides/search 然后,我创建了一个搜索页面,并使它的内容类似于此页面底部的代码: http : //doc.locomotivecms.com/guides/search

When I tried to push the pages via bundle exec wagon push production -r pages I got the following error: 当我尝试通过bundle exec wagon push production -r页面推送页面时,出现以下错误:

creating search{"template"=>["Liquid Syntax error ('Unknown tag 'search_for'' on '')"], "raw_template"=>["Liquid Syntax error ('Unknown tag 'search_for'' on '')"]}

I assume that this is happening because I could not install the locomotivecms-search-wagon gem, however, I do not know how to proceed, so I would appreciate all help. 我认为发生这种情况是因为我无法安装locomotivecms-search-wagon gem,但是,我不知道如何进行操作,因此,我将不胜感激。

I had the similar problem. 我有类似的问题。 Try to set: 尝试设置:

setParameter=textSearchEnabled=true

----> in mongodb.conf file mannually. ->在mongodb.conf文件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM