Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

How to use the archiving function

From the command line archiving can be done by running the following command from the "ezpublish_legacy" folder of your eZ Publish installation:

php extension/ezfind/bin/php/solrarchive.php -s <admin site  access> --from=default --to=archive --mode=copy  --criteria='meta_name_t:[* TO *]'

Keep in mind that you must change <admin site access> with your admin site access. The criteria can be adapted to any Solr filter query, the example above will copy all indexed objects to the archive.

Parameters for the Solr archiving script

The following options to pass can be used:

s

sets the correct admin site access to use

use
-s

 from

Use this option to specify the origin of the Solr index.

use
--from=VALUE

The value to use is the origin of the Solr index. If it is the main instance specify "default", meaning that the SearchServerURI definition from solr.ini is used.

to

Use this option to specify the destination Solr index. In other words, where you want to move or copy the index to.

use
--to=VALUE

The value to use is the selected destination for storing the archiving objects.

mode

This option allows you to specify whether you want to copy or move the original Solr index. When moving, the Solr index will be copied to the new location and deleted in the previous location. When copying, the Solr index will exist in both the new and original location.

use
--mode=VALUE

The value to use can either be "copy" or "move".

criteria

This option allows you to select the Solr documents to archive.

use
--criteria=VALUE

Use a raw Solr filter expression as value. This Solr boolean query will be used to select specific Solr objects to archive.

Distributed search

Distributed search allows search results from multiple site to be provided. It is possible to split a Solr index into multiple shards, if an index is to large for a single system or when queries take to long to execute. By splitting the index, Solr can query and merge results across those shards.

If the shards contain objects that are not present in the eZ Publish database, like for example in archived indexes, the parameter AsObjects has to be set to false.

Parameters for fetch function templates

Name

Type

Description

Required

shards

array

lists the shards or individual "partitions" of the search engine to use.

yes

searchfields

array

lists search field names to search for

no

returnfields

array

lists which fields to return

no

rawfilterlist

array

lists the filters to use

no

example

This is an easy example of how to copy the index as alternative to the multi-core setup.

'DistributedSearch' => array ( 'shards', array('shard1', 'shard2' ,  ...),
              'searchfields', array ('myfield1', 'myfield2', ... ),
              'returnfields',  array ('myfield1', 'myfield2', ... ),
              'rawfilterlist', array  ('foreignfield:a', '(foreignfield:b AND otherfield:c)', ... )
                             )
);

Ricardo Correia (12/09/2013 3:41 pm)

Ricardo Correia (12/09/2013 3:41 pm)


Comments

There are no comments.