Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ============CHAMADA QUERY=========
- GET /accounts/_doc/_search
- {
- "query" : {
- "match" : {
- "job_description" : "analista"
- }
- },
- "aggregations" : {
- "age" : {
- "range" : {
- "field" : "age",
- "ranges" : [
- {
- "key" : "0-9",
- "from" : 0,
- "to" : 9
- },
- {
- "key" : "18-25",
- "from" : 18,
- "to" : 25
- },
- {
- "key" : "26-30",
- "from" : 26,
- "to" : 30
- },
- {
- "key" : "31-35",
- "from" : 31,
- "to" : 35
- },
- {
- "key" : "36-40",
- "from" : 36,
- "to" : 40
- }
- ]
- }
- }
- }
- }
- ============RETORNO QUERY=========
- {
- "took" : 6,
- "timed_out" : false,
- "_shards" : {
- "total" : 5,
- "successful" : 5,
- "skipped" : 0,
- "failed" : 0
- },
- "hits" : {
- "total" : 6,
- "max_score" : 0.80259144,
- "hits" : [
- {
- "_index" : "accounts",
- "_type" : "_doc",
- "_id" : "7",
- "_score" : 0.80259144,
- "_source" : {
- "name" : "Renato",
- "lastname" : "Santos de Souza",
- "job_description" : "Analista",
- "age" : 32
- }
- },
- {
- "_index" : "accounts",
- "_type" : "_doc",
- "_id" : "HrRCSWkBGSMNuB0loAro",
- "_score" : 0.21110918,
- "_source" : {
- "name" : "Renato",
- "lastname" : "Souza",
- "job_description" : "Analista de Software JR2"
- }
- },
- {
- "_index" : "accounts",
- "_type" : "_doc",
- "_id" : "6",
- "_score" : 0.19263543,
- "_source" : {
- "name" : "Renato",
- "lastname" : "Santos de Souza",
- "job_description" : "Analista",
- "age" : 5
- }
- },
- {
- "_index" : "accounts",
- "_type" : "_doc",
- "_id" : "3",
- "_score" : 0.16044298,
- "_source" : {
- "name" : "Lucas",
- "lastname" : "Santos de Souza",
- "job_description" : "Analista de testes e gerente internod e projetos",
- "age" : 35
- }
- },
- {
- "_index" : "accounts",
- "_type" : "_doc",
- "_id" : "2",
- "_score" : 0.12114187,
- "_source" : {
- "name" : "Priscila",
- "lastname" : "Santos de Souza",
- "job_description" : "Analista de Produtos e negócios",
- "age" : 20
- }
- },
- {
- "_index" : "accounts",
- "_type" : "_doc",
- "_id" : "4",
- "_score" : 0.11085624,
- "_source" : {
- "name" : "Renato",
- "lastname" : "Santos de Souza",
- "job_description" : "Analista UX e Gerente de Infraestrutura",
- "age" : 2
- }
- }
- ]
- },
- "aggregations" : {
- "age" : {
- "buckets" : [
- {
- "key" : "0-9",
- "from" : 0.0,
- "to" : 9.0,
- "doc_count" : 2
- },
- {
- "key" : "18-25",
- "from" : 18.0,
- "to" : 25.0,
- "doc_count" : 1
- },
- {
- "key" : "26-30",
- "from" : 26.0,
- "to" : 30.0,
- "doc_count" : 0
- },
- {
- "key" : "31-35",
- "from" : 31.0,
- "to" : 35.0,
- "doc_count" : 1
- },
- {
- "key" : "36-40",
- "from" : 36.0,
- "to" : 40.0,
- "doc_count" : 0
- }
- ]
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement