I'm trying to create "Search API widget" using two exposed filters "search: Full text" + "taxonomy term: City"
The good example of what I want to achieve would be visible here:
http://olx.in/
Whenever you type in the city + full text search it generates the url such as:
http://olx.in/city-name/q-something/
However if I use exposed filters it doesnt seem to work in that way it creates links like this:
http://localhost/search?search_api_views_fulltext={something}&field_city={taxonomy-term-id}
When after I do the search I use facet filter with pretty paths it gives a bit better result:
http://localhost/search/field_city/{name_of_region}/field_city/{name_of_region}/field_city/{name_of_sub_region}/field_city/{name_of_region}/field_city/{name_of_sub_region}/field_city/{name_of_city}search_api_views_fulltext=&field_city=1031
But I want the end result pretty much to look like this:
http://localhost/{name-of-city}/search-something
And after searching I want it to activate proper facets for the "field_city" so if after searching someone would want to add facet it would not create a {field_city}/{field_city}
And in order to do that, I was considering instead of using a "exposed taxonomy term filter" to use facet block for "Field_city" but no luck so far.
** Update 01.10.2015 **
I was doing research and I think that the "cities" and "categories" on OLX or any other decent portal are not actually facets or exposed filters, but they are Taxonomy pages with inherited search query.
- So if someone types in "Exposed full text search api" a "Yorkshire terrier"
- He is redirected to:
http://localhost/search?search_api_views_fulltext={Yorkshire terrier}
- And on left sidebar he have "Taxonomy menu block" with vocabularies of "small ads categories" with terms such as "animals"
- He clicks on "animals" term and the search value follows him.
http://localhost/small-ads-categories/animals/search?search_api_views_fulltext={Yorkshire terrier}
- Of course the taxonomy is a search api view
- However I also would want to extend this by adding a second parameter which is "city" <- not sure how to do that
Another feature that I'm trying to figure out how to create a "select box" for a city that is not a exposed filter but a link parameter.
For example: if someone wants to search for: Yorkshire Terrier + he selects locations from select box to be: London
Normally it is done by creating exposed taxonomy filter - however it generates ugly url, the thing that I'm considering is using the value that is selected to redirect user to the proper search results page. so if he selects Yorkshire Terrier in london he is redirected to:
http://localhost/london/search?search_api_views_fulltext={Yorkshire terrier}
Where london is also a taxonomy search api url.
** update: few hours later **
After further thinking and trying to solve this issue, using taxonomy terms view block seems like a good idea, but it displays ALL possible terms not only the terms that are related to current search query and that I'm not sure how could I limit ?