Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
1783a9d
NGSTACK-836 parent child indexer
kmiocic Mar 22, 2024
2cc0138
NGSTACK-836 remove SearchResultExtractorTrait from ParentChildFieldMa…
kmiocic Mar 25, 2024
d8c149e
NGSTACK-836 remove argument from service definition
kmiocic Mar 25, 2024
b02d9ef
NGSTACK-836 add parent child indexing compiler pass
kmiocic Mar 25, 2024
1f155f1
NGSTACK-836 service definition changes
kmiocic Mar 28, 2024
3dab552
NGSTACK-836 FulltextFieldResolver interface and remove search from Pa…
kmiocic Mar 28, 2024
ffa187f
NGSTACK-836 use persistence location handler instead of location service
kmiocic Mar 28, 2024
fc39cb6
NGSTACK-836 add content id as key to parent ids property and unset pr…
kmiocic Mar 28, 2024
e0cf67a
NGSTACK-836 replace persistance handler with location handler, use in…
kmiocic Mar 28, 2024
ac7aadf
NGSTACK-836: use class constant instead of FQCN
pspanja May 29, 2024
42892fe
NGSTACK-836: add strict types declaration and fix CS
pspanja May 29, 2024
c5735cb
NGSTACK-836: add property type annotation and fix CS
pspanja May 29, 2024
0c6ebab
NGSTACK-836: fix CS
pspanja May 29, 2024
4c30c14
NGSTACK-836: fix CS
pspanja May 29, 2024
aff2274
NGSTACK-836: remove unused imports
pspanja May 29, 2024
50bf569
NGSTACK-836: add strict types declaration and fix CS
pspanja May 29, 2024
e7bc734
NGSTACK-836: use getters instead of magic get and fix CS
pspanja May 29, 2024
8f84450
NGSTACK-836: fix case mismatch
pspanja May 29, 2024
7453dd5
NGSTACK-836: clean up docblocks
pspanja May 29, 2024
5583ecf
NGSTACK-836: remove unnecessary type cast
pspanja May 29, 2024
a0f3b7e
NGSTACK-836: clean up docblocks
pspanja May 29, 2024
7697c0e
NGSTACK-836: fix CS
pspanja May 29, 2024
602f4d2
NGSTACK-836: fix spacing
pspanja May 29, 2024
ba60332
NGSTACK-836: move configuration to the bottom
pspanja May 29, 2024
f2f1fd9
NGSTACK-836: fix CS
pspanja May 29, 2024
84eaa79
NGSTACK-836: fix typo
pspanja May 29, 2024
a019fc7
NGSTACK-836: fix async indexing tests and prepare for testing parent-…
pspanja May 29, 2024
6837403
NGSTACK-836: check and skip root Location
pspanja May 29, 2024
cf58bae
NGSTACK-836: handle exception when resolving content type identifier
pspanja May 29, 2024
cfac016
NGSTACK-836: restructure message handlers
pspanja May 29, 2024
3a2131c
NGSTACK-836: restructure parent-child indexing field mapper
pspanja May 29, 2024
a470a60
NGSTACK-836: restructure parent-child indexing ancestor resolver
pspanja May 29, 2024
d748ae0
NGSTACK-836: fix test service configuration
pspanja May 29, 2024
1d6bb19
NGSTACK-836: add parent-child indexing test for publishing version
pspanja May 29, 2024
6652b1d
NGSTACK-836: fix CS
pspanja May 31, 2024
fe149f4
NGSTACK-836: update test class name
pspanja May 31, 2024
26c1bc4
NGSTACK-836: rename parent-child indexing fulltext field mapper
pspanja May 31, 2024
ed1932c
NGSTACK-836: make parent-child fulltext field mapper configurable
pspanja May 31, 2024
b1b85ab
NGSTACK-836: implement recursive semantic config
pspanja Jun 3, 2024
eac31db
NGSTACK-836: extract AncestorPathGenerator with test
pspanja Jun 4, 2024
7ebc3f8
NGSTACK-836: fix indenting
pspanja Jun 6, 2024
b8005f6
NGSTACK-836: fix logged message
pspanja Jun 6, 2024
bf28045
NGSTACK-836: add AncestorResolver unit test
pspanja Jun 6, 2024
412f70e
NGSTACK-836: disable hierarchical indexing on legacy and asynchronous…
pspanja Jun 6, 2024
595f090
NGSTACK-836: fix exclude configuration
pspanja Jun 6, 2024
e2c96c5
NGSTACK-836: fix service configuration
pspanja Jun 6, 2024
903995a
NGSTACK-836: fix case mismatch
pspanja Jun 6, 2024
96b20f3
NGSTACK-836: update for change in configuration
pspanja Jun 6, 2024
4a25409
NGSTACK-836: implement configurable Solr field handlers for descendan…
pspanja Jun 7, 2024
dfae660
NGSTACK-836: rename parent child indexing to descendant indexing
pspanja Jun 10, 2024
3b3a846
NGSTACK-836: rename parent child indexing to descendant indexing part 2
pspanja Jun 10, 2024
0079e13
NGSTACK-836: add Block and BlockTranslation Descendant FieldMappers
pspanja Jun 11, 2024
19b2792
NGSTACK-836: rename cleanup
pspanja Jun 11, 2024
8b56564
NGSTACK-836: fix CS
pspanja Jun 11, 2024
0283d68
NGSTACK-836 tests for descendant indexing
kmiocic Jul 11, 2024
f71cbeb
NGSTACK-836 AncestorIndexer and AncestorResolver changes and swap loc…
kmiocic Jul 11, 2024
9e78499
NGSTACK-836 remove unused qualifiers
kmiocic Jul 11, 2024
4001443
NGSTACK-836 exclude descendant indexing tests (not supported with leg…
kmiocic Jul 11, 2024
b857304
NGSTACK-836 update tests throws tags
kmiocic Jul 11, 2024
a1f0c3d
NGSTACK-836 declare test return types
kmiocic Jul 12, 2024
c24a909
NGSTACK-836 remove unnecessary code
kmiocic Jul 12, 2024
841c1a1
NGSTACK-836 renaming field mappers and custom solr fields
kmiocic Jul 12, 2024
912650c
NGSTACK-836 fix handlers configuration
kmiocic Jul 18, 2024
3f53af9
NGSTACK-836 add documentation for descendant indexing
kmiocic Jul 30, 2024
7fc8cf5
NGSTACK-836 documentation changes
kmiocic Aug 2, 2024
f86f34e
NGSTACK-836 exclude descendant indexing from integration legacy tests
kmiocic Aug 14, 2024
55295b9
NGSTACK-836 comment NameSchemaSubscriber line
kmiocic Aug 14, 2024
409fe04
NGSTACK-836 exclude tests fix path
kmiocic Aug 14, 2024
f33b322
NGSTACK-836 exclude DescendantIndexingSectionTest
kmiocic Aug 16, 2024
b24e108
NGSTACK-836 documentation fix
kmiocic Sep 10, 2024
a5bf814
NGSTACK-836: define schemas for ContentType
pspanja Jun 10, 2025
a51ce07
NGSTACK-836: add missing event subscribers
pspanja Jun 10, 2025
1b3a6a8
NGSTACK-836: fix language
pspanja Jun 10, 2025
6b93f4f
NGSTACK-836: add missing compiler pass
pspanja Jun 10, 2025
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
134 changes: 133 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
tests:
name: ${{ matrix.php }} ${{ matrix.coverage }} ${{ matrix.engine }} ${{ matrix.solr_version }} ${{ matrix.regression }} ${{ matrix.core_setup }}
name: ${{ matrix.php }} ${{ matrix.coverage }} ${{ matrix.engine }} ${{ matrix.solr_version }} ${{ matrix.regression }} ${{ matrix.asynchronous }} ${{ matrix.core_setup }}
runs-on: "ubuntu-22.04"
env:
extensions: pdo_sqlite
Expand Down Expand Up @@ -53,6 +53,37 @@ jobs:
solr_cloud: 'yes'
core_setup: 'cloud'

- php: '8.1'
coverage: 'integration'
engine: 'solr'
config: 'phpunit-integration-solr-asynchronous.xml'
solr_version: '7.7.3'
solr_cores: 'collection1'
core_setup: 'single'
asynchronous: 'asynchronous'
- php: '8.1'
coverage: 'integration'
engine: 'solr'
config: 'phpunit-integration-solr-asynchronous.xml'
solr_version: '7.7.3'
core_setup: 'dedicated'
asynchronous: 'asynchronous'
- php: '8.1'
coverage: 'integration'
engine: 'solr'
config: 'phpunit-integration-solr-asynchronous.xml'
solr_version: '7.7.3'
core_setup: 'shared'
asynchronous: 'asynchronous'
- php: '8.1'
coverage: 'integration'
engine: 'solr'
config: 'phpunit-integration-solr-asynchronous.xml'
solr_version: '7.7.3'
solr_cloud: 'yes'
core_setup: 'cloud'
asynchronous: 'asynchronous'

- php: '8.1'
coverage: 'integration'
engine: 'solr'
Expand Down Expand Up @@ -84,6 +115,41 @@ jobs:
core_setup: 'cloud'
regression: 'regression'

- php: '8.1'
coverage: 'integration'
engine: 'solr'
config: 'phpunit-core-integration-legacy-solr-asynchronous.xml'
solr_version: '7.7.3'
solr_cores: 'collection1'
core_setup: 'single'
regression: 'regression'
asynchronous: 'asynchronous'
- php: '8.1'
coverage: 'integration'
engine: 'solr'
config: 'phpunit-core-integration-legacy-solr-asynchronous.xml'
solr_version: '7.7.3'
core_setup: 'dedicated'
regression: 'regression'
asynchronous: 'asynchronous'
- php: '8.1'
coverage: 'integration'
engine: 'solr'
config: 'phpunit-core-integration-legacy-solr-asynchronous.xml'
solr_version: '7.7.3'
core_setup: 'shared'
regression: 'regression'
asynchronous: 'asynchronous'
- php: '8.1'
coverage: 'integration'
engine: 'solr'
config: 'phpunit-core-integration-legacy-solr-asynchronous.xml'
solr_version: '7.7.3'
solr_cloud: 'yes'
core_setup: 'cloud'
regression: 'regression'
asynchronous: 'asynchronous'

- php: '8.1'
coverage: 'integration'
engine: 'solr'
Expand Down Expand Up @@ -111,6 +177,37 @@ jobs:
solr_cloud: 'yes'
core_setup: 'cloud'

- php: '8.1'
coverage: 'integration'
engine: 'solr'
config: 'phpunit-integration-solr-asynchronous.xml'
solr_version: '8.11.2'
solr_cores: 'collection1'
core_setup: 'single'
asynchronous: 'asynchronous'
- php: '8.1'
coverage: 'integration'
engine: 'solr'
config: 'phpunit-integration-solr-asynchronous.xml'
solr_version: '8.11.2'
core_setup: 'dedicated'
asynchronous: 'asynchronous'
- php: '8.1'
coverage: 'integration'
engine: 'solr'
config: 'phpunit-integration-solr-asynchronous.xml'
solr_version: '8.11.2'
core_setup: 'shared'
asynchronous: 'asynchronous'
- php: '8.1'
coverage: 'integration'
engine: 'solr'
config: 'phpunit-integration-solr-asynchronous.xml'
solr_version: '8.11.2'
solr_cloud: 'yes'
core_setup: 'cloud'
asynchronous: 'asynchronous'

- php: '8.1'
coverage: 'integration'
engine: 'solr'
Expand Down Expand Up @@ -142,6 +239,41 @@ jobs:
core_setup: 'cloud'
regression: 'regression'

- php: '8.1'
coverage: 'integration'
engine: 'solr'
config: 'phpunit-core-integration-legacy-solr-asynchronous.xml'
solr_version: '8.11.2'
solr_cores: 'collection1'
core_setup: 'single'
regression: 'regression'
asynchronous: 'asynchronous'
- php: '8.1'
coverage: 'integration'
engine: 'solr'
config: 'phpunit-core-integration-legacy-solr-asynchronous.xml'
solr_version: '8.11.2'
core_setup: 'dedicated'
regression: 'regression'
asynchronous: 'asynchronous'
- php: '8.1'
coverage: 'integration'
engine: 'solr'
config: 'phpunit-core-integration-legacy-solr-asynchronous.xml'
solr_version: '8.11.2'
core_setup: 'shared'
regression: 'regression'
asynchronous: 'asynchronous'
- php: '8.1'
coverage: 'integration'
engine: 'solr'
config: 'phpunit-core-integration-legacy-solr-asynchronous.xml'
solr_version: '8.11.2'
solr_cloud: 'yes'
core_setup: 'cloud'
regression: 'regression'
asynchronous: 'asynchronous'

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
Expand Down
128 changes: 125 additions & 3 deletions bundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;

use function array_keys;
use function is_string;
Expand All @@ -31,6 +32,8 @@ public function getConfigTreeBuilder(): TreeBuilder
$this->addFulltextBoostSection($rootNode);
$this->addUsePageIndexingSection($rootNode);
$this->addPageIndexingSection($rootNode);
$this->addParentChildIndexingSection($rootNode);
$this->addHierarchicalIndexingSection($rootNode);

return $treeBuilder;
}
Expand All @@ -52,7 +55,7 @@ private function addIndexableFieldTypeSection(ArrayNodeDefinition $nodeDefinitio
->info("Maximum number of characters for the indexed short text ('value' string type field)")
->defaultValue(256)
->end()
->end()
?->end()
->end()
->end()
->end()
Expand All @@ -68,7 +71,7 @@ private function addSearchResultExtractorSection(ArrayNodeDefinition $nodeDefini
->info('Get search result objects by loading them from the persistence layer, instead of reconstructing them from the returned Solr data')
->defaultTrue()
->end()
->end();
?->end();
}

private function addAsynchronousIndexingSection(ArrayNodeDefinition $nodeDefinition): void
Expand All @@ -80,7 +83,7 @@ private function addAsynchronousIndexingSection(ArrayNodeDefinition $nodeDefinit
->info('Use asynchronous mechanism to handle repository content indexing')
->defaultFalse()
->end()
->end();
?->end();
}

private function addFulltextBoostSection(ArrayNodeDefinition $nodeDefinition): void
Expand Down Expand Up @@ -249,4 +252,123 @@ private function addPageIndexingSection(ArrayNodeDefinition $nodeDefinition): vo
->end()
->end();
}

private function addParentChildIndexingSection(ArrayNodeDefinition $nodeDefinition): void
{
$nodeDefinition
->children()
->booleanNode('use_parent_child_indexing')
->info('Use parent-child indexing')
->defaultFalse()
->end()
?->booleanNode('parent_child_indexing_use_default_solr_fulltext_field_mapper')
->info('Use parent-child indexing default Solr fulltext field mapper')
->defaultFalse()
->end()
?->end();
}

private function addHierarchicalIndexingSection(ArrayNodeDefinition $nodeDefinition): void
{
$childrenNodeDefinition = $nodeDefinition
->children()
->arrayNode('hierarchical_indexing')
->info('Hierarchical indexing configuration')
->addDefaultsIfNotSet()
->children()
->arrayNode('descendant_indexing')
->info('Descendant indexing configuration')
->addDefaultsIfNotSet()
->children()
->booleanNode('enabled')
->info('Enable/disable descendant indexing')
->defaultFalse()
->end()
?->arrayNode('map')
->useAttributeAsKey('name')
->normalizeKeys(false)
->arrayPrototype()
->children()
->arrayNode('handlers')
->info('List of indexing handlers to execute')
->example([
'handler_identifier_1',
'handler_identifier_2',
])
->scalarPrototype()
->defaultValue([])
->validate()
->ifTrue(fn ($v) => !is_string($v))
->thenInvalid('Handler identifier must be a string.')
->end()
->end()
?->end()
?->arrayNode('children')
->useAttributeAsKey('name')
->normalizeKeys(false)
->arrayPrototype()
;

$this->buildChildrenNode($childrenNodeDefinition);
}

private function evaluateChildren(&$child, $name): void
{
$builder = new TreeBuilder($name, 'array');
$root = $builder->getRootNode();

$this->buildChildrenNode($root);

$root->getNode(true)->finalize($child);
}

private function buildChildrenNode(ArrayNodeDefinition $node): void
{
$node
->addDefaultsIfNotSet()
->children()
->booleanNode('indexed')
->info('Whether the node should be indexed')
->defaultTrue()
->end()
?->variableNode('children')
->defaultValue([])
->validate()
->ifTrue(fn ($v) => !is_array($v))
->thenInvalid('The children element must be an array.')
->end()
->validate()
->always(
function ($children) {
array_walk($children, $this->evaluateChildren(...));

return $children;
}
)
->end()
->end()
?->end()
->validate()
->always(
function ($children) {
foreach (array_keys($children) as $key) {
$allowedOptions = ['indexed', 'children'];

if (!in_array($key, $allowedOptions, true)) {
throw new InvalidConfigurationException(
sprintf(
'Unrecognized option "%s". Available options are "%s".',
$key,
implode('", "', $allowedOptions),
),
);
}
}

return $children;
}
)
->end()
;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ private function processExtensionConfiguration(array $configs, ContainerBuilder
$this->processFullTextBoostConfiguration($configuration, $container);
$this->processUsePageIndexingConfiguration($configuration, $container);
$this->processPageIndexingConfiguration($configuration, $container);
$this->processDescendantIndexingConfiguration($configuration, $container);
}

private function processSearchResultExtractorConfiguration(array $configuration, ContainerBuilder $container): void
Expand Down Expand Up @@ -157,4 +158,12 @@ private function processPageIndexingConfiguration(array $configuration, Containe
$configuration['page_indexing']['enabled'] ?? false,
);
}

private function processDescendantIndexingConfiguration(array $configuration, ContainerBuilder $container): void
{
$container->setParameter(
'netgen.ibexa_search_extra.descendant_indexing.configuration',
$configuration['hierarchical_indexing']['descendant_indexing'],
);
}
}
2 changes: 2 additions & 0 deletions bundle/NetgenIbexaSearchExtraBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Netgen\Bundle\IbexaSearchExtraBundle;

use Netgen\IbexaSearchExtra\Container\Compiler;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

Expand All @@ -21,6 +22,7 @@ public function build(ContainerBuilder $container): void
$container->addCompilerPass(new Compiler\AggregateFacetBuilderVisitorPass());
$container->addCompilerPass(new Compiler\AggregateSubdocumentQueryCriterionVisitorPass());
$container->addCompilerPass(new Compiler\AsynchronousIndexingPass());
$container->addCompilerPass(new Compiler\DescendantIndexingPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 100);
$container->addCompilerPass(new Compiler\FieldType\RichTextIndexablePass());
$container->addCompilerPass(new Compiler\SearchResultExtractorPass());
$container->addCompilerPass(new Compiler\RawFacetBuilderDomainVisitorPass());
Expand Down
Loading
Loading