Search problem (probably a simple one...?)

Hi there,

I’ve been spending hours trying to figure out how to do this ferret
correctly, but it just won’t work…

The final ferret query should simply look like this:

country: “United Kingdom”
(it needs the “” because it’s a “PhraseQuery”)

I thought the controller should look like this…

query = @query = “country:”+’"‘[email protected]}+’"’ if
@results = User.find_by_contents(query)


query = @query = “country:”+""“[email protected]}+”"" if
@results = User.find_by_contents(query)


query = @query = “country:”#{}"" if
@results = User.find_by_contents(query)

…but the search doesn’t get the correct result. (In fact, it doesn’t
even get a result with only “United” in the “country” column - I

When I look at the “@query.inspect”, it reads for all 3 cases:

“country:“United Kingdom””

What am I doing wrong??? What is the correct controller syntax?

Thank you very much for your help!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs