At the moment, hook_faceted_search_collect() implementations are responsible for extracting their own little fragments from the search text. Now that there are lots of such hook implementations, it is becoming increasingly inefficient, as each implementation has to look into the search text for the fragments that interests it.

We need a generic mechanism to parse all fragments from the search text once, and then invoke the hooks with the fragments found. As an additional benefit, this would help further simplify the hook implementations. We need to extract key:value fragments separated by spaces, where the value can optionally be enclosed within double-quotes (in which case spaces would be allowed within the value).

This could be implemented in a very generic way so it could be re-used by other modules. This could be part of the "search query object" that has been discussed at the recent Minnesota Search Sprint<"a>.

Comments

David Lesieur’s picture

Additionally, we'd like to be able to extract multiple values for the same key (e.g. field_a:value1 field_a:value2)