Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8814999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:16:00+00:00 2026-06-14T04:16:00+00:00

In my Rails application I have a Question model, setup with sunspot solr, with

  • 0

In my Rails application I have a Question model, setup with sunspot solr, with a field “text” and I’d like to search in that field doing a logical OR between words. I’ve found that setting minimum_match to 1 solves my problem, however I’d like also to order the results by boosting questions that have more than 1 word matching. Is there a way to do this with Solr? The documentation isn’t really helpful about ranking functions.

Edit: this is the full query I’m performing in the controller

@questions = Question.solr_search do
  fulltext params[:query], :minimum_match => 1
end.results
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:16:01+00:00Added an answer on June 14, 2026 at 4:16 am

    According to http://wiki.apache.org/solr/SchemaXml,

    The default operator used by Solr’s query parser (SolrQueryParser) can
    be configured with

    <solrQueryParser defaultOperator="AND|OR"/>. 
    

    The default operator is “OR” if unspecified. It is preferable to not use
    or rely on this setting; instead the request handler or query
    LocalParams should specify the default operator. This setting here can
    be omitted and it is being considered for deprecation.

    You can change your defaultOperator in solr/conf/schema.xml or you could use LocalParams to specify OR via syntax like https://github.com/sunspot/sunspot/wiki/Building-queries-by-hand

    It is true Sunspot’s default operator is “AND”, as referenced in https://github.com/sunspot/sunspot/blob/master/sunspot_solr/solr/solr/conf/schema.xml

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making a Rails application and I have question regarding stripping text for
I am using haml with my rails application and i have a question how
In my rails application I have a rake task that reads emails using imap.
I am building a Rails application that contains Developer s who have Application s.
I have a Rails application that accepts file uploads of CSV files. When developing
I have made a simple Rails application that allows people to comment on posts.
I have a rails application that patches ActiveRecord with a hand-coded validator. The patch
I have a Rails 3 application with a prescription model. The model has a
I have a Rails application that I'm in the process of designing. I have
I have a question regarding displaying and updating many elements from a Rails model

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.