As soon as you have more than one word, for which to make a search for
within a text, it becomes more complex!
You can do as JamesF wrote, write the find, so each word is included
in a LIKE statement with OR between them.
You can also do as Smelly Eddie wrote, use tags instead, but the
problem is to ensure that the user only enters valid tags then!

Or you can use Soundex values! Or metaphone if you are using only
english! See the PHP manual.

Let's say you want to search for the words "cake" and "orange" in your
table.

The search functionality would first convert the words into soundex
values.
The find would then query the table records which are related to the
soundex values through a HABTM relationship.

contentTable -> HABTM -> soundexTable

The solution means that each word in your content should be processed
to create soundex values to which the content then will be related.

Just an idea, maybe you could use it! :)
Enjoy,
   John

On Aug 12, 1:27 pm, Smelly Eddie <[email protected]> wrote:
> better yet avvoid storing multiplee values in one field. Create a
> reference table (tags) and add those values one per record. It. Will
> save the code maintainers sanity down the road
>
> On Aug 11, 11:32 pm, JamesF <[email protected]> wrote:
>
> > some fancy combos 'LIKE' and 'OR' in your find conditions array should
> > get it done. The trick is formatting your array.
>
> >http://book.cakephp.org/view/74/Complex-Find-Conditions
>
> > On Aug 11, 8:55 pm, "Dave Maharaj :: WidePixels.com"
>
> > <[email protected]> wrote:
> > > I am building a new search function for a input single field.
>
> > > I have the basic set up running but as I move forward I want the user to 
> > > be
> > > able to enter more than 1 word coma separated.
>
> > > How would I do this?
>
> > > spilt the $queryValues = $query split ','
>
> > > So i now have an array of values that they entered but how do I then query
> > > each of those values?
>
> > > Is there a better way to do this?
>
> > > thanks,
>
> > > Dave
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to