task(34647) ContentletFactory migration to OS#34691
task(34647) ContentletFactory migration to OS#34691fabrizzio-dotCMS wants to merge 24 commits intomainfrom
Conversation
…github.com/dotCMS/core into issue-34647-ContentletFactory-OS-Migration
…github.com/dotCMS/core into issue-34647-ContentletFactory-OS-Migration
| } | ||
|
|
||
| // Use a large limit to simulate scroll behavior | ||
| final int maxResults = 10000; // Consider making this configurable |
There was a problem hiding this comment.
The entire point of scroll is to handle datasets larger than the result window. Loading 10k results in one shot defeats this. This isn't a stub it's a working-ish
implementation that will fail silently for datasets > 10k. Should either truly implement OS Scroll API (using scroll_id / PIT) or throw UnsupportedOperationException
like createScrollQuery does, so callers know it's not ready. I am OK if we intend to come back to this shortly, just concerned leaving it like this for production and potentially causing memory issues down the line.
There was a problem hiding this comment.
I already have another PR with the scroll API implementation. I did not include it here to keep it from being too large.
|
|
||
| // Set timeout | ||
| //Time.of(t -> t.time(String.valueOf(INDEX_OPERATIONS_TIMEOUT_IN_MS) + "ms")) | ||
| searchRequestBuilder.timeout(""); |
There was a problem hiding this comment.
Is this going to break, or have no timout are we sure this does not error, or if not set will it leave all OS queries unprotected against runaway searches.
There was a problem hiding this comment.
Yeah, I generated these, and the moment I was going to write a test, I realized I couldn't because I didn't have any mapping in place. The OS index at this point isn't writable. I have to come back full circle on these, adding some testing (which I totally plan to do), but as an initial PR, the refactoring served its purpose.
Nice catch!
dotCMS/src/main/java/com/dotcms/content/index/opensearch/ContentFactoryIndexOperationsOS.java
Show resolved
Hide resolved
dotCMS/src/main/java/com/dotcms/content/index/ContentFactoryIndexOperationsOS.java
Outdated
Show resolved
Hide resolved
...src/main/java/com/dotcms/content/elasticsearch/business/ContentFactoryIndexOperationsES.java
Outdated
Show resolved
Hide resolved
dotCMS/src/main/java/com/dotcms/content/elasticsearch/business/TranslatedQuery.java
Outdated
Show resolved
Hide resolved
dotCMS/src/main/java/com/dotcms/content/elasticsearch/business/TranslatedQuery.java
Outdated
Show resolved
Hide resolved
dotCMS/src/main/java/com/dotcms/content/elasticsearch/business/TranslatedQuery.java
Outdated
Show resolved
Hide resolved
dotCMS/src/main/java/com/dotcms/content/elasticsearch/business/TranslatedQuery.java
Outdated
Show resolved
Hide resolved
dotCMS/src/main/java/com/dotcms/content/elasticsearch/business/TranslatedQuery.java
Outdated
Show resolved
Hide resolved
…github.com/dotCMS/core into issue-34647-ContentletFactory-OS-Migration
| import org.elasticsearch.search.sort.SortOrder; | ||
| import org.jetbrains.annotations.NotNull; | ||
|
|
||
| public class ContentFactoryIndexOperationsES implements ContentFactoryIndexOperations { |
There was a problem hiding this comment.
Some javadoc would be helpful
Proposed Changes
🔧 Refactor: Separate Index Operations and Add OpenSearch Migration Foundation
Summary
This PR introduces a major architectural refactoring to separate index operations from the main content factory implementation and establishes the foundation for OpenSearch migration. This represents the beginning of a clean separation
of concerns between content management and search engine operations.
🚀 Key Changes
🔄 Architecture Benefits
Before:
ESContentFactoryImpl ──> Elasticsearch APIs (tightly coupled)
After:
ContentFactory ──> ContentFactoryIndexOperations (interface)
├── ContentFactoryIndexOperationsES
└── ContentFactoryIndexOperationsOS
Incomplete Features:
Planned Next Steps:
🏗️ Architectural Impact
Separation of Concerns:
Future Migration Benefits:
📋 Testing Status
This PR fixes: #34647