-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add regex operator to Atlas Search #1587
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of minor nits.
public RegexSearchOperator allowAnalyzedField(final boolean isAllowed) { | ||
return newWithAppendedValue("allowAnalyzedField", notNull("isAllowed", isAllowed)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public RegexSearchOperator allowAnalyzedField(final boolean isAllowed) { | |
return newWithAppendedValue("allowAnalyzedField", notNull("isAllowed", isAllowed)); | |
} | |
public RegexSearchOperator allowAnalyzedField(final boolean allowAnalyzedField) { | |
return newWithAppendedValue("allowAnalyzedField", allowAnalyzedField); | |
} |
Redundant null check. For naming, a similar method uses the same param name as the method itself:
public SearchOptions returnStoredSource(final boolean returnStoredSource) {
return newAppended("returnStoredSource", new BsonBoolean(returnStoredSource));
}
This can be changed in the interfaces as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.
/** | ||
* Creates a new {@link RegexSearchOperator} that uses allowAnalyzedField. | ||
* | ||
* @param isAllowed The boolean to run the query against an analyzed field. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param isAllowed The boolean to run the query against an analyzed field. | |
* @param isAllowed Must be set to true if the query is run against an analyzed field. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
driver-core/src/main/com/mongodb/client/model/search/RegexSearchOperator.java
Outdated
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ticket
JAVA-5726
Description
There are several Atlas Search query operators that are not implemented with first class support in the Java driver. This PR adds the
regex
operator to Atlas Search.Testing
./gradlew check
atlas-search-test
on EvergreenSearchOperatorTest