ys": ["ctrl+9"],
		"command": "gs9o_win_open"
	},
	{
		"keys": ["ctrl+.","ctrl+9"],
		"command": "gs9o_win_open"
	},
	{
		"keys": ["ctrl+.","ctrl+0"],
		"command": "margo_show_hud"
	},
	{
		"keys": ["ctrl+space"],
		"command": "auto_complete",
		"args": {"disable_auto_insert": true, "api_completions_only": true, "next_completion_if_showing": false},
		"context": [{ "key": "selector", "operator": "equal", "operand": "text.9o" }]
	},
	{
		"keys": ["enter"],
		"command": "gs9o_exec",
		"args": {"save_hist": true},
		"context": [{ "key": "selector", "operator": "equal", "operand": "text.9o" }]
	},
	{
		"keys": ["enter"],
		"command": "commit_completion",
		"context": [
			{ "key": "auto_complete_visible" },
			{ "key": "setting.auto_complete_commit_on_tab", "operand": false },
			{ "key": "selector", "operator": "equal", "operand": "text.9o" }
		]
	},
	{
		"keys": ["ctrl+enter"],
		"command": "gs9o_insert_line",
		"context": [{ "key": "selector", "operator": "equal", "operand": "text.9o" }]
	},
	{
		"keys": ["ctrl+shift+enter"],
		"command": "gs9o_insert_line",
		"args": {"after": false},
		"context": [{ "key": "selector", "operator": "equal", "operand": "text.9o" }]
	},
	{
		"keys": ["up"],
		"command": "gs9o_move_hist",
		"args": {"up": true},
		"context": [
			{ "key": "selector", "operator": "equal", "operand": "prompt.9o" },
			{ "key": "auto_complete_visible", "operand": false }
		]
	},
	{
		"keys": ["down"],
		"command": "gs9o_move_hist",
		"args": {"up": false},
		"context": [
			{ "key": "selector", "operator": "equal", "operand": "prompt.9o" },
			{ "key": "auto_complete_visible", "operand": false }
		]
	}
]


// Copyright 2012-present Oliver Eilhard. All rights reserved.
// Use of this source code is governed by a MIT-license.
// See http://olivere.mit-license.org/license.txt for details.

package elastic

import (
	"encoding/json"
	"testing"
)

func TestTermSuggesterSource(t *testing.T) {
	s := NewTermSuggester("name").
		Text("n").
		Field("suggest")
	src, err := s.Source(true)
	if err != nil {
		t.Fatal