Skip to content

Commit

Permalink
Merge pull request #62 from alxsabo/v5.4
Browse files Browse the repository at this point in the history
Keep updated changes in code, to force Lucene by default
  • Loading branch information
ml054 authored Mar 8, 2024
2 parents c733da9 + 000bea0 commit c6386b3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/Constants/Indexes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
19 changes: 10 additions & 9 deletions src/ServerWide/DatabaseRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class DatabaseRecord

/** @SerializedName("AutoIndexes") */
private ?AutoIndexDefinitionMap $autoIndexes = null;
// private Map<String, String> settings = new HashMap<>();
private array $settings = [];
private RevisionsConfiguration $revisions;
private TimeSeriesConfiguration $timeSeries;
private RevisionsCollectionConfiguration $revisionsForConflicts;
Expand Down Expand Up @@ -110,14 +110,15 @@ public function setDisabled(bool $disabled): void
$this->disabled = $disabled;
}

// public Map<String, String> getSettings() {
// return settings;
// }
//
// public void setSettings(Map<String, String> 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;
Expand Down
7 changes: 7 additions & 0 deletions tests/RemoteTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c6386b3

Please sign in to comment.