search_core/Documentation/source/usage.rst
Daniel Siepmann a3a46f5cb5
FEATURE: Provide command to delete whole index
This is necessary, e.g. for complete re-indexing.
2017-11-10 13:22:15 +01:00

2.5 KiB

Usage

Manual indexing

You can trigger indexing from CLI:

./typo3/cli_dispatch.phpsh extbase index:index --identifier 'tt_content'

This will index the table tt_content using the TcaIndexer.

Only one index per call is available, to run multiple indexers, just make multiple calls. The indexers have to be defined in TypoScript via configuration_options_index.

Manual deletion

You can trigger deletion for a single index from CLI:

./typo3/cli_dispatch.phpsh extbase index:delete --identifier 'tt_content'

This will delete the index for the table tt_content.

Only one delete per call is available, to run multiple deletions, just make multiple calls.

Auto indexing

Indexing is done through hooks every time an record is changed. The tables have to be configured via configuration_options_index.

Note

Not all hook operations are supported yet, see 27.

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.

Please provide your own template, the extension will not deliver a useful template for now.

The extbase mapping is used, this way you can create a form:

<f:form name="searchRequest" object="{searchRequest}">
    <f:form.textfield property="query" />
    <f:form.submit value="search" />
</f:form>

Filter

Thanks to extbase mapping, filter are added to the form:

<!-- Case sensitive for fields of type keyword. -->
<f:form.textfield property="filter.exampleName" value="the value to match" />

Facets

To add a facet as criteria for searching, use usage_searching_filter.

To display facet results use:

<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>