secret
Created

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
curl -XDELETE localhost:9200/test-idx
curl -XPUT localhost:9200/test-idx/doc/1 -d '{
"relatedSources": null,
"fetchTimeStamp": "12-08-2012 21:59:42",
"entityCount": 9,
"Categories": {
"Types": {
"Events": [
{
"DateEvent": [
{
"event": "Police said Sunday they approached Darrius Kennedy, 51, while he was smoking what appeared to be marijuana.",
"instance": [
{
"count": 1,
"event": "Police said Sunday they approached Darrius Kennedy, 51, while he was smoking what appeared to be marijuana."
}
]
},
{
"event": "Slideshow NEW YORK | Sun Aug 12, 2012 9:04pm IST NEW YORK (Reuters) - New York City Police shot and killed a knife-wielding suspect as he weaved through Saturday afternoon traffic and pedestrians in New York'\''s Times Square, authorities said.",
"instance": [
{
"count": 1,
"event": "Slideshow NEW YORK | Sun Aug 12, 2012 9:04pm IST NEW YORK (Reuters) - New York City Police shot and killed a knife-wielding suspect as he weaved through Saturday afternoon traffic and pedestrians in New York'\''s Times Square, authorities said."
}
]
}
],
"count": 5,
"event": "DateEvent"
},
{
"count": 2,
"event": "PersonEvent",
"PersonEvent": [
{
"event": "(Reporting By Edith Honan; Editing by Doina Chiacu)",
"instance": [
{
"count": 1,
"event": "(Reporting By Edith Honan; Editing by Doina Chiacu)"
}
]
},
{
"event": "\"He was ordered to put down the knife and he refused,\" said the spokesman, Martin Speechley.",
"instance": [
{
"count": 1,
"event": "\"He was ordered to put down the knife and he refused,\" said the spokesman, Martin Speechley." }
]
}
]
}
]
}
},
"Content": "<div id=\"ace-final-consolidated\"> <div algo-page-number=\"1\" class=\"algo-page-class\"> <span id=\"articleText\" algoscore=\"86.5\"><p>NEW YORK (Reuters) - New York City Police shot and killed a knife-wielding suspect as he weaved through Saturday afternoon traffic and pedestrians in New York'\''s Times Square, authorities said. Police said Sunday they approached Darrius Kennedy, 51,...</p><p>Images from across the country this week.&nbsp; Slideshow&nbsp;</p> <div id=\"articleInfo\" algoscore=\"4.0\"> <p algoscore=\"2.0\"> NEW YORK | Sun Aug 12, 2012 9:04pm IST </p> </div><span class=\"focusParagraph\" algoscore=\"19.0\"><p>NEW YORK (Reuters) - New York City Police shot and killed a knife-wielding suspect as he weaved through Saturday afternoon traffic and pedestrians in New York'\''s Times Square, authorities said.</p></span><p>Police said Sunday they approached Darrius Kennedy, 51, while he was smoking what appeared to be marijuana. He became agitated and confronted the officers with a knife, a police spokesman said.</p><p>&quot;He was ordered to put down the knife and he refused,&quot; said the spokesman, Martin Speechley.</p><p>He added that Kennedy was pepper-sprayed six times but did not respond. After he was again told to drop the knife, two officers fired on him, hitting him in the torso.</p><p>Kennedy was later pronounced dead at a hospital, the spokesman said.</p><p>The incident may stir additional controversy about the city'\''s so-called stop-and-frisk policies, which have been criticized as targeting racial minorities. Kennedy was black. (Reporting By Edith Honan; Editing by Doina Chiacu)</p></span> </div> </div>"
}'
curl -XPOST localhost:9200/test-idx/_refresh
curl localhost:9200/test-idx/_search -d '{
"query": {
"query_string": {
"query": "reporting",
"default_field": "Content"
}
},
"script_fields": {
"entity_facets": {
"script": "result=[];foreach(facet : _source.Categories.Types.Events) {if(facet.event==event) result.add(facet);} result",
"params": {
"event": "AnalystEvent"
}
}
}
}
 
'

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.