Skip to content

OAK-11555 Elastic: support dot in property and function names#2145

Merged
thomasmueller merged 8 commits intotrunkfrom
OAK-11555
Mar 13, 2025
Merged

OAK-11555 Elastic: support dot in property and function names#2145
thomasmueller merged 8 commits intotrunkfrom
OAK-11555

Conversation

@thomasmueller
Copy link
Member

@thomasmueller thomasmueller commented Mar 6, 2025

This is longer than expected. The problem is that there was no conversion function from "JCR property name" to "Elasticsearch field name" so far, so I had to add it everywhere. That also affects tests etc.

Side node: ElasticIndexUtilsTest: I also added unit tests of the existing functions. I find it really weird that we convert randomly distributed bytes to a string like so:

new String(<byte array with completely random values>)

... and then use that as the String value for "_id" field in Elasticsearch. But... (a) changing it would introduce incompatibility, and (b) it seems to work.

How I tested: I changed the ElasticIndexUtils.fieldName method to return "X" + the actual result, and like this could find other places where the method is needed.

I added a method to undo (revert / unescape) the conversion, so that we can verify it is always possible to do so. Even thought, right now it is not needed.

@github-actions
Copy link

github-actions bot commented Mar 6, 2025

Commit-Check ✔️

@sonarqubecloud
Copy link

Copy link
Contributor

@nfsantos nfsantos left a comment

Choose a reason for hiding this comment

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

Seems correct, I just have a few suggestions for optimization.

@thomasmueller thomasmueller merged commit 22fc672 into trunk Mar 13, 2025
2 of 4 checks passed
daniancu pushed a commit to daniancu/jackrabbit-oak that referenced this pull request Mar 13, 2025
…#2145)

* OAK-11555 Elastic: support dot in property and function names

* OAK-11555 Elastic: support dot in property and function names

* OAK-11555 Elastic: support dot in property and function names

* Update oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/util/ElasticIndexUtils.java

Co-authored-by: Nuno Santos <nsantos@adobe.com>

* OAK-11555 Elastic: support dot in property and function names

* OAK-11555 Elastic: support dot in property and function names

* OAK-11555 Elastic: support dot in property and function names

* OAK-11555 Elastic: support dot in property and function names

---------

Co-authored-by: Nuno Santos <nsantos@adobe.com>
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.

5 participants