Skip to content

Instantly share code, notes, and snippets.

@frazerh
Created April 13, 2011 01:06
Show Gist options
  • Save frazerh/916775 to your computer and use it in GitHub Desktop.
Save frazerh/916775 to your computer and use it in GitHub Desktop.
typical search on search 3/4
curl -XGET 'http://localhost:9200/ticket_customers/ticket_customer/_search?pretty=true' -d '
{
"sort":
[
"_score"
],
"query":
{
"bool":
{
"minimum_number_should_match":1,
"must":
[
{
"term":
{
"site_id":14
}
}
],
"should":
[
{
"query_string":
{
"query":"apple"
}
},
{
"has_child":
{
"type":"email",
"query":
{
"query_string":
{
"query":"email:apple"
}
}
}
},
{
"has_child":
{
"type":"ticket_note",
"query":
{
"query_string":
{
"query":"ticket_notes:apple"
}
}
}
},
{
"has_child":
{
"type":"chat_message",
"query":
{
"query_string":
{
"query":"content:apple"
}
}
}
},
{
"has_child":
{
"type":"facebook_feed_item",
"query":
{
"query_string":
{
"query":"content:apple"
}
}
}
},
{
"has_child":
{
"type":"phone",
"query":
{
"query_string":
{
"query":"content:apple"
}
}
}
},
{
"has_child":
{
"type":"qna",
"query":
{
"query_string":
{
"query":"content:apple"
}
}
}
},
{
"has_child":
{
"type":"ticket_attachment",
"query":
{
"query_string":
{
"query":"ticket_attachments:apple"
}
}
}
},
{
"has_child":
{
"type":"tweet",
"query":
{
"query_string":
{
"query":"content:apple"
}
}
}
},
{
"has_child":
{
"type":"web_callback",
"query":
{
"query_string":
{
"query":"content:apple"
}
}
}
}
]
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment