Feature/spline 1000 arango search#1029
Merged
Merged
Conversation
…ition to a place of usage
…ition to a place of usage
…ch' iterator function
cerveada
reviewed
Feb 21, 2022
| object StringEscapeUtils { | ||
| def escapeAQLSearch(str: String): String = str | ||
| .replaceAll("_", "\\\\\\\\_") | ||
| .replaceAll("%", "\\\\\\\\%") |
Contributor
There was a problem hiding this comment.
That is a lot of backslashes. Maybe Matcher.quoteReplacement could be used here as suggested in replaceAll docs. To make it more obvious what is happening.
Contributor
Author
There was a problem hiding this comment.
Not sure if this makes it more obvious :)
def escapeAQLSearch(str: String): String = {
str
.replaceAll("_", quoteReplacement(quoteReplacement("\\_")))
.replaceAll("%", quoteReplacement(quoteReplacement("\\%")))
}What about this then?
def escapeAQLSearch(str: String): String = {
str
.replaceAll("_", """\\\\_""")
.replaceAll("%", """\\\\%""")
}
Contributor
There was a problem hiding this comment.
What about this:
def escapeAQLSearch(str: String): String = {
str
.replace("_", """\\_""")
.replace("%", """\\%""")
}It seems to be dooing exactly what you want without the need for regexp replacement escaping.
Contributor
Author
There was a problem hiding this comment.
Lol I must be too enthusiastic about regexps 🤣
…rvice/repo/ExecutionProducerRepositoryImpl.scala Co-authored-by: Adam Cervenka <adam.cervenka@absa.africa>
|
Kudos, SonarCloud Quality Gate passed!
|
cerveada
approved these changes
Feb 22, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.








FILTER CONTAINS(...)with the ArangoSearch viewsdataSource.lastWriteDetailsproperty to substitute query time grouping with index time incremental update.progress.executionPlanDetailsinto a transaction.progress,dataSourceCollectionandoperationcollections.