diff --git a/src/Constants/Indexes.php b/src/Constants/Indexes.php index e75b0c38..33789545 100644 --- a/src/Constants/Indexes.php +++ b/src/Constants/Indexes.php @@ -5,4 +5,5 @@ class Indexes { public const INDEXING_STATIC_SEARCH_ENGINE_TYPE = "Indexing.Static.SearchEngineType"; + public const INDEXING_AUTO_SEARCH_ENGINE_TYPE = "Indexing.Auto.SearchEngineType"; } diff --git a/src/ServerWide/DatabaseRecord.php b/src/ServerWide/DatabaseRecord.php index 7455bac7..11fdde5b 100644 --- a/src/ServerWide/DatabaseRecord.php +++ b/src/ServerWide/DatabaseRecord.php @@ -51,7 +51,7 @@ class DatabaseRecord /** @SerializedName("AutoIndexes") */ private ?AutoIndexDefinitionMap $autoIndexes = null; -// private Map settings = new HashMap<>(); + private array $settings = []; private RevisionsConfiguration $revisions; private TimeSeriesConfiguration $timeSeries; private RevisionsCollectionConfiguration $revisionsForConflicts; @@ -110,14 +110,15 @@ public function setDisabled(bool $disabled): void $this->disabled = $disabled; } -// public Map getSettings() { -// return settings; -// } -// -// public void setSettings(Map settings) { -// this.settings = settings; -// } -// + public function & getSettings(): array { + return $this->settings; + } + + public function setSettings(array $settings): void + { + $this->settings = $settings; + } + public function getConflictSolverConfig(): ConflictSolver { return $this->conflictSolverConfig; diff --git a/tests/RemoteTestBase.php b/tests/RemoteTestBase.php index 8a73e44f..33def176 100644 --- a/tests/RemoteTestBase.php +++ b/tests/RemoteTestBase.php @@ -3,6 +3,7 @@ namespace tests\RavenDB; use DateInterval; +use RavenDB\Constants\Indexes; use RavenDB\Documents\DocumentStore; use RavenDB\Documents\DocumentStoreArray; use RavenDB\Documents\DocumentStoreInterface; @@ -207,6 +208,12 @@ public function getDocumentStore(?string $database = null, bool $secured = false $databaseRecord = new DatabaseRecord(); $databaseRecord->setDatabaseName($name); + // force lucene on database level + $settings = $databaseRecord->getSettings(); + $settings[Indexes::INDEXING_STATIC_SEARCH_ENGINE_TYPE] = "Lucene"; + $settings[Indexes::INDEXING_AUTO_SEARCH_ENGINE_TYPE] = "Lucene"; + $databaseRecord->setSettings($settings); + $this->customizeDbRecord($databaseRecord); $createDatabaseOperation = new CreateDatabaseOperation($databaseRecord);