Search code examples
javaspring-bootelasticsearchspring-data-jpaspring-data-elasticsearch

FindAllByColumn(List<String> columnValues) in ElasticsearchRepository is not working


I have SpringBoot connected to my elastic search running under docker. In ElasticsearchRepository

  • findAllById(Iterable<BigInteger> ids) is working fine

  • findBySicCode(String sicCode) and findAllBySicCode(string sicCode) working fine

    But when i try

  • findAllBySicCode(List<String> sicCodes) is giving me QueryShardException[Failed to parse query] parse_exception: Cannot parse '[13201]': Encountered " "]" "] "" at line 1, column 6.

Here 13201 i was passing in the list.

Not able to understand something wrong with ES Index or with my code


Solution

  • Try, findAllBySicCodeIn(List<String> sicCodes)

    Here is a nice documentation about https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#jpa.query-methods.query-creation