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 367663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:44:59+00:00 2026-05-12T13:44:59+00:00

I successfully installed and set it up searchlogic for basic (keyword) searching. I have

  • 0

I successfully installed and set it up searchlogic for basic (keyword) searching. I have the following problem:

@search = Proposal.search(params[:search])
@proposals = @search.all

The above code works properly if I type in a keyword such as “red”. It will bring up everything with red keyword. Or if I type in “green”, it will bring up everything with green as a keyword. However, when I type “red green” in the search box it will ONLY bring up cases where the keywords are BOTH red and green (and not bring up instances where they may only have one of the two keywords). Yes, I am using keywords_like_any. I can see what the general problem is via debug, keywords_like_any: green red. The below code works as I want it to (bring up any instances of red OR green).

@search2 = Proposal.keywords_like_any("red", "green")
@test = @search2.all

I believe what I need to do to solve the issue is turn the first code to view params[:search] as an array? I tried doing params[:string].to_s.split (as shown in railscast) however it did not work.

  • 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-05-12T13:44:59+00:00Added an answer on May 12, 2026 at 1:44 pm

    The *_like_any is intended to be used with checkboxes form helpers (f.check_box) which outputs arrays into your params hash as opposed to f.text_field which outputs strings. If you still want to use them with a f.text_field you can :

    • split the field with Javascript on client side to output an Array
    • split it in your controller

    Considering that your field is named keyboard here is some code that should solve your problem :

    params[:search][:keywords_like_any] = params[:search][:keywords_like_any].split(' ')
    @proposals = Proposal.search(params[:search])
    

    You can skip the line @proposals = @search.all because search results works like an array.

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

Sidebar

Ask A Question

Stats

  • Questions 218k
  • Answers 218k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I just found a possible explanation: During the build of… May 12, 2026 at 11:38 pm
  • Editorial Team
    Editorial Team added an answer in your view: <%=text_field_tag 'locationPOS', "", :disabled => true, :onchange… May 12, 2026 at 11:38 pm
  • Editorial Team
    Editorial Team added an answer It's a typedef of std::basic_string<char>, actually. std::basic_string is a container… May 12, 2026 at 11:38 pm

Related Questions

I have a simple windows Service developed in VS.net 2008 and VB.net. When I
So we've produced a windows service to feed data to our client application and
I have a Rails app that I have successfully tested with Mongrel and Webkit.
I've installed SQL Server 2005 on my machine and now I'm trying to connect

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.