Skip to content

Feature/spline 1000 arango search#1029

Merged
wajda merged 14 commits into
developfrom
feature/spline-1000-arangoSearch
Feb 22, 2022
Merged

Feature/spline 1000 arango search#1029
wajda merged 14 commits into
developfrom
feature/spline-1000-arangoSearch

Conversation

@wajda
Copy link
Copy Markdown
Contributor

@wajda wajda commented Feb 18, 2022

  • For text lookups, replace AQL FILTER CONTAINS(...) with the ArangoSearch views
  • Add dataSource.lastWriteDetails property to substitute query time grouping with index time incremental update.
  • Move code populating progress.executionPlanDetails into a transaction.
  • Removed unused persistent indices from the progress, dataSourceCollection and operation collections.
  • Updated database migration script accordingly

@wajda wajda marked this pull request as ready for review February 18, 2022 22:53
@wajda wajda requested a review from cerveada as a code owner February 18, 2022 22:53
object StringEscapeUtils {
def escapeAQLSearch(str: String): String = str
.replaceAll("_", "\\\\\\\\_")
.replaceAll("%", "\\\\\\\\%")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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("%", """\\\\%""")
  }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol I must be too enthusiastic about regexps 🤣

wajda and others added 2 commits February 21, 2022 17:26
…rvice/repo/ExecutionProducerRepositoryImpl.scala

Co-authored-by: Adam Cervenka <adam.cervenka@absa.africa>
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@wajda wajda merged commit 0f2e53c into develop Feb 22, 2022
@wajda wajda deleted the feature/spline-1000-arangoSearch branch February 22, 2022 10:51
@wajda wajda linked an issue Apr 8, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consumer API :: Improve search performance

2 participants