使用三引号:
val query = """{"query": { "filtered": { "query": { "query_string": { "default_operator": "AND", "query": "director.name:DAVID + n movie.name:SEVEN" } }, "filter": { "nested": { "path": "movieStatus.boxoffice.status", "query": { "bool": { "must": [ { "match": { "movieStatus.boxoffice.status.rating": "A" } }, { "match": { "movieStatus.boxoffice.status.oscar": "false" } } ] } } } } } }}"""val elasticRdds = sparkContext.esJsonRDD(esIndex, query)


