Created
May 20, 2017 04:11
-
-
Save alfredfrancis/5c28bbb018693a206f4be3912611f037 to your computer and use it in GitHub Desktop.
Use jquery to insert and commit json document to solr
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
<!DOCTYPE html> | |
<svg width="960" height="500"></svg> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | |
<script> | |
$(document).ready(function() { | |
var jsonData = JSON.stringify([{ | |
"starttime": "2010-10-07T15:56:23.477Z", | |
"functionid": "476", | |
"userid": "roney" | |
}]); | |
$.ajax({ | |
type : "POST", | |
url : "http://127.0.0.1:8014/solr/usage_statistics/update/json", | |
data : { | |
"stream.body":jsonData | |
}, | |
dataType : "application/json", | |
complete : function(msg) { | |
console.log("finished"); | |
console.log(msg.responseText); | |
} | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment