Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ services:
- { name: "pimcore.generic_data_index.data-object.search_index_field_definition", type: "countrymultiselect" }
- { name: "pimcore.generic_data_index.data-object.search_index_field_definition", type: "language" }
- { name: "pimcore.generic_data_index.data-object.search_index_field_definition", type: "languagemultiselect" }
- { name: "pimcore.generic_data_index.data-object.search_index_field_definition", type: "table" }

Pimcore\Bundle\GenericDataIndexBundle\Service\SearchIndex\DataObject\FieldDefinitionAdapter\NumericAdapter:
shared: false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php
declare(strict_types=1);

/**
* Pimcore
*
* This source file is available under following license:
* - Pimcore Commercial License (PCL)
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license PCL
*/

namespace Pimcore\Bundle\GenericDataIndexBundle\Tests\Unit\Service\SearchIndex\DataObject\FieldDefinitionAdapter;

use Codeception\Test\Unit;
use Pimcore\Bundle\GenericDataIndexBundle\Service\SearchIndex\DataObject\FieldDefinitionAdapter\TextKeywordAdapter;
use Pimcore\Bundle\GenericDataIndexBundle\Service\SearchIndex\DataObject\FieldDefinitionServiceInterface;
use Pimcore\Bundle\GenericDataIndexBundle\Service\SearchIndex\SearchIndexConfigServiceInterface;

/**
* @internal
*/
final class TextKeywordAdapterTest extends Unit
{
public function testGetOpenSearchMapping(): void
{
$searchIndexConfigServiceInterfaceMock = $this->makeEmpty(SearchIndexConfigServiceInterface::class);
$fieldDefinitionServiceInterfaceMock = $this->makeEmpty(FieldDefinitionServiceInterface::class);
$adapter = new TextKeywordAdapter(
$searchIndexConfigServiceInterfaceMock,
$fieldDefinitionServiceInterfaceMock
);

$mapping = $adapter->getOpenSearchMapping();
$this->assertSame([
'type' => 'text',
'fields' => [
'keyword' => [
'type' => 'keyword',
],
],
], $mapping);
}
}