// SearchAll finds all matching keys and values according to stype (SearchType).
SearchAll finds all matching keys and values according to stype (SearchType).
// SearchAll finds all matching keys and values according to stype ( SearchType ) .
func (t *Trie) SearchAll(key string, stype SearchType) map[string]interface{} {
	switch stype {
	case SearchExactly:
		if v, ok := t.Find(key); ok {
			return map[string]interface{}{key: v}
		}
	case SearchByPrefix:
		return t.FindByPrefixAll(key)
	case SearchLongestMatchingPrefix:
		if k, v, ok := t.FindLongestMatchingPrefix(key); ok {
			return map[string]interface{}{k: v}
		}
	case SearchMatcingPrefix:
		return t.FindMatchingPrefixAll(key)
	case SearchApproximate:
		return t.FindByFuzzyAll(key)
	case SearchAllRelativeKey:
		return t.FindRelativeAll(key)
	}
	return nil
}
func ( t * Trie ) SearchAll ( key string , stype SearchType ) map [ string ] interface { } { switch stype { case SearchExactly : if v , ok := t . Find ( key ) ; ok { return map [ string ] interface { } { key : v } } case SearchByPrefix : return t . FindByPrefixAll ( key ) case SearchLongestMatchingPrefix : if k , v , ok := t . FindLongestMatchingPrefix ( key ) ; ok { return map [ string ] interface { } { k : v } } case SearchMatcingPrefix : return t . FindMatchingPrefixAll ( key ) case SearchApproximate : return t . FindByFuzzyAll ( key ) case SearchAllRelativeKey : return t . FindRelativeAll ( key ) } return nil }
SearchAll finds all matching keys and values according to stype (SearchType).
SearchAll finds all matching keys and values according to stype ( SearchType ) .