Answer the question
In order to leave comments, you need to log in
How to do a fulltext search on a DbObject?
repository
@Query("{ $text : {$search : ?0}}")
List<CvRecord> findLikeKeywords(String regexp);
List<CvRecord> findAllBy(TextCriteria criteria);
@TextIndexed private final static String DOC_ID_KEY = "doc_id";
@Id
private String id;
@Indexed(name = "doc_id", unique = true)
private String docId;
@TextIndexed private BasicDBObject dbObject;
@TextIndexed private String privet = "bla test";
TextCriteria criteria = TextCriteria.forDefaultLanguage().matchingAny("test", "java", "сгу");
List<CvRecord> result = repository.findAllBy(criteria);
List<CvRecord> result1 = repository.findLikeKeywords("test");
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question