$("#search_histogram").html("Searching for matching WOS data...")
varargs={
// the_queries is an array of str
"q":the_queries,
...
...
@@ -18,7 +18,7 @@ function search_proposed_terms_and_draw( the_queries ) {
"until":2013
}
vardocs_years=[];
$("#search_histogram")
.html('<p class="micromessage">Waiting for histogram data</p>')
...
...
@@ -28,12 +28,12 @@ function search_proposed_terms_and_draw( the_queries ) {
data:args,
dataType:"json",
success:function(data,textStatus,jqXHR){
// ES aggs response, for example
// ES aggs response, for example
// data = {"took":91,"total":121673,"aggs":{"publicationCount":{"buckets":[{"key":1989,"doc_count":880},{"key":1990,"doc_count":1088},...,{"key":2012,"doc_count":9543},{"key":2013,"doc_count":8832}]}},"hits":{"total":121673,"max_score":0,"hits":[]}}
// console.log(">> incoming api data <<")
// console.log(data)
if(data.total==0){
returnfalse;
}
...
...
@@ -42,7 +42,7 @@ function search_proposed_terms_and_draw( the_queries ) {
varelem=data.aggs.publicationCount.buckets[i]
docs_years.push([elem.key+"",elem.doc_count])
}
// counts_by_year_array
draw_histogram(docs_years,"search_histogram");
returntrue;
...
...
@@ -50,7 +50,7 @@ function search_proposed_terms_and_draw( the_queries ) {