Message-ID: <1728675690.2902.1485851178692.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2901_256812094.1485851178692" ------=_Part_2901_256812094.1485851178692 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Solr Search Engine Bundle

Solr Search Engine Bundle

5.4.X >=3D 5.4.5

Support for Solr Search Engine Bundle when used in eZ Publish 5.4 with l= egacy is limited, as the legacy integration is done by Netgen's ezplatformsearch, a third party community-supported extension= .

For instructions on the bundle for eZ Platform= , see Solr Search Engine= Bundle in the eZ Platform Developer documentation.

Version 1.0.x of Solr Bundle primarily aims to be drop in replacem= ent for Legacy (SQL based) search engine for better scalability and perform= ance (mainly with field criteria and sort clauses). And while it a= lso provides better full text search thanks to Solr, more advance search fe= atures like Faceting, Spellchecking, plugin system, .. will come in later r= eleases, most for for newer versions of eZ Platform only. See 5.4.5 Release Notes for further info.

 

=20 =20

What is Sol= r Search Engine Bundle?

ezplatform-solr-search-engine&n= bsp;as the package is called, aims to be a transparent drop in replacement = for the SQL based "Legacy" search engine powering Search API by default. By= enabling Solr and re-indexing your content, all your exising Search querie= s using SearchService, will be powered by Solr automatically. This allows y= ou to scale up your eZ Publish Platform installation and be able to continu= e development locally against SQL engine, and have test infrastructure, Sta= ging and Prod powered by Solr. Thus remove considerable load from your data= base so it can focus on more important things, like publishing 3D"(wink)".

Se Architecture page<= /a> for further information on the architecture of eZ Publish= Platform and eZ Platform.

How to setup S= olr Search engine

Step 1: Enabling Bun= dle

In this step you'll enable the Solr Search Engine Bundle which handles i= ndexing on all updates to Platform stack API, and to handle all search quer= ies going to Search Service.

  1. command line
    =20
    composer require --no-update ezsystems/ezplatform-solr-search-engi=
    ne:~1.0
    composer update
    =20
  2. Activate EzPublishSolrSearchEngineBundle by adding the = following lines to your ezpublish/EzPublishKernel.php file:

    new EzSys=
    tems\EzPlatformSolrSearchEngineBundle\EzSystemsEzPlatformSolrSearchEngineBundle()

Step 2: Ena= bling Legacy extension

Being on 5.x, you'll need to also make sure searches in legacy (like= in admin interface) is using the new solr search engine, this functio= nality is provided by ezplatformsearch extens= ion made by NetGen.

  1. Add/Update composer dependencies:

    command line
    =20
    composer require netgen/ezplatformsearch:~1.1
    =20
  2. Activate extension in site.ini, typically e= zpublish_legacy/settings/override/site.ini.append.php

    site.ini
    =20
    [ExtensionSettings]
    ActiveExtensions[]=3Dezplatformsearch
    
    # Also make sure to comment out or remove any occurrence of other search en=
    gines like ezfind
    #ActiveExtensions[]=3Dezfind
    =20

Step 3= : Configuring & Starting Solr

Example here is for single core, look to=20 Solr=20 documentation for configuring Solr in other ways, also= see the provided configuration for some examples.

 

First download and extract Solr, we currently support Solr 4.10.= 4:

 

Secondly, copy configuration files needed for eZ Solr Search Engine bund= le, here from root of your project to the place you extracted Solr= :

Command line example
=20
# Make sure to change the /opt/solr/ path with where you have plac=
ed Solr
cp -R vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/s=
olr/* /opt/solr/example/solr/collection1/conf/

/opt/solr/bin/solr start -f 
=20

 

Thirdly, Solr Bundle does not commit solr index changes directly on= repository updates, leaving it up to you to tune this using sol= rconfig.xml as best practice suggests, example config:

solrconfig.xml
=20
<autoCommit>
  <!-- autoCommit is here left as-is like it is out of the box in Solr 4=
.10.4, this controls hard commits for durability/replication -->
  <maxTime>${solr.autoCommit.maxTime:15000}</maxTime>=20
  <openSearcher>false</openSearcher>=20
</autoCommit>

<autoSoftCommit>
  <!-- Soft commits controls mainly when changes becomes visible, by def=
ault we change value from -1 (disabled) to 100ms, to try to strike a balanc=
e between Solr performance and staleness of HttpCache generated by Solr que=
ries -->
  <maxTime>${solr.autoSoftCommit.maxTime:100}</maxTime>=20
</autoSoftCommit>
=20

Step 4: Configuri= ng bundle

The Solr search engine bundle can be configured many ways, here are some= examples

Single Core ex= ample (default)

Out of the box in eZ Platform the following is enabled for simple setup:=

ezpublish.yml
=20
ez_search_engine_solr:
    endpoints:
        endpoint0:
            dsn: %solr_dsn%
            core: collection1
    connections:
        default:
            entry_endpoints:
                - endpoint0
            mapping:
                default: endpoint0
=20

Shared Core example

In the following example we have decided to separate one language as ins= tall contains several similar languages, and one very different language th= at should be recive proper language analysis for proper stemming and sortin= g behavior by Solr:

ezpublish.yml
=20
ez_search_engine_solr:
    endpoints:
        endpoint0:
            dsn: %solr_dsn%
            core: core0
       endpoint1:
            dsn: %solr_dsn%
            core: core1
    connections:
        default:
            entry_endpoints:
                - endpoint0
                - endpoint1
            mapping:
                translations:
                    jpn-JP: endpoint1
                # Other languages, for instance eng-US and other western la=
nguages are sharing core
                default: endpoint0
=20

 

Multi Core example

If full language analysis features are preferred, then each language can= be configured to separate cores.

Note: Please make sure to test this setup against single core as it = might perform worse then single core if your project uses a lot for languag= e fallbacks per SiteAccess as queries will then be perf= ormed across several cores at once.

ezpublish.yml
=20
ez_search_engine_solr:
    endpoints:
        endpoint0:
            dsn: %solr_dsn%
            core: core0
       endpoint1:
            dsn: %solr_dsn%
            core: core1
       endpoint2:
            dsn: %solr_dsn%
            core: core2
       endpoint3:
            dsn: %solr_dsn%
            core: core3
       endpoint4:
            dsn: %solr_dsn%
            core: core4
       endpoint5:
            dsn: %solr_dsn%
            core: core5
       endpoint6:
            dsn: %solr_dsn%
            core: core6
    connections:
        default:
            entry_endpoints:
                - endpoint0
                - endpoint1
                - endpoint2
                - endpoint3
                - endpoint4
                - endpoint5
                - endpoint6
            mapping:
                translations:
                    jpn-JP: endpoint1
                    eng-US: endpoint2
                    fre-FR: endpoint3
                    ger-DE: endpoint4
                    esp-ES: endpoint5
                # Not really used, but specified here for fallback if more =
languages are suddenly added by content admins
                default: endpoint0
                # Also use separate core for main languages (differs from c=
ontent object to content object)
                # This is useful to reduce number of cores queried for alwa=
ys available language fallbacks
                main_translations: endpoint6
=20

 

Step 5: Configuring repository with the specific search engin= e

The following is an example of configuring Solr Search Engine, whe= re connection name is same as in example above, and = engine is set to be solr:

 

ezpublish.yml
=20
ezpublish:
    repositories:
        main:
            storage:
                engine: legacy
                connection: default # This should be the connection you had=
 from before for repository
            search:
                engine: solr # One of legacy (default) or solr
                connection: default # If legacy same as storage applies, if=
 solr use same as you defined in step 3
=20

 

 

Config in 5.4.5 and eZ Platform

In eZ Publish 5.4.5 when installed via composer create-project, the exam= ple above is in default config with one small difference (same as on eZ= Platform). There search.engine is set to %search_e= ngine%, which is a parameter that needs to be set in parameters.yml,= and for use with Solr it will needs to be set to "solr" as de= scribed in parameters.yml.dist, and as described above.

Step 6: Clear prod c= ache

While Symfony dev environment keeps track of changes to yml files, prod = does not, so to make sure Symfony reads the new config we clear cache:

=20
php ezpublish/console --env=3Dprod cache:clear
=20

Step 7: Run C= LI indexing command

Last step is to execute initial indexation of data:

=20
php ezpublish/console --env=3Dprod --siteaccess=3D<name> ezp=
latform:solr_create_index
=20

Known issues

If you have issues using the indexing command there are some known issue= s and how you resolve them listed in the 5.4.5 Release Notes.

Providing feedback

After completing the installation you are now free to use your site as u= sual. If you get any excpetions for missing features, have feedback on perf= ormance, or want to discuss, join our community slack channel at https://ezcommunity.slack.com/messages/ezplatfo= rm-use/

 

 

 

------=_Part_2901_256812094.1485851178692 Content-Type: image/png Content-Transfer-Encoding: base64 Content-Location: file:///C:/450b34994881dc04bd093e73c25eda70 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAA3NCSVQICAjb4U/gAAAAeFBMVEX/ ///ht0zds0vbsUrZr0rZr0rZr0rXrUr/01H90VH7z1D5zVD2zVP3y1D1yU/xx07tx1XwxU7vw07k wFfjuUzht0zhtkvftUvds0vbsUrQslvZr0rXrUrJrl3Vq0nAqF+3oWGllWScj2aUiWiKgmqBfGx4 dm5wcHAZd7u/AAAAKHRSTlMAEXe7u8zd7v////////////////////////////////////////// apo9sAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtz IENTNui8sowAAAAUdEVYdENyZWF0aW9uIFRpbWUANi8xLzEzOKlF0AAAAJ1JREFUGJVFT1sCgjAM KyClbvIQ0Q0pU1Tk/je02wDztaRL2gAI0owFhxQiEhy6Wuu6GzAJvDCKArQtvIK3I61QBsXP69xa +cMp5J2Q+5toWeRhcnAVTYsnQTg7cFuCt5DivxBjHXBFn9MuiEVCx/nREF2eX6JrLms1NdMsua+R KlkLuB0qCRbD6X0ZedkXsQyyaUvdGo7l9vpZqP8DgbkMiplsfQgAAAAASUVORK5CYII= ------=_Part_2901_256812094.1485851178692--