Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/4.5' into manual-cross-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Nattfarinn committed Dec 14, 2023
2 parents 8edb630 + 16591b0 commit e640888
Show file tree
Hide file tree
Showing 351 changed files with 6,229 additions and 4,828 deletions.
10 changes: 5 additions & 5 deletions .github/init_solr.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash

default_config_files[1]='lib/Resources/config/solr/schema.xml'
default_config_files[2]='lib/Resources/config/solr/custom-fields-types.xml'
default_config_files[3]='lib/Resources/config/solr/language-fieldtypes.xml'
default_config_files[1]='src/lib/Resources/config/solr/schema.xml'
default_config_files[2]='src/lib/Resources/config/solr/custom-fields-types.xml'
default_config_files[3]='src/lib/Resources/config/solr/language-fieldtypes.xml'

default_cores[0]='core0'
default_cores[1]='core1'
Expand All @@ -16,7 +16,7 @@ default_shards=('shard0')

SOLR_PORT=${SOLR_PORT:-8983}
SOLR_DIR=${SOLR_DIR:-'__solr'}
SOLR_VERSION=${SOLR_VERSION:-'8.11.1'}
SOLR_VERSION=${SOLR_VERSION:-'8.11.2'}
SOLR_INSTALL_DIR="${SOLR_DIR}/${SOLR_VERSION}"
SOLR_DEBUG=${SOLR_DEBUG:-false}
SOLR_HOME=${SOLR_HOME:-'ezcloud'}
Expand Down Expand Up @@ -45,7 +45,7 @@ fi
download() {
case ${SOLR_VERSION} in
# PS!!: Append versions and don't remove old ones (except in major versions), used in integration tests from other packages!
7.7.* | 8.[5-8].* | 8.11.* )
7.7.* | 8.* )
url="http://archive.apache.org/dist/lucene/solr/${SOLR_VERSION}/solr-${SOLR_VERSION}.tgz"
;;
*)
Expand Down
16 changes: 16 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
| Question | Answer |
|--------------------------|-----------------------------------------------------|
| **JIRA issue** | [IBX-XXXX](https://issues.ibexa.co/browse/IBX-XXXX) |
| **Type** | feature/bug/improvement |
| **Target Ibexa version** | `v4.x` - please update `x` accordingly |
| **BC breaks** | yes/no |

<!-- Replace this comment with Pull Request description -->

#### Checklist:
- [ ] Provided PR description.
- [ ] Tested the solution manually.
- [ ] Provided automated test coverage.
- [ ] Checked that target branch is set correctly (main for features, the oldest supported for bugs).
- [ ] Ran PHP CS Fixer for new PHP code (use `$ composer fix-cs`).
- [ ] Asked for a review (ping for example `@ibexa/php-dev` for back-end changes and/or `@ibexa/javascript-dev` for front-end changes).
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
fail-fast: false
matrix:
php:
- '7.3'
- '7.4'
- '8.0'
- '8.1'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
solr-version:
- '7.7.3'
- '8.11.1'
- '8.11.2'
cores-setup:
- 'dedicated'
- 'shared'
Expand Down
25 changes: 25 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

use Ibexa\CodeStyle\PhpCsFixer\InternalConfigFactory;

$configFactory = new InternalConfigFactory();
$configFactory->withRules([
'declare_strict_types' => false,
]);

return $configFactory
->buildConfig()
->setFinder(
PhpCsFixer\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->files()->name('*.php')
);
9 changes: 0 additions & 9 deletions .php_cs

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To contribute to this bundle, make sure to run both unit and integration tests (
1. Set up this repository locally

```bash
git clone [email protected]:ezsystems/ezplatform-solr-search-engine.git solr
git clone [email protected]:ibexa/solr.git solr
cd solr
composer install
```
Expand All @@ -27,10 +27,10 @@ To contribute to this bundle, make sure to run both unit and integration tests (

3. Run integration tests

To run integration tests against Solr, using [default config](https://github.com/ezsystems/ezplatform-kernel/blob/master/phpunit-integration-legacy-solr.xml#L14-L19):
To run integration tests against Solr, using [default config](https://github.com/ibexa/core/blob/master/phpunit-integration-legacy-solr.xml#L14-L19):
```bash
export CORES_SETUP="single"
php -d memory_limit=-1 vendor/bin/phpunit --bootstrap tests/bootstrap.php -vc vendor/ezsystems/ezplatform-kernel/phpunit-integration-legacy-solr.xml
php -d memory_limit=-1 vendor/bin/phpunit --bootstrap tests/bootstrap.php -vc vendor/ibexa/core/phpunit-integration-legacy-solr.xml
```

## COPYRIGHT
Expand Down
24 changes: 13 additions & 11 deletions bin/generate-solr-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@

set -e

# Default paramters, if not overloaded by user arguments
# Default parameters, if not overloaded by user arguments
DESTINATION_DIR=.platform/configsets/solr8/conf
SOLR_VERSION=8.11.1
FORCE=false
SOLR_INSTALL_DIR=""

show_help() {
cat << EOF
Script for generting solr config
This config can be used to configure solr on eZ Platform Cloud (Platform.sh) or elsewhere.
The script should be executed from the eZ Platform root directory.
Script for generating Solr config
This config can be used to configure solr on Ibexa Cloud (Platform.sh) or elsewhere.
The script should be executed from the Ibexa project root directory.
Help (this text):
./vendor/ezsystems/ezplatform-solr-search-engine/bin/generate-solr-config.sh --help
./vendor/ibexa/solr/bin/generate-solr-config.sh --help
Usage with eZ Platform Cloud (arguments here can be skipped as they have default values):
./vendor/ezsystems/ezplatform-solr-search-engine/bin/generate-solr-config.sh \\
Usage with Ibexa Cloud (arguments here can be skipped as they have default values):
./vendor/ibexa/solr/bin/generate-solr-config.sh \\
--destination-dir=.platform/configsets/solr8/conf \\
--solr-version=8.11.1
Usage with on-premise version of Solr:
./vendor/ezsystems/ezplatform-solr-search-engine/bin/generate-solr-config.sh \\
--destination-dir=/opt/solr/server/ez/template \\
./vendor/ibexa/solr/bin/generate-solr-config.sh \\
--destination-dir=/opt/solr/server/ibexa/template \\
--solr-install-dir=/opt/solr
Warning:
Expand Down Expand Up @@ -108,7 +108,7 @@ if [ "$SOLR_INSTALL_DIR" == "" ]; then
fi

mkdir -p $DESTINATION_DIR
cp -a ${EZ_BUNDLE_PATH}/lib/Resources/config/solr/* $DESTINATION_DIR
cp -a ${EZ_BUNDLE_PATH}/src/lib/Resources/config/solr/* $DESTINATION_DIR
cp ${SOLR_INSTALL_DIR}/server/solr/configsets/_default/conf/{solrconfig.xml,stopwords.txt,synonyms.txt} $DESTINATION_DIR

if [[ ! $DESTINATION_DIR =~ ^\.platform ]]; then
Expand All @@ -120,7 +120,9 @@ fi

# Adapt autoSoftCommit to have a recommended value, and remove add-unknown-fields-to-the-schema
sed -i.bak '/<updateRequestProcessorChain name="add-unknown-fields-to-the-schema".*/,/<\/updateRequestProcessorChain>/d' $DESTINATION_DIR/solrconfig.xml
sed -i.bak2 's/${solr.autoSoftCommit.maxTime:-1}/${solr.autoSoftCommit.maxTime:20}/' $DESTINATION_DIR/solrconfig.xml
sed -i.bak 's/${solr.autoSoftCommit.maxTime:-1}/${solr.autoSoftCommit.maxTime:20}/' $DESTINATION_DIR/solrconfig.xml

rm $DESTINATION_DIR/solrconfig.xml.bak

if [ "$GENERATE_SOLR_TMPDIR" != "" ]; then
echo Removing temp dir: $GENERATE_SOLR_TMPDIR
Expand Down
53 changes: 0 additions & 53 deletions bundle/Resources/config/services.yml

This file was deleted.

48 changes: 27 additions & 21 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
{
"name": "ezsystems/ezplatform-solr-search-engine",
"description": "Solr search engine implementation for eZ Platform",
"name": "ibexa/solr",
"description": "Solr search engine implementation for Ibexa",
"license": "GPL-2.0-only",
"type": "ezplatform-bundle",
"homepage": "https://github.com/ezsystems/ezplatform-solr-search-engine",
"type": "ibexa-bundle",
"replace": {
"ezsystems/ezplatform-solr-search-engine": "*"
},
"authors": [
{
"name": "eZ Systems dev team",
"email": "dev-team@ez.no"
"email": "dev-team@ibexa.co"
}
],
"require": {
"php": "^7.3 || ^8.0",
"php": "^7.4 || ^8.0",
"ext-json": "*",
"ext-xmlwriter": "*",
"ezsystems/ezplatform-kernel": "^1.3@dev",
"ibexa/core": "~4.5.0@dev",
"netgen/query-translator": "^1.0.2",
"symfony/http-kernel": "^5.0",
"symfony/dependency-injection": "^5.0",
Expand All @@ -24,46 +26,50 @@
"symfony/http-client": "^5.4"
},
"require-dev": {
"ezsystems/doctrine-dbal-schema": "^1.0@dev",
"ezsystems/ezplatform-code-style": "^0.1.0",
"league/flysystem-memory": "^1.0",
"symfony/proxy-manager-bridge": "^5.4",
"ibexa/doctrine-schema": "~4.5.0@dev",
"phpunit/phpunit": "^8.2",
"matthiasnoback/symfony-dependency-injection-test": "^4.1",
"ibexa/code-style": "^1.0",
"phpstan/phpstan": "^1.8",
"phpstan/phpstan-phpunit": "^1.1",
"phpstan/phpstan-symfony": "^1.2",
"phpunit/phpunit": "^8.2",
"symfony/proxy-manager-bridge": "^5.4"
"phpstan/phpstan-symfony": "^1.2"
},
"autoload": {
"psr-4": {
"Ibexa\\Solr\\": "src/lib/",
"Ibexa\\Bundle\\Solr\\": "src/bundle/",
"Ibexa\\Contracts\\Solr\\": "src/contracts/",
"Ibexa\\Tests\\Solr\\SetupFactory\\": "tests/lib/SetupFactory/",
"EzSystems\\EzPlatformSolrSearchEngine\\": "lib/",
"EzSystems\\EzPlatformSolrSearchEngineBundle\\": "bundle/",
"EzSystems\\EzPlatformSolrSearchEngine\\": "src/lib/",
"EzSystems\\EzPlatformSolrSearchEngineBundle\\": "src/bundle/",
"EzSystems\\EzPlatformSolrSearchEngine\\Tests\\SetupFactory\\": "tests/lib/SetupFactory/"
}
},
"autoload-dev": {
"psr-4": {
"Ibexa\\Tests\\Bundle\\Solr\\": "tests/bundle/",
"Ibexa\\Tests\\Solr\\": "tests/lib/",
"EzSystems\\EzPlatformSolrSearchEngine\\Tests\\": "tests/lib",
"EzSystems\\EzPlatformSolrSearchEngineBundle\\Tests\\": "tests/bundle"
"Ibexa\\Tests\\Integration\\Core\\": "vendor/ibexa/core/tests/integration/Core/",
"Ibexa\\Tests\\Core\\": "vendor/ibexa/core/tests/lib/",
"Ibexa\\Tests\\Bundle\\Core\\": "vendor/ibexa/core/tests/bundle/",
"EzSystems\\EzPlatformSolrSearchEngine\\Tests\\": "tests/lib/",
"EzSystems\\EzPlatformSolrSearchEngineBundle\\Tests\\": "tests/bundle/"
}
},
"scripts": {
"fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots",
"check-cs": "php-cs-fixer fix --dry-run -v --show-progress=dots",
"test": "phpunit --bootstrap tests/bootstrap.php -c phpunit.xml",
"test-integration-solr": [
"Composer\\Config::disableProcessTimeout",
"phpunit --bootstrap tests/bootstrap.php -c vendor/ezsystems/ezplatform-kernel/phpunit-integration-legacy-solr.xml"
"phpunit --bootstrap tests/bootstrap.php -c vendor/ibexa/core/phpunit-integration-legacy-solr.xml"
],
"fix-cs": "php-cs-fixer fix -v --show-progress=estimating",
"check-cs": "php-cs-fixer fix --dry-run -v --show-progress=estimating",
"phpstan": "phpstan analyse"
},
"extra": {
"branch-alias": {
"dev-master": "3.3.x-dev"
"dev-main": "4.5.x-dev"
}
},
"config": {
Expand Down
12 changes: 6 additions & 6 deletions doc/specifications/document_field_mappers.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ as follows:

- all block documents
- `ContentFieldMapper`
- `ezpublish.search.solr.document_field_mapper.block`
- `ibexa.search.solr.field.mapper.block`
- all block documents per translation
- `ContentTranslationFieldMapper`
- `ezpublish.search.solr.field_mapper.block_translation`
- `ibexa.search.solr.field.mapper.block.translation`
- Content documents
- `ContentFieldMapper`
- `ezpublish.search.solr.document_field_mapper.content`
- `ibexa.search.solr.field.mapper.content`
- Content documents per translation
- `ContentTranslationFieldMapper`
- `ezpublish.search.solr.field_mapper.content_translation`
- `ibexa.search.solr.field.mapper.content.translation`
- Location documents
- `LocationFieldMapper`
- `ezpublish.search.solr.field_mapper.location`
- `ibexa.search.solr.field.mapper.location`

The following example shows how to index data from the parent Location content, in order to make it
available for full text search on the children content. A concrete use case could be indexing
Expand Down Expand Up @@ -130,5 +130,5 @@ my_webinar_app.webinar_event_title_fulltext_field_mapper:
- '@ezpublish.spi.persistence.content_handler'
- '@ezpublish.spi.persistence.location_handler'
tags:
- {name: ezpublish.search.solr.field_mapper.content}
- {name: ibexa.search.solr.field.mapper.content}
```
20 changes: 0 additions & 20 deletions lib/Container/Compiler/FieldMapperPass/BlockFieldMapperPass.php

This file was deleted.

Loading

0 comments on commit e640888

Please sign in to comment.