ElasticsearchParseException: Failed to derive xcontent

1925 단어 자바elasticsearch
When you come across with this Exception. If you use spring-boot-starter-data-elasticsearch or spring-data-elasticsearch , it means that you have an error in your query string. Below is my wrong expression.
@Query("\"multi_match\" : { \"query\" : \"?0\", \"fields\": [\"name^20\", \"cnName^10\", \"enName^10\", \"alias\"], \"type\": \"phrase\", \"slop\": 0}")
public List<TengXunActorElasticsearch> findByName(String str);

The correct one:
@Query("{\"multi_match\" : { \"query\" : \"?0\", \"fields\": [\"name^20\", \"cnName^10\", \"enName^10\", \"alias\"], \"type\": \"phrase\", \"slop\": 0}}")
public List<TengXunActorElasticsearch> findByName(String str);

Please check it carefully.

좋은 웹페이지 즐겨찾기