There are several Atlas Search query operators that are not implemented with first class support in the Java driver. For example, the `phrase` operator. Ideally it could work like this:
Bson search_stage = search( SearchOperator.compound() .filter(Arrays.asList(SearchOperator.text(fieldPath("genres"), "Drama"))) .must(Arrays.asList(SearchOperator.phrase(fieldPath("cast"), "keanu reeves"))) );
Whereas right now, one must know the JSON structure of the operator syntax and use the `.of()` escape hatch like this:
Bson search_stage = search( SearchOperator.compound() .filter(Arrays.asList(SearchOperator.text(fieldPath("genres"), "Drama"))) .must(Arrays.asList(SearchOperator.of(new Document("phrase", new Document("query", "keanu reeves").append("path", fieldPath("cast")))))) );
https://www.mongodb.com/docs/atlas/atlas-search/operators-and-collectors/
1.
|
Add phrase operator | JAVA-5724 | Closed | Joy Kim | 5.4.0 | |
2.
|
Add regex operator | JAVA-5726 | Closed | Joy Kim | 5.4.0 | |
3.
|
Add queryString operator | JAVA-5727 | Closed | Joy Kim | 5.4.0 | |
4.
|
Add equals operator | JAVA-5729 | Closed | Maxim Katcharov | ||
5.
|
Add moreLikeThis operator | JAVA-5740 | Closed | Joy Kim | 5.4.0 | |
6.
|
Add embeddedDocument operator | JAVA-5741 | Backlog | Unassigned | ||
7.
|
Add geoShape operator | JAVA-5742 | Backlog | Unassigned | ||
8.
|
Add geoWithin operator | JAVA-5743 | Backlog | Unassigned | ||
9.
|
Add in operator | JAVA-5744 | In Code Review | Maxim Katcharov | ||
10.
|
Add wildcard operator | JAVA-5745 | Closed | Joy Kim | 5.4.0 | |
11.
|
Test untested operators | JAVA-5771 | In Code Review | Maxim Katcharov |