2016-12-15 17:59:13 +01:00
|
|
|
.. highlight:: bash
|
|
|
|
.. _usage:
|
|
|
|
|
|
|
|
Usage
|
|
|
|
=====
|
|
|
|
|
|
|
|
.. _usage_manual_indexing:
|
|
|
|
|
|
|
|
Manual indexing
|
|
|
|
---------------
|
|
|
|
|
|
|
|
You can trigger indexing from CLI::
|
|
|
|
|
2018-12-29 18:44:38 +01:00
|
|
|
./typo3/cli_dispatch.phpsh extbase index:index --identifiers 'pages'
|
|
|
|
./bin/typo3cms index:index --identifiers 'pages'
|
2016-12-15 17:59:13 +01:00
|
|
|
|
2018-03-08 08:17:41 +01:00
|
|
|
This will index the table ``pages`` using the :ref:`TcaIndexer`.
|
2016-12-15 17:59:13 +01:00
|
|
|
|
2018-12-29 18:44:38 +01:00
|
|
|
Multiple indexer can be called by providing a comma separated list of identifiers as
|
|
|
|
a single argument. Spaces before and after commas are ignored.
|
2017-07-06 16:17:30 +02:00
|
|
|
The indexers have to be defined in TypoScript via :ref:`configuration_options_index`.
|
2016-12-16 12:55:23 +01:00
|
|
|
|
2017-11-10 13:22:15 +01:00
|
|
|
.. _usage_manual_deletion:
|
|
|
|
|
|
|
|
Manual deletion
|
|
|
|
---------------
|
|
|
|
|
2018-12-29 18:44:38 +01:00
|
|
|
You can trigger deletion for indexes from CLI::
|
2017-11-10 13:22:15 +01:00
|
|
|
|
2018-12-29 18:44:38 +01:00
|
|
|
./typo3/cli_dispatch.phpsh extbase index:delete --identifiers 'pages'
|
|
|
|
./bin/typo3cms index:delete --identifiers 'pages'
|
2017-11-10 13:22:15 +01:00
|
|
|
|
2018-12-29 18:44:38 +01:00
|
|
|
This will delete the index for the table ``pages``. Deletion means removing all
|
|
|
|
documents from the index.
|
2017-11-10 13:22:15 +01:00
|
|
|
|
2018-12-29 18:44:38 +01:00
|
|
|
Multiple indices can be called by providing a comma separated list of identifiers as
|
|
|
|
a single argument. Spaces before and after commas are ignored.
|
|
|
|
|
|
|
|
.. _usage_manual_flush:
|
|
|
|
|
|
|
|
Manual flush
|
|
|
|
------------
|
|
|
|
|
|
|
|
You can trigger flush for indexes from CLI::
|
|
|
|
|
|
|
|
./typo3/cli_dispatch.phpsh extbase index:flush --identifiers 'pages'
|
|
|
|
./bin/typo3cms index:flush --identifiers 'pages'
|
|
|
|
|
|
|
|
This will flush the index for the table ``pages``. Flush means removing the index
|
|
|
|
from backend.
|
|
|
|
|
|
|
|
Multiple indices can be called by providing a comma separated list of identifiers as
|
|
|
|
a single argument. Spaces before and after commas are ignored.
|
2017-11-10 13:22:15 +01:00
|
|
|
|
2016-12-15 17:59:13 +01:00
|
|
|
.. _usage_auto_indexing:
|
|
|
|
|
|
|
|
Auto indexing
|
|
|
|
-------------
|
|
|
|
|
2016-12-16 12:55:23 +01:00
|
|
|
Indexing is done through hooks every time an record is changed.
|
2017-07-06 16:17:30 +02:00
|
|
|
The tables have to be configured via :ref:`configuration_options_index`.
|
2016-12-16 12:55:23 +01:00
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
Not all hook operations are supported yet, see :issue:`27`.
|
2016-12-20 09:26:52 +01:00
|
|
|
|
2017-11-10 12:31:06 +01:00
|
|
|
.. _usage_form_finisher:
|
|
|
|
|
|
|
|
Form finisher
|
|
|
|
-------------
|
|
|
|
|
|
|
|
A form finisher is provided to integrate indexing into form extension.
|
|
|
|
|
|
|
|
Add form finisher to your available finishers and configure it like:
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
-
|
|
|
|
identifier: SearchCoreIndexer
|
|
|
|
options:
|
|
|
|
action: 'delete'
|
|
|
|
indexIdentifier: 'fe_users'
|
|
|
|
recordUid: '{FeUser.user.uid}'
|
|
|
|
|
2018-03-08 08:17:41 +01:00
|
|
|
All three options are necessary, where:
|
2017-11-10 12:31:06 +01:00
|
|
|
|
|
|
|
``action``
|
|
|
|
Is one of ``delete``, ``update`` or ``add``.
|
|
|
|
``indexIdentifier``
|
|
|
|
Is a configured index identifier.
|
|
|
|
``recordUid``
|
|
|
|
Has to be the uid of the record to index.
|
|
|
|
|
2016-12-20 09:26:52 +01:00
|
|
|
.. _usage_searching:
|
|
|
|
|
|
|
|
Searching / Frontend Plugin
|
|
|
|
---------------------------
|
|
|
|
|
|
|
|
To provide a search interface you can insert the frontend Plugin as normal content element of type
|
|
|
|
plugin. The plugin is named *Search Core*.
|
2017-06-29 08:42:38 +02:00
|
|
|
|
|
|
|
Please provide your own template, the extension will not deliver a useful template for now.
|
|
|
|
|
2018-03-08 08:17:41 +01:00
|
|
|
The Extbase mapping is used, this way you can create a form:
|
2017-06-29 08:42:38 +02:00
|
|
|
|
|
|
|
.. code-block:: html
|
|
|
|
|
|
|
|
<f:form name="searchRequest" object="{searchRequest}">
|
|
|
|
<f:form.textfield property="query" />
|
|
|
|
<f:form.submit value="search" />
|
|
|
|
</f:form>
|
|
|
|
|
|
|
|
.. _usage_searching_filter:
|
|
|
|
|
|
|
|
Filter
|
|
|
|
""""""
|
|
|
|
|
2018-03-08 08:17:41 +01:00
|
|
|
Thanks to Extbase mapping, filter are added to the form:
|
2017-06-29 08:42:38 +02:00
|
|
|
|
|
|
|
.. code-block:: html
|
|
|
|
|
2017-07-06 16:17:30 +02:00
|
|
|
<f:form.textfield property="filter.exampleName" value="the value to match" />
|
|
|
|
|
|
|
|
.. _usage_searching_facets:
|
|
|
|
|
|
|
|
Facets
|
|
|
|
""""""
|
|
|
|
|
|
|
|
To add a facet as criteria for searching, use :ref:`usage_searching_filter`.
|
|
|
|
|
|
|
|
To display facet results use:
|
|
|
|
|
|
|
|
.. code-block:: html
|
|
|
|
|
|
|
|
<f:for each="{searchResult.facets}" as="facet">
|
|
|
|
<f:for each="{facet.options}" as="option">
|
|
|
|
<label for="{option.name}-desktop">
|
|
|
|
<f:form.checkbox value="{option.name}" property="filter.{facet.field}" />
|
|
|
|
{f:translate(id: 'search.filter.channel.{option.name}', default: option.name, extensionName: 'SitePackage')}
|
|
|
|
({option.count})
|
|
|
|
</label>
|
|
|
|
</f:for>
|
|
|
|
</f:for>
|
|
|
|
|