私のアプリケーションでは、mongoDB の下にモデルを作成し、sunspot_mongo を使用してそれを solr に再インデックスしました。solrから検索したいのですが、私のモデルは、
`require 'sunspot_mongo'
class Post
include Mongoid::Document
include Sunspot::Mongo
field :title
field :content
field :author, type: String
searchable do
text :title, :stored => true
text :content
end
end`
私のコントローラーインデックスメソッドは、
def index
#@posts = Post.all
search=Post.search do
fulltext 'hello'
end
@posts = search.results
respond_to do |format|
format.html # index.html.erb
format.json { render json: @posts }
end
終了しますが、初期化されていない定数 Sunspot::Mongo::DataAccessor::BSON としてエラーが表示されます
このエラーを修正できませんでした