0
votes
QueryBuilder query = hasChildQuery(Province.CHILD_TYPE, QueryBuilders.termQuery("name", name.toLowerCase()), ScoreMode.None);
    List<Province> parents = operations.queryForList(new NativeSearchQuery(query), Province.class);
    return false;

I am using spring-data-elasticsearch. I don't know what class to import by resolving this method "hasChildQuery"? Anyone has encounter this kind of problem? This is my first time using spring-data-elasticsearch. @Mohsin Husen @Joanna

1

1 Answers

0
votes

Use:

QueryBuilder query = QueryBuilders.hasChildQuery(Province.CHILD_TYPE, QueryBuilders.termQuery("name", name.toLowerCase()), ScoreMode.None);

with following imports:

import org.elasticsearch.index.query.QueryBuilders;
import org.apache.lucene.search.join.ScoreMode;