ssq_analyzer is a set of The double chromosphere prediction tools. It consists mainly of two parts:
first part
Crawl the required historical data from the official website, then stored in excel format.
second part
generate a bulk json file(to put those data into our elasticsearch cluster ) by parsing the stored file.
finnaly, we need up and running our es cluster, index the historical data, and get the prediction by aggregations.
index mapping
PUT /kjxx
{
"mappings": {
"properties": {
"code": { "type": "long" },
"red": { "type": "integer" },
"blue": { "type": "integer" }
}
}
}
index data
curl -H "Content-Type: application/json" -XPOST "localhost:9200/kjxx/_bulk?pretty&refresh" --data-binary "@xxx.json"
aggregations
POST kjxx/_search?size=0
{
"aggs":{
"blues":{
"terms":{
"field": "blue"
}
}
}
}