[ckan-discuss] Terms Facet

David Raznick kindly at gmail.com
Wed May 23 01:06:24 BST 2012


On Wed, May 23, 2012 at 12:26 AM, Alexandre Gomes <alegomes at gmail.com>wrote:

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

That is correct.  The facets are also in the result json along with the
hits.  Its a big json so you may have missed it.   I get the below with the
 above query.

Thanks

David


facets": {

   - "temas": {
      - "_type": "terms",
      - "missing": 0,
      - "total": 490,
      - "other": 0,
      - "terms": [
         - {
            - "term": "urbana",
            - "count": 147
         },
         - {
            - "term": "mobilidade",
            - "count": 147
         },
         - {
            - "term": "aeroportos",
            - "count": 49
         },
         - {
            - "term": "seguranpa",
            - "count": 42
         },
         - {
            - "term": "esto",
            - "count": 35
         },
         - {
            - "term": "arena",
            - "count": 35
         },
         - {
            - "term": "portos",
            - "count": 18
         },
         - {
            - "term": "hotelaria",
            - "count": 9
         },
         - {
            - "term": "telecomunicas",
            - "count": 8
         }
      ]
   }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-discuss/attachments/20120523/76d68597/attachment.htm>


More information about the ckan-discuss mailing list