We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have two models:
Company
class Company < ApplicationRecord searchable auto_index: false do id_prefix do "COMPANY#{id}!" end string :topics, multiple: true, stored: false do topics end end end
and Contact
class Contact < ApplicationRecord searchable auto_index: false do id_prefix do "COMPANY#{company_id}" end join :topics, target: Company, type: :string, multiple: true, join: { from: :id, to: :company_id } end end
and when I try to make a boost by the number of topics in Contacts it does not work
topics = %w[sales marketing development] Contact.search do fulltext "*:*" do boost(10.0) { with(:topics).all_of(topics) } boost(5.0) { with(:topics).any_of(topics) } end order_by :score, :desc end
but with Companies all works fine.
I solved this problem locally by adding one hardcoded thing, which is score=max:
sunspot/lib/sunspot/field.rb:226
"{!join from=#{from} to=#{to} v='#{query.join(' AND ')}' score=max}"
But it would be nice if they implemented it in searchable for join with a separate parameter :)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have two models:
Company
and Contact
and when I try to make a boost by the number of topics in Contacts it does not work
but with Companies all works fine.
I solved this problem locally by adding one hardcoded thing, which is score=max:
"{!join from=#{from} to=#{to} v='#{query.join(' AND ')}' score=max}"
But it would be nice if they implemented it in searchable for join with a separate parameter :)
The text was updated successfully, but these errors were encountered: