Skip to content

Instantly share code, notes, and snippets.

@wflanagan
Created June 12, 2015 18:09
Show Gist options
  • Save wflanagan/15d18dd9da3b641746fb to your computer and use it in GitHub Desktop.
Save wflanagan/15d18dd9da3b641746fb to your computer and use it in GitHub Desktop.
Trying to query to remove documents with negative keywords in ElastIcSearch
Parse Failure [Failed to parse source [{\"query\":{\"filtered\":{\"query\":{\"bool\":{\"must\":[{\"match_all\":{}}],\"must_not\":[]}},\"filter\":{\"bool\":{\"must\":[{\"term\":{\"project_ids\":1022}},{\"terms\":{\"wordsmaster_id\":[18363,18662,18409,18016,18017,18038,18039,18041,18257,18258,18259,18260,18261,18262,18263,18264,18268,18267,18269,18272,18270,18273,18274,18275,18276,18277,18271,18641,18642,18643,18648,18649,18650,18651,18653,18656,18654,18657,18659,18652,18655,18661,18660,18658]}}],\"should\":[],\"must_not\":[{\"match\":{\"text\":[\"seo\",\"indian\"]}}]}}}},\"size\":10,\"from\":0,\"sort\":[{\"created_at\":\"desc\"}]}]]]; nested: QueryParsingException[[mentions_001] No filter registered for [match]]; }]","status":400}
"query"=>{
"filtered"=>{
"query"=>{
"bool"=>{
"must"=>[{"match_all"=>{}}],
"must_not" => []
}
},
"filter"=>{
"bool"=>{
"must"=>[{"term"=>{"project_ids"=>1022}}, {"terms"=>{"wordsmaster_id"=>[18363, 18662, 18409, 18016, 18017, 18038, 18039, 18041, 18257, 18258, 18259, 18260, 18261, 18262, 18263, 18264, 18268, 18267, 18269, 18272, 18270, 18273, 18274, 18275, 18276, 18277, 18271, 18641, 18642, 18643, 18648, 18649, 18650, 18651, 18653, 18656, 18654, 18657, 18659, 18652, 18655, 18661, 18660, 18658]}}],
"should"=>[],
"must_not"=>[{'match' => {'text' => ['seo', 'indian']}}]
}
}
}
},
"size"=>10,
"from"=>0,
"sort"=>[{"created_at"=>"desc"}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment