I tried to find an answer to my question but i couldn't find anything with my specific problem. When i try to do a simple text search on my collection with TextCriteria i have the error :
Query failed with error code 27 and error message 'text index required for $text query'
I know for sure it is a mongo error on my part but i am not able to solve the problem.
Sample of my collection implementation :
@Document(collection = "mission")
@Getter
@Setter
@JsonInclude(Include.NON_NULL)
public class Mission {
@Id
@JsonProperty("_id")
private String id;
@JsonProperty("secteur")
private String secteur;
@JsonProperty("client")
private String client;
@Field
@TextIndexed
@JsonProperty("poste")
private String poste;
@Field
@TextIndexed
@JsonProperty("competences")
private List<Competence> competences;
@Field
@TextIndexed
@JsonProperty("description")
private String description;
The method i use to retrieve my list :
@Override
public Collection<Mission> findAllByCriteria() {
return missionDao.findAllBy(TextCriteria.forDefaultLanguage().matchingAny("angular"));
}