我有一个看起来像这样的字符串查询
{"query":{"bool":{"should":[{"terms":{"user.id":[#users_to_follow],"minimum_match":1}},{"terms":{"tweets" :[#keywords_to_track],"minimum_match":1}}]}},"filter":{"range":{"publishedDate":{"from":#Unix_timestamp}}},"size":#sizelength}"
我正在尝试使用另一个字符串替换查询中的某些字符串:
query.replace("#users_to_follow",usersToFollow);
query.replace("#keywords_to_track", keyworsToTrack);
query.replace("#Unix_timestamp","1325930428000" );
query.replace("#sizelength",Integer.toString(SMLApplicationProperties.ES_RESULTSET_SIZE));
但是,当我运行这个东西时,它实际上并没有从查询中替换给定的字符串。