2

The idea is to perform a query on everything that matches a basic query statement and return a facet count

The children matched of type page (child) and then the count of the book (parent). Use case of this would be to show X amount of books on Y amount of pages. These would then have seperates links, with additional queries etc.

I'm fresh out of the box with elasticsearch, very cool what I've got into so far, hit a brick wall with this, any help would be really useful.

Thank you for your time :)

{
  "query": {
  "has_child": {
    "type": "page",
    "query": {
      "filtered": {
        "query": {
          "query_string": {
            "default_field": "text",
            "query": "some example search query"
          }
        }
      }
    }
  },
  "facets": {},
  "sort": [
    "_score"
  ],
  "from": 0,
  "size": 10
  }
}

Yes, I've read the documentation on facets

3
  • I'm not really sure what question you're asking? Are you asking how to do faceting or are you doing faceting and having a problem with it? Mar 4, 2014 at 12:00
  • I've tried various things to try and count the matching children (the pages) which in turn return the has_child will return all the matching parents (the book) but I can't get it right.
    – RST
    Mar 6, 2014 at 9:28
  • Have you tried the suggestions here: groups.google.com/forum/#!topic/elasticsearch/Fzct-MdUtTw Mar 6, 2014 at 9:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.