Skip to content

Commit d6258a9

Browse files
committed
feature: add finder by tags, and full text search
1 parent 25592b2 commit d6258a9

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/main/java/com/redis/om/skeleton/controllers/PeopleControllerV1.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,9 @@ Iterable<Person> byAnySkills(@RequestParam("skills") Set<String> skills) {
104104
Iterable<Person> byAllSkills(@RequestParam("skills") Set<String> skills) {
105105
return repo.findBySkillsContainingAll(skills);
106106
}
107+
108+
@GetMapping("search/{q}")
109+
Iterable<Person> fullTextSearch(@PathVariable("q") String q) {
110+
return repo.search(q);
111+
}
107112
}

src/main/java/com/redis/om/skeleton/repositories/PeopleRepository.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,7 @@ public interface PeopleRepository extends RedisDocumentRepository<Person, String
3232

3333
// Search Persons that have all of the skills (AND condition):
3434
Iterable<Person> findBySkillsContainingAll(Set<String> skills);
35+
36+
// Performing a text search on all text fields:
37+
Iterable<Person> search(String text);
3538
}

0 commit comments

Comments
 (0)