Thanks. I changed my format from ERB to SLIM, and also added the layout to
the views.
With my old code I could've done:
```
<%= form_tag searches_path, method: :get do %>
<%= text_field_tag :search, params[:search].gsub(/\s+/, ‘ | ‘) %>
<%= button_tag "Search", name: nil %>
<% end %>
```
However things have changed so this is how it looks now:
```
= form_tag searches_path, method: :get do
span.secrch_box_bg
input.text_input name='search' type="text" placeholder="e.g
(female), likes dogs, has a job)"
input.find_btn type="submit" value="Find" /
```
How would I insert that into my code do you know by chance?
On Saturday, August 16, 2014 10:26:47 AM UTC-4, Pat Allan wrote:
>
> Thinking Sphinx since v3.0.0 uses Sphinx’s SphinxQL protocol (which is
> very similar to SQL), and SphinxQL uses Sphinx’s extended match mode, which
> is documented here:
> http://sphinxsearch.com/docs/manual-2.1.8.html#extended-syntax
>
> The OR logic is represented in Sphinx with a pipe character |. So, you’ll
> need to split up each word by pipes, perhaps like the following:
>
> params[:search].gsub(/\s+/, ‘ | ‘)
>
> Of course, more complex queries may not play nicely with this, so it may
> be easier to teach the people using your site to use pipes, or something
> that’s easily regex’d (like OR):
>
> params[:search].gsub(/\bOR\b/, ‘ | ‘)
>
> Cheers
>
> —
> Pat
>
> On 16 Aug 2014, at 12:06 am, [email protected] <javascript:> wrote:
>
> How can I search for multiple keywords that will returns results
> containing at least one of the keywords entered?
>
> For example on my app there are 2 users who on their profile has "dogs and
> cat" and "cat" on their page. If I do a search "dogs, cat" it will not
> return results for both users.
>
> If I do a search for "cat" it will return both users. The params are
> "&search=dogs%2C+cat"
>
> Is there a way so that when a user enters more than one keyword (it could
> be up to 5), that ThinkingSphinx will return results that contain at least
> one of those keywords?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Thinking Sphinx" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected] <javascript:>.
> To post to this group, send email to [email protected]
> <javascript:>.
> Visit this group at http://groups.google.com/group/thinking-sphinx.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.