How to allow user to do a search which returns a route with the search query in it?
Hi All!
I have a search box that allows users to input a book name and then gives them a list of books that match that query.
What I want to be able to do is after the search form is submitted it will direct them to a route:
search/book/{searchQuery}
How could I do this?
Furthermore, what if the user searches something that is multiple words? Or special characters? Won't this break the URL since there will be spaces or foreign characters in it now? How can I combat this?
@Snapey
If a user wants to share a link to his results. The person he shared it with would not have to do the search part again but could follow the link.
Also for SEO and search engines. If these pages were linked to, search engines could easily crawl the results for specific queries since there is an actual url associated with it...
Does that make sense or am I thinking about this all wrong?