-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
203 additions
and
175 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,18 +15,18 @@ jobs: | |
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
django-version: ["3.2", "4.1", "4.2"] | ||
es-dsl-version: ["6.4", "7.4"] | ||
es-version: ["8.10.2"] | ||
open-dsl-version: ["2.1.1", "2.4.2"] | ||
|
||
exclude: | ||
- python-version: "3.11" | ||
django-version: "3.2" | ||
|
||
steps: | ||
- name: Install and Run Elasticsearch | ||
uses: elastic/elastic-github-actions/elasticsearch@master | ||
- name: Install and Run Opensearch | ||
uses: esmarkowski/opensearch-github-[email protected] | ||
with: | ||
stack-version: ${{ matrix.es-version }} | ||
version: 2.12.0 | ||
security-disabled: true | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
|
@@ -47,10 +47,10 @@ jobs: | |
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install "Django==${{ matrix.django-version }}" | ||
python -m pip install "elasticsearch-dsl==${{ matrix.es-dsl-version }}" | ||
python -m pip install "opensearchpy==${{ matrix.es-dsl-version }}" | ||
python -m pip install -r requirements_test.txt | ||
- name: Run tests with Python ${{ matrix.python-version }} and Django ${{ matrix.django-version }} and elasticsearch-dsl-py ${{ matrix.es-dsl-version }} | ||
- name: Run tests with Python ${{ matrix.python-version }} and Django ${{ matrix.django-version }} and opensearchpy ${{ matrix.es-dsl-version }} | ||
run: | | ||
TOX_ENV=$(echo "py${{ matrix.python-version }}-django-${{ matrix.django-version }}-es${{ matrix.es-dsl-version }}" | tr -d .) | ||
python -m tox -e $TOX_ENV -- --elasticsearch | ||
|
This file contains 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
This file contains 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
File renamed without changes.
19 changes: 9 additions & 10 deletions
19
django_elasticsearch_dsl/apps.py → django_opensearch_dsl/apps.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,35 @@ | ||
from django.apps import AppConfig | ||
from django.conf import settings | ||
from django.utils.module_loading import import_string | ||
|
||
from elasticsearch_dsl.connections import connections | ||
from opensearchpy.connection import connections | ||
|
||
|
||
class DEDConfig(AppConfig): | ||
name = 'django_elasticsearch_dsl' | ||
verbose_name = "Django elasticsearch-dsl" | ||
name = 'django_opensearch_dsl' | ||
verbose_name = "Django opensearch-dsl" | ||
signal_processor = None | ||
|
||
def ready(self): | ||
self.module.autodiscover() | ||
connections.configure(**settings.ELASTICSEARCH_DSL) | ||
connections.configure(**settings.OPENSEARCH_DSL) | ||
# Setup the signal processor. | ||
if not self.signal_processor: | ||
signal_processor_path = getattr( | ||
settings, | ||
'ELASTICSEARCH_DSL_SIGNAL_PROCESSOR', | ||
'django_elasticsearch_dsl.signals.RealTimeSignalProcessor' | ||
'OPENSEARCH_DSL_SIGNAL_PROCESSOR', | ||
'django_opensearch_dsl.signals.RealTimeSignalProcessor' | ||
) | ||
signal_processor_class = import_string(signal_processor_path) | ||
self.signal_processor = signal_processor_class(connections) | ||
|
||
@classmethod | ||
def autosync_enabled(cls): | ||
return getattr(settings, 'ELASTICSEARCH_DSL_AUTOSYNC', True) | ||
return getattr(settings, 'OPENSEARCH_DSL_AUTOSYNC', True) | ||
|
||
@classmethod | ||
def default_index_settings(cls): | ||
return getattr(settings, 'ELASTICSEARCH_DSL_INDEX_SETTINGS', {}) | ||
return getattr(settings, 'OPENSEARCH_DSL_INDEX_SETTINGS', {}) | ||
|
||
@classmethod | ||
def auto_refresh_enabled(cls): | ||
return getattr(settings, 'ELASTICSEARCH_DSL_AUTO_REFRESH', True) | ||
return getattr(settings, 'OPENSEARCH_DSL_AUTO_REFRESH', True) |
This file contains 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
File renamed without changes.
8 changes: 2 additions & 6 deletions
8
django_elasticsearch_dsl/fields.py → django_opensearch_dsl/fields.py
This file contains 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
2 changes: 1 addition & 1 deletion
2
django_elasticsearch_dsl/indices.py → django_opensearch_dsl/indices.py
This file contains 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
File renamed without changes.
File renamed without changes.
This file contains 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
File renamed without changes.
This file contains 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
This file contains 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
This file contains 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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
django_elasticsearch_dsl/test/testcases.py → django_opensearch_dsl/test/testcases.py
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
version: '3' | ||
services: | ||
opensearch-node1: | ||
image: opensearchproject/opensearch:2.11.1 | ||
container_name: opensearch-node1 | ||
environment: | ||
- cluster.name=opensearch-cluster | ||
- node.name=opensearch-node1 | ||
- discovery.type=single-node | ||
- bootstrap.memory_lock=true # along with the memlock settings below, disables swapping | ||
- OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m # minimum and maximum Java heap size, recommend setting both to 50% of system RAM | ||
- DISABLE_INSTALL_DEMO_CONFIG=true | ||
- DISABLE_SECURITY_PLUGIN=true | ||
ulimits: | ||
memlock: | ||
soft: -1 | ||
hard: -1 | ||
nofile: | ||
soft: 65536 # maximum number of open files for the OpenSearch user, set to at least 65536 on modern systems | ||
hard: 65536 | ||
volumes: | ||
- opensearch-data1:/usr/share/opensearch/data | ||
ports: | ||
- 9200:9200 | ||
- 9600:9600 # required for Performance Analyzer | ||
networks: | ||
- opensearch-net | ||
opensearch-dashboards: | ||
image: opensearchproject/opensearch-dashboards:2.11.1 | ||
container_name: opensearch-dashboards | ||
ports: | ||
- 5601:5601 | ||
expose: | ||
- '5601' | ||
environment: | ||
OPENSEARCH_HOSTS: '["http://opensearch-node1:9200"]' | ||
networks: | ||
- opensearch-net | ||
|
||
volumes: | ||
opensearch-data1: | ||
opensearch-data2: | ||
|
||
networks: | ||
opensearch-net: |
Oops, something went wrong.