Lot easier is to customise the search result page to return the results in JSON format for example. You can then parse the results any way you want
I use semicolon separated data in a metadata field for our navigation. (Typical metadata string in the filed: login to, or register for, My Account;login to, or join, My Account;sign-in to, or register for, My Account)
Example:
Search results page:
{"tokens":[%asset_metadata_i_want_to^preg_replace:208925^preg_replace:208928%],"url":"%asset_url%","display_string":"%asset_metadata_i_want_to^preg_replace:209174%"},
Regular expression to parse the results:
(regex) - (replace)
208925:
/([a-zA-Z0-9 .,'"():&*\-_\/<>]+)(\s|\n|)(;|)(\s|\n|)/ - "$1"
(regex) - (replace)
208928:
/""/ - ","
(regex) - (replace)
209174 (2 sets):
/(\s|\n|)( ; )(\s|\n|)([a-zA-Z0-9 ,.()&'"*\-_\/<>]+)/ - $1 /;$/
Remove spaces between brackets in “( ; )” - had to add them to prevent it to be converted to smiley face.
Then create Design that sets the content to JSON adding only:
<MySource_PRINT id_name="__global__" var="content_type" content_type="application/json; charset=utf-8" /> <MySource_area id_name="body" design_area="body" />
into the parse file, apply design to result page and you are done.
Then make an Ajax call to that result page and parse them to dynamic list.
You then have two options:
When user types text in to search field, you call the JSON search, if they don’t select any from the result list, you redirect them to generic search page. (That’s what I do on our site)
Alternatively, do normal search but leave result pages empty from Matrix keywords and parse the JSON instead (or what ever you want to do - mix Matrix default results with JSON etc)
You can see the whole thing at work on our site: www.tmbc.gov.uk (“I want to…”)
Sorry, one more thing: of course you then use JavaScript to search the returned JSON and adapt the regexes to your needs (e.g. to split results from a semcolon).
Another way could be to have an asset listing page with that metadata, split the data from semicolon and search the contents of that page.