Could you show us the full query you are sending to Elasticsearch? It's hard to comment on why you get the error without knowing the complete query you are running.
This is illegal syntax because you are trying to use multiple queries without telling Elasticsearch how to combine them. The query object is only allowed to contain one query, so to combine multiple queries together you need to use a bool query. This will allow you to specify how you want to combine the two queries.
If I understand what you want correct, then you want to only return documents that match the multi_match query but rank documents which don't have any value for field2 highest. In which case you need to have your multi_match query as a must clause (since a document must match this criteria to be returned) and the boosting query as a should clause (since you want documents without a field2 field to rank higher). If so, then try the following:
A note for anyone else having this issue: I also had to add a positive boosting, as only a negative boosting did not work, but I have it up and running now!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.