Ruby on rails Solr太阳黑子-如何提高与太阳黑子的可搜索关联性?
我在使用MongoDB数据库(Mongo mapper)的Ruby on Rails应用程序中使用Sunspot Solr进行索引和搜索 我有属于用户的类文章。我用Sunspot SOLR索引我的对象用户。看起来是这样的:Ruby on rails Solr太阳黑子-如何提高与太阳黑子的可搜索关联性?,ruby-on-rails,mongodb,solr,sunspot,Ruby On Rails,Mongodb,Solr,Sunspot,我在使用MongoDB数据库(Mongo mapper)的Ruby on Rails应用程序中使用Sunspot Solr进行索引和搜索 我有属于用户的类文章。我用Sunspot SOLR索引我的对象用户。看起来是这样的: class Article include ActiveModel::Serializers::JSON include MongoMapper::Document include Sunspot::Mongo ... ke
class Article
include ActiveModel::Serializers::JSON
include MongoMapper::Document
include Sunspot::Mongo
...
key :title, String
key :introduction, String
key :cover, String
...
belongs_to :user
...
searchable do
text :title, :boost => 5
text :user do
user.username if user
end
string(:category)
boolean(:published)
end
我能够成功搜索顶级车型的user.username
字段,但当我提升此字段时,会出现以下示例:
text :user, :boost => 10 do
user.username if user
end
它不起作用,太阳黑子完全忽略了提升(标题栏运行良好)
这是语法错误吗
请帮忙
谢谢