TASK: Update docs

Document new configuration options and adjust configuration where
necessary.
This commit is contained in:
Daniel Siepmann 2017-07-06 16:17:30 +02:00
parent 3e2e889e27
commit dfde4b8f6b
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
9 changed files with 103 additions and 36 deletions

View file

@ -24,7 +24,7 @@ Currently only :ref:`Elasticsearch` is provided.
Indexing
--------
The indexing is done by one of the available indexer. It should be possible to define the indexer to
use for certain document types. Also it should be possible to write custom indexer to use.
The indexing is done by one of the available indexer. For each identifier it's possible to define
the indexer to use. Also it's possible to write custom indexer to use.
Currently only the :ref:`TcaIndexer` is provided.

View file

@ -96,8 +96,8 @@ The following settings are available. For each setting its documented which conn
.. _configuration_options_index:
index
^^^^^
Indexing
^^^^^^^^
Holds settings regarding the indexing, e.g. of TYPO3 records, to search services.
@ -108,7 +108,7 @@ Configured as::
settings {
indexing {
identifier {
indexer = Fully Qualified Classname
indexer = FullyQualifiedClassname
// the settings
}
}
@ -161,3 +161,51 @@ options are available:
Make sure to prefix all fields with the corresponding table name. The selection from
database will contain joins and can lead to SQL errors if a field exists in multiple tables.
.. _mapping:
``mapping``
"""""""""""
Used by: Elasticsearch connection while indexing.
Define mapping for Elasticsearch, have a look at the official docs: https://www.elastic.co/guide/en/elasticsearch/reference/5.2/mapping.html
You are able to define the mapping for each property / columns.
Example::
plugin.tx_searchcore.settings.indexing.tt_content.mapping {
CType {
type = keyword
}
}
The above example will define the ``CType`` field of ``tt_content`` as ``type: keyword``. This
makes building a facet possible.
.. _configuration_options_search:
Searching
^^^^^^^^^
.. _facets:
``facets``
"""""""""""
Used by: Elasticsearch connection while building search query.
Define aggregations for Elasticsearch, have a look at the official docs: https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-aggregations-bucket-terms-aggregation.html
Currently only the term facet is provided.
Example::
plugin.tx_searchcore.settings.searching.facets {
contentTypes {
field = CType
}
}
The above example will provide a facet with options for all found ``CType`` results together
with a count.

View file

@ -22,5 +22,9 @@ The connection is configurable through the following options:
* :ref:`port`
* :ref:`mapping`
* :ref:`facets`
.. _elastic Elasticsearch: https://www.elastic.co/products/elasticsearch
.. _elastica: http://elastica.io/

View file

@ -32,9 +32,10 @@ Then setup your system::
git clone git@github.com:DanielSiepmann/search_core.git \
&& cd search_core \
&& export typo3DatabaseName="searchcoretest62" \
&& export TYPO3_VERSION="~6.2" \
&& export typo3DatabaseName="searchcoretest76" \
&& export TYPO3_VERSION="~7.6" \
&& make install \
&& make unitTests \
&& make functionalTests
If all tests are okay, start your work.
@ -42,8 +43,8 @@ If all tests are okay, start your work.
If you are working with multiple TYPO3 versions make sure to export `typo3DatabaseName` and
`TYPO3_VERSION` in your environment like::
export typo3DatabaseName="searchcoretest76"
export TYPO3_VERSION="~7.6"
export typo3DatabaseName="searchcoretest62"
export TYPO3_VERSION="~6.2"
Also run the install command for each version before running any tests. Only this will make sure you
are testing against the actual TYPO3 Version and database scheme.

View file

@ -13,7 +13,7 @@ Indexing
Indexing data to Elasticsearch is provided. The extension delivers an indexer for TCA with zero
configuration needs. Still it's possible to configure the indexer.
Own indexer are not possible yet, but will.
Also custom classes can be used as indexers.
.. _features_search:
@ -24,6 +24,9 @@ Currently all fields are searched for a single search input.
Also multiple filter are supported. Filtering results by fields for string contents.
Even facets / aggregates are now possible. Therefore a mapping has to be defined in TypoScript for
indexing, and the facets itself while searching.
.. _features_planned:
Planned
@ -31,11 +34,5 @@ Planned
The following features are currently planned and will be integrated:
#. Mapping Configuration
Allowing to configure the whole mapping, to define type of input, e.g. integer, keyword.
#. Facets / Aggregates
Based on the mapping configuration, facets will be configurable and fetched. Therefore mapping is
required and we will adjust the result set to be of a custom model providing all information in a
more clean way.
#. Pagination
Add a pagination to search results, to allow users to walk through all results.

View file

@ -6,7 +6,7 @@ Installation
The extension can be installed through composer::
composer require "leonmrni/search_core dev-feature/integrate-elasticsearch"
composer require "leonmrni/search_core dev-master as 1.0.x-dev"
or by `downloading`_ and placing it inside the :file:`typo3conf/ext`-Folder of your installation.
In that case you need to install all dependencies yourself. Dependencies are:
@ -16,8 +16,7 @@ In that case you need to install all dependencies yourself. Dependencies are:
:lines: 19-21
:dedent: 8
Afterwards you need to enable the extension through the extension manager and include the static
typoscript setup.
TypoScript setup.
.. _downloading: https://github.com/DanielSiepmann/search_core/archive/feature/integrate-elasticsearch.zip
.. _downloading: https://github.com/DanielSiepmann/search_core/archive/master.zip

View file

@ -18,7 +18,7 @@ reindexing.
Current state
-------------
This is still a very early alpha version. More information can be taken from Github at
This is still a very early beta version. More information can be taken from Github at
`current issues`_ and `current projects`_.
We are also focusing on Code Quality and Testing through `travis ci`_, `scrutinizer`_ and `codacy`_.

View file

@ -11,12 +11,12 @@ Manual indexing
You can trigger indexing from CLI::
./typo3/cli_dispatch.phpsh extbase index:index --table 'tt_content'
./typo3/cli_dispatch.phpsh extbase index:index --identifier 'tt_content'
This will index the table ``tt_content`` using the :ref:`TcaIndexer`.
Only one table per call is available, to index multiple tables just make multiple calls.
The tables have to be white listed through :ref:`allowedTables` option.
Only one index per call is available, to run multiple indexers, just make multiple calls.
The indexers have to be defined in TypoScript via :ref:`configuration_options_index`.
.. _usage_auto_indexing:
@ -24,7 +24,7 @@ Auto indexing
-------------
Indexing is done through hooks every time an record is changed.
The tables have to be white listed through :ref:`allowedTables` option.
The tables have to be configured via :ref:`configuration_options_index`.
.. note::
@ -57,10 +57,28 @@ Filter
Thanks to extbase mapping, filter are added to the form:
.. code-block:: html
:emphasize-lines: 3
<f:form name="searchRequest" object="{searchRequest}">
<f:form.textfield property="query" />
<!-- Case sensitive for fields of type keyword. -->
<f:form.textfield property="filter.exampleName" value="the value to match" />
<f:form.submit value="search" />
</f:form>
.. _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>

View file

@ -4,6 +4,7 @@ $EM_CONF[$_EXTKEY] = [
'title' => 'Search Core',
'description' => 'Search core for implementing various search types.',
'category' => 'be',
'clearCacheOnLoad' => 1,
'constraints' => [
'depends' => [
'typo3' => '7.6.0-7.6.99',
@ -16,9 +17,8 @@ $EM_CONF[$_EXTKEY] = [
'Leonmrni\\SearchCore\\' => 'Classes',
],
],
'state' => 'alpha',
'clearCacheOnLoad' => 1,
'state' => 'beta',
'version' => '1.0.0',
'author' => 'Daniel Siepmann',
'author_email' => 'coding@daniel-siepmann.de',
'version' => '1.0.0',
];