有没有办法让elastic4s允许我构建这个搜索请求:
{
"size" : 100,
"query" : {
"bool" : {
"must" : {
"term" : {
"disabled" : false
}
}
}
},
"gas-filter" : {
"name" : "SearchResultCypherFilter",
"query" : "MATCH (a)-[:KNOWS*]->(d{referenceId:'522d8b956819338605a53948c5dcef1a'}) RETURN distinct a.referenceId as guid",
"exclude" : true
}
}
答案 0 :(得分:0)
elastic4s版本2.3.1及更高版本允许您添加额外的源Json
search in "maalka" bool matchAllQuery limit 10 extraSource Json.stringify(Json.obj(
"gas-filter" -> Json.obj(
"name" -> "SearchResultCypherFilter",
"query" -> "MATCH (a)-[:KNOWS*]->(d{referenceId:'522d8b956819338605a53948c5dcef1a'}) RETURN distinct a.referenceId as guid",
"exclude" -> true)
))