You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "fabriziofortino (via GitHub)" <gi...@apache.org> on 2024/02/26 15:14:13 UTC
[PR] OAK-10672: move internal index version in oak-search [jackrabbit-oak]
fabriziofortino opened a new pull request, #1327:
URL: https://github.com/apache/jackrabbit-oak/pull/1327
Some indexes, like elasticsearch have a concept of an internal version (or mapping version) to handle breaking changes. This information is sometimes needed from external tools that do not have access to the specific index module. For this reason, the version information has been moved to oak-search.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-10672: move internal index version in oak-search [jackrabbit-oak]
Posted by "fabriziofortino (via GitHub)" <gi...@apache.org>.
fabriziofortino commented on code in PR #1327:
URL: https://github.com/apache/jackrabbit-oak/pull/1327#discussion_r1504204826
##########
oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/FulltextIndexConstants.java:
##########
@@ -436,4 +437,12 @@ public static IndexingMode from(String indexingMode) {
* Boolean property indicating if in-built analyzer should preserve original term
*/
String INDEX_ORIGINAL_TERM = "indexOriginalTerm";
+
+ /**
+ * Internal version of the index definition for specific index type. Index version is an information that might be
+ * needed from an outside process that does not have visibility to the specific index module.
+ */
+ Map<String, String> INDEX_VERSION_BY_TYPE = Map.of(
+ "elasticsearch", "1.1.0"
Review Comment:
I prefer to not do that (at least in this PR) since moving the Elastic index type in oak-search would require a big refactoring (I see 32 references). Moreover, we should deprecate it first and remove it in a future version.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-10672: move internal index version in oak-search [jackrabbit-oak]
Posted by "fabriziofortino (via GitHub)" <gi...@apache.org>.
fabriziofortino merged PR #1327:
URL: https://github.com/apache/jackrabbit-oak/pull/1327
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-10672: move internal index version in oak-search [jackrabbit-oak]
Posted by "nfsantos (via GitHub)" <gi...@apache.org>.
nfsantos commented on code in PR #1327:
URL: https://github.com/apache/jackrabbit-oak/pull/1327#discussion_r1503753351
##########
oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/FulltextIndexConstants.java:
##########
@@ -436,4 +437,12 @@ public static IndexingMode from(String indexingMode) {
* Boolean property indicating if in-built analyzer should preserve original term
*/
String INDEX_ORIGINAL_TERM = "indexOriginalTerm";
+
+ /**
+ * Internal version of the index definition for specific index type. Index version is an information that might be
+ * needed from an outside process that does not have visibility to the specific index module.
+ */
+ Map<String, String> INDEX_VERSION_BY_TYPE = Map.of(
+ "elasticsearch", "1.1.0"
Review Comment:
Here we are using an hardcoded string, but there is already a constant defined for this String in ElasticIndexDefinition. Since we are anyway exposing in oak-search the index type of Elastic, I think it would be better to move that constant somewhere to the oak-search module and use it here as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-10672: move internal index version in oak-search [jackrabbit-oak]
Posted by "steffenvan (via GitHub)" <gi...@apache.org>.
steffenvan commented on code in PR #1327:
URL: https://github.com/apache/jackrabbit-oak/pull/1327#discussion_r1503743424
##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexHelper.java:
##########
@@ -52,8 +53,12 @@ class ElasticIndexHelper {
* Changes not breaking compatibility should increment the minor version (old queries still work, but they might not
* use the new feature).
* Changes that do not affect queries should increment the patch version (eg: bug fixes).
+ * <p>
+ * WARN: Since this information might be needed from external tools that don't have a direct dependency on this module, the
+ * actual version needs to be set in oak-search.
*/
- protected static final String MAPPING_VERSION = "1.1.0";
+ protected static final String MAPPING_VERSION = FulltextIndexConstants.INDEX_VERSION_BY_TYPE.
Review Comment:
Hmm I'm wondering why the default one is `1.0.0` instead of `1.1.0`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-10672: move internal index version in oak-search [jackrabbit-oak]
Posted by "fabriziofortino (via GitHub)" <gi...@apache.org>.
fabriziofortino commented on code in PR #1327:
URL: https://github.com/apache/jackrabbit-oak/pull/1327#discussion_r1504202939
##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexHelper.java:
##########
@@ -52,8 +53,12 @@ class ElasticIndexHelper {
* Changes not breaking compatibility should increment the minor version (old queries still work, but they might not
* use the new feature).
* Changes that do not affect queries should increment the patch version (eg: bug fixes).
+ * <p>
+ * WARN: Since this information might be needed from external tools that don't have a direct dependency on this module, the
+ * actual version needs to be set in oak-search.
*/
- protected static final String MAPPING_VERSION = "1.1.0";
+ protected static final String MAPPING_VERSION = FulltextIndexConstants.INDEX_VERSION_BY_TYPE.
Review Comment:
`1.1.0` is the current version. It does not make sense to have a default version since the version has to always be defined. It can only be null in case oak-search points to some old version. I have changed the code to handle this case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org