Created
December 13, 2010 17:59
-
-
Save Zorkin/739320 to your computer and use it in GitHub Desktop.
a simple static html page to play with elastic search
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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