Storing search value in database


#1

Hi,

We got a search form (with autocomplete) for airlinetickets. The idea is
that we want to store the search query of all our visitors in our
database. The objective is to add this info to our management info.

Someone ideas?

remco


#2

http://railscasts.com/episodes/37 — Simple Search form

http://railscasts.com/episodes/111 — Advanced Search

On Jun 9, 4:30 pm, Remco S. removed_email_address@domain.invalid


#3

Not sure exactly what the issue is…

Create a model (say, SearchQueries) and whenever anybody hits your
search controller — presumably you only want to capture full queries
and not auto-complete requests – save the query into the database.

If you’re using an autocomplete search which provides links direct to
particular pages, you may also need to capture these - probably by
appending a parameter to the address and making sure that you create
and save a search query when someone hits those pages straight from
the autocomplete list.

-Matt

On Jun 9, 12:30 pm, Remco S. removed_email_address@domain.invalid