// SearchValues finds all matching keys according to stype (SearchType)
// and returns all the values of the matching keys.
SearchValues finds all matching keys according to stype (SearchType)
and returns all the values of the matching keys.
// SearchValues finds all matching keys according to stype ( SearchType ) // and returns all the values of the matching keys .
func (t *Trie) SearchValues(key string, stype SearchType) []interface{} {
	switch stype {
	case SearchExactly:
		if v, ok := t.Find(key); ok {
			return []interface{}{v}
		}
	case SearchByPrefix:
		return t.FindByPrefixValue(key)
	case SearchLongestMatchingPrefix:
		if _, v, ok := t.FindLongestMatchingPrefix(key); ok {
			return []interface{}{v}
		}
	case SearchMatcingPrefix:
		return t.FindMatchingPrefixValue(key)
	case SearchApproximate:
		return t.FindByFuzzyValue(key)
	case SearchAllRelativeKey:
		return t.FindRelativeValues(key)
	}
	return nil
}
func ( t * Trie ) SearchValues ( key string , stype SearchType ) [ ] interface { } { switch stype { case SearchExactly : if v , ok := t . Find ( key ) ; ok { return [ ] interface { } { v } } case SearchByPrefix : return t . FindByPrefixValue ( key ) case SearchLongestMatchingPrefix : if _ , v , ok := t . FindLongestMatchingPrefix ( key ) ; ok { return [ ] interface { } { v } } case SearchMatcingPrefix : return t . FindMatchingPrefixValue ( key ) case SearchApproximate : return t . FindByFuzzyValue ( key ) case SearchAllRelativeKey : return t . FindRelativeValues ( key ) } return nil }
SearchValues finds all matching keys according to stype (SearchType)
and returns all the values of the matching keys.
SearchValues finds all matching keys according to stype ( SearchType ) and returns all the values of the matching keys .