code: func processIndexMap(jsonFragment map[string]interface{}) error {
  
  	//iterate the item in the map
  	for jsonKey, jsonValue := range jsonFragment {
  
  		switch jsonKey {
  
  		case "fields":
  
  			switch jsonValueType := jsonValue.(type) {
  
  			case []interface{}:
  
  				//iterate the index field objects
  				for _, itemValue := range jsonValueType {
  
  					switch reflect.TypeOf(itemValue).Kind() {
  
  					case reflect.String:
  						//String is a valid field descriptor  ex: "color", "size"
  						logger.Debugf("Found index field name: \"%s\"", itemValue)
  
  					case reflect.Map:
  						//Handle the case where a sort is included  ex: {"size":"asc"}, {"color":"desc"}
  						err := validateFieldMap(itemValue.(map[string]interface{}))
  						if err != nil {
  							return err
  						}
  
  					}
  				}
  
  			default:
  				return fmt.Errorf("Expecting a JSON array of fields")
  			}
  
  		case "partial_filter_selector":
  
  			//TODO - add support for partial filter selector, for now return nil
  			//Take no other action, will be considered valid for now
  
  		default:
  
  			//if anything other than "fields" or "partial_filter_selector" was found,
  			//return an error
  			return fmt.Errorf("Invalid Entry.  Entry %s", jsonKey)
  
  		}
  
  	}
  
  	return nil
  
  }
docs: //processIndexMap processes an interface map and wraps field names or traverses
  //the next level of the json query