I'm trying to build a low search field that displays one visible predictive select2 input field that pulls in suggestions from a devdemon tagger field, as well as the last x most popular search terms. These options will probably generated with the template rather than an ajax behaviour as the list won't be huge and it would be faster to do it that way I think.
The ideal behaviour would be this: when the user starts typing, I suggest matching words based on tags/previous searches. If they select a tag from the list, I run a tag field search based on that tag; if they select a previous search term I run a keyword search based on that phrase. If they don't select any matching suggestions I run a keyword search based on what they typed.
Ideally I'd like them to be able to select more up to two suggestion combinations.
My question is - should I have one visible select2 input field, but populate hidden search fields when selections are made? (eg call the select field 'keywords' and also have a hidden field called 'tags' (or whatever my tag field is called)?
What's the best way (if any) to achieve this?
My fallback would be to remove the recent search suggestions and simply suggest tags, but still allow them to enter a keyword search. The same question applies to the fallback situation...!