Terms facet mistake or CKAN problem

What's wrong with this query?

{
"query":{
"match_all":{}
},
"facets":{
"temas":{
"terms":{ "field":"Tema" }
}
}
}

It's not working as expected.

The URL

http://thedatahub.org/api/data/4e256209-7e2d-4481-9627-da73e191baf2/_search?pretty=true&source={"query":{"match_all":{}},"facets":{"temas":{"terms":{"field":"Tema"}}}

returns:

{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 308,
"max_score" : 1.0,
"hits" : [ {
"_index" : "ckan-www.ckan.net",
"_type" : "4e256209-7e2d-4481-9627-da73e191baf2",
"_id" : "4",
"_score" : 1.0, "_source" : {"Identificador": "1- Matriz de Responsabilidade", "Referencia": "RN-A.03/03", "observacao-cronograma": "", "Etapa": "3. Obras", "Investimento-Previsto-para-a-Etapa": "12,10000000", "Investimento-Executado-para-a-Etapa": "0,00000000", "Cidade-Sede": "Natal RN", "Responsabilidade-pela-Execucao": "Governo Estadual", "Previsao-de-Conclusao": "Mar/14", "Inicio-Efetivo": "-", "observacao-investimento": "", "Caminho": "natal/mobilidade-urbana/acesso-novo-aeroporto/", "Investimento-Contratado-para-a-Etapa": "0,00000000", "Responsabilidade-pelos-Recursos": "Governo Federal (Financiamento CAIXA)", "Identificacao": "RN-A.03", "Tema": "Mobilidade Urbana", "origem-dos-dados": "Min. Esporte", "Empreendimento/Acao": "Acesso ao Novo Aeroporto de SGono do Amarante", "Previsao-de-Inicio": "Jun/12", "Atualizado-em": "17/04/12", "Conclusao-Efetiva": "-"}
},

....

}

thanks

Where is the error in the output? Is the Tema field analyzed?

2012/5/17 Alexandre Gomes alegomes@gmail.com:

What's wrong with this query?

{
"query":{
"match_all":{}
},
"facets":{
"temas":{
"terms":{ "field":"Tema" }
}
}
}

It's not working as expected.

The URL

http://thedatahub.org/api/data/4e256209-7e2d-4481-9627-da73e191baf2/_search?pretty=true&source={"query":{"match_all":{}},"facets":{"temas":{"terms":{"field":"Tema"}}}

returns:

{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 308,
"max_score" : 1.0,
"hits" : [ {
"_index" : "ckan-www.ckan.net",
"_type" : "4e256209-7e2d-4481-9627-da73e191baf2",
"_id" : "4",
"_score" : 1.0, "_source" : {"Identificador": "1- Matriz de
Responsabilidade", "Referencia": "RN-A.03/03", "observacao-cronograma": "",
"Etapa": "3. Obras", "Investimento-Previsto-para-a-Etapa": "12,10000000",
"Investimento-Executado-para-a-Etapa": "0,00000000", "Cidade-Sede": "Natal
RN", "Responsabilidade-pela-Execucao": "Governo Estadual",
"Previsao-de-Conclusao": "Mar/14", "Inicio-Efetivo": "-",
"observacao-investimento": "", "Caminho":
"natal/mobilidade-urbana/acesso-novo-aeroporto/",
"Investimento-Contratado-para-a-Etapa": "0,00000000",
"Responsabilidade-pelos-Recursos": "Governo Federal (Financiamento CAIXA)",
"Identificacao": "RN-A.03", "Tema": "Mobilidade Urbana", "origem-dos-dados":
"Min. Esporte", "Empreendimento/Acao": "Acesso ao Novo Aeroporto de SGono do
Amarante", "Previsao-de-Inicio": "Jun/12", "Atualizado-em": "17/04/12",
"Conclusao-Efetiva": "-"}
},

....

}

thanks

I thinks it's supposed to return "facets" instead of "terms", isn't it?

{
"took" : 2,
"hits" : {
"total" : 4,
...
},
"facets" : {
"tags" : {
"_type" : "terms",
"missing" : 1,
"terms" : [
...
]
}
}
}

s!

2012/5/18 Ivan Brusic ivan@brusic.com

Where is the error in the output? Is the Tema field analyzed?

2012/5/17 Alexandre Gomes alegomes@gmail.com:

What's wrong with this query?

{
"query":{
"match_all":{}
},
"facets":{
"temas":{
"terms":{ "field":"Tema" }
}
}
}

It's not working as expected.

The URL

http://thedatahub.org/api/data/4e256209-7e2d-4481-9627-da73e191baf2/_search?pretty=true&source={
"query":{"match_all":{}},"facets":{"temas":{"terms":{"field":"Tema"}}}

returns:

{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 308,
"max_score" : 1.0,
"hits" : [ {
"_index" : "ckan-www.ckan.net",
"_type" : "4e256209-7e2d-4481-9627-da73e191baf2",
"_id" : "4",
"_score" : 1.0, "_source" : {"Identificador": "1- Matriz de
Responsabilidade", "Referencia": "RN-A.03/03", "observacao-cronograma":
"",
"Etapa": "3. Obras", "Investimento-Previsto-para-a-Etapa": "12,10000000",
"Investimento-Executado-para-a-Etapa": "0,00000000", "Cidade-Sede":
"Natal
RN", "Responsabilidade-pela-Execucao": "Governo Estadual",
"Previsao-de-Conclusao": "Mar/14", "Inicio-Efetivo": "-",
"observacao-investimento": "", "Caminho":
"natal/mobilidade-urbana/acesso-novo-aeroporto/",
"Investimento-Contratado-para-a-Etapa": "0,00000000",
"Responsabilidade-pelos-Recursos": "Governo Federal (Financiamento
CAIXA)",
"Identificacao": "RN-A.03", "Tema": "Mobilidade Urbana",
"origem-dos-dados":
"Min. Esporte", "Empreendimento/Acao": "Acesso ao Novo Aeroporto de
SGono do
Amarante", "Previsao-de-Inicio": "Jun/12", "Atualizado-em": "17/04/12",
"Conclusao-Efetiva": "-"}
},

....

}

thanks