[ckan-discuss] Terms Facet

Alexandre Gomes alegomes at gmail.com
Wed May 23 00:26:40 BST 2012


Hi!

Can you, please, tell me what's wrong with this?

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

According to [1], it's supposed to return something like

"facets" : {
  "temas" : {
    "_type" : "terms",
    "missing" : 0,
    "total": 99,
    "other": 0,
    "terms" : [ ... ]
  }
}

but it's returning hits instead of facets.

{
  "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": "-"}
    }

...

}


[1]
http://www.elasticsearch.org/guide/reference/api/search/facets/terms-facet.html

[]s!


On Wed, May 16, 2012 at 8:44 AM, Mark Wainwright
<mark.wainwright at okfn.org>wrote:

> For those that have missed it, CKAN 1.7 was released last week,
> including the new DataStore for storing structured data and a
> much-improved data viewer, Atom feeds, site analytics and much more.
> Read about it on the blog:
>
> http://ckan.org/2012/05/14/ckan-1-7/
>
> The data viewer can preview your raw data, sort it, plot it on a graph
> or interactive map, and display images - considerably enhancing
> locally-stored data. You can read in more detail about it here:
>
> http://ckan.org/2012/05/16/exploring-data-from-ckan/
>
> As ever, thanks to the many users whose feedback, comments and code
> contributions have helped!
>
> Mark
>
>
> --
> Mark Wainwright, CKAN Community Co-ordinator
> Open Knowledge Foundation http://okfn.org/
> Skype: m.wainwright
>
> _______________________________________________
> ckan-discuss mailing list
> ckan-discuss at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-discuss/attachments/20120522/4eefe7c5/attachment.htm>


More information about the ckan-discuss mailing list