Skip to content

Instantly share code, notes, and snippets.

@Zorkin
Created December 13, 2010 17:59
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zorkin/739320 to your computer and use it in GitHub Desktop.
Save Zorkin/739320 to your computer and use it in GitHub Desktop.
a simple static html page to play with elastic search
<html>
<head>
<script type="text/javascript"
src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("jquery", "1.4.4");
google.setOnLoadCallback(function() {
$('#post').click(function() {
$.ajax({
url:$('#post_url').val(),
dataType:'json',
type:'POST',
data:$('#body').val().trim(),
success:function(data) {
console.log(JSON.stringify(data));
$('#jsonResult').html(JSON.stringify(data, null, '\t'));
},
error:function(xhr) {
console.log(arguments);
$('#jsonResult').html(JSON.stringify(xhr.responseText));
}
});
});
});
</script>
</head>
<body>
<input type="text" id="post_url" size="80" value="http://localhost:9200/_search"> <br/>
<textarea id="body" rows="20" cols="80">{query:{"match_all" : {}}}</textarea>
<input id='post' type="button" value="Go">
<pre id="jsonResult">
</pre>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment