meilisearch/Configuration/TypoScript/Meilisearch/setup.typoscript

395 lines
11 KiB
Plaintext
Raw Permalink Normal View History

2021-04-17 00:26:33 +02:00
plugin.tx_meilisearch {
2021-04-17 21:20:54 +02:00
enabled = {$plugin.tx_meilisearch.enabled}
enableDebugMode = 0
2021-04-17 00:26:33 +02:00
2021-04-17 21:20:54 +02:00
general {
dateFormat.date = d.m.Y H:i
}
2021-04-17 00:26:33 +02:00
2021-04-24 04:44:44 +02:00
view {
pluginNamespace = tx_meilisearch
templateRootPaths {
0 = EXT:meilisearch/Resources/Private/Templates/
10 = {$plugin.tx_meilisearch.view.templateRootPath}
2021-04-17 21:20:54 +02:00
}
2021-04-17 00:26:33 +02:00
2021-04-24 04:44:44 +02:00
partialRootPaths {
0 = EXT:meilisearch/Resources/Private/Partials/
10 = {$plugin.tx_meilisearch.view.partialRootPath}
2021-04-17 21:20:54 +02:00
}
2021-04-24 04:44:44 +02:00
layoutRootPaths {
0 = EXT:meilisearch/Resources/Private/Layouts/
10 = {$plugin.tx_meilisearch.view.layoutRootPath}
}
}
meilisearch {
scheme = {$plugin.tx_meilisearch.meilisearch.scheme}
host = {$plugin.tx_meilisearch.meilisearch.host}
port = {$plugin.tx_meilisearch.meilisearch.port}
apiKey = {$plugin.tx_meilisearch.meilisearch.apiKey}
2021-04-17 21:20:54 +02:00
}
2021-04-17 00:26:33 +02:00
2021-04-17 21:20:54 +02:00
index {
additionalFields {
2021-04-17 00:26:33 +02:00
2021-04-17 21:20:54 +02:00
}
2021-04-17 00:26:33 +02:00
2021-04-17 21:20:54 +02:00
// assigns processing instructions to Meilisearch fields during indexing, Meilisearch field = processing instruction
fieldProcessingInstructions {
changed = timestampToIsoDate
created = timestampToIsoDate
endtime = timestampToUtcIsoDate
rootline = pageUidToHierarchy
}
2021-04-17 00:26:33 +02:00
2021-04-17 21:20:54 +02:00
queue {
2021-04-17 00:26:33 +02:00
2021-04-17 21:20:54 +02:00
pages = 1
pages {
initialization = WapplerSystems\Meilisearch\IndexQueue\Initializer\Page
2021-04-17 00:26:33 +02:00
2021-04-17 21:20:54 +02:00
// allowed page types (doktype) when indexing records from table "pages"
allowedPageTypes = 1,4,7
2021-04-17 00:26:33 +02:00
2021-04-17 21:20:54 +02:00
indexingPriority = 0
indexer = WapplerSystems\Meilisearch\IndexQueue\PageIndexer
indexer {
// add options for the indexer here
}
2021-04-17 00:26:33 +02:00
2021-04-17 21:20:54 +02:00
// Only index standard pages and mount points that are not overlayed.
additionalWhereClause = (doktype = 1 OR doktype=4 OR (doktype=7 AND mount_pid_ol=0)) AND no_search = 0
//exclude some html parts inside TYPO3SEARCH markers by classname (comma list)
excludeContentByClass = typo3-search-exclude
fields {
sortSubTitle_stringS = subtitle
}
}
}
}
search {
// fields that are allowed to contain html and should be skipped during escaping after retrieval from Meilisearch
// by default all fields except url get escaped, you might need to add other url fields here as well because of &
// characters in the url.
trustedFields = url
targetPage = {$plugin.tx_meilisearch.search.targetPage}
initializeWithEmptyQuery = 0
showResultsOfInitialEmptyQuery = 0
initializeWithQuery =
showResultsOfInitialQuery = 0
keepExistingParametersForNewSearches = 0
ignoreGlobalQParameter = 0
query {
allowEmptyQuery = 0
allowedSites = __meilisearch_current_site
// qf parameter http://wiki.apache.org/meilisearch/DisMaxQParserPlugin#qf_.28Query_Fields.29
queryFields = content^40.0, title^5.0, keywords^2.0, tagsH1^5.0, tagsH2H3^3.0, tagsH4H5H6^2.0, tagsInline^1.0, description^4.0, abstract^1.0, subtitle^1.0, navtitle^1.0, author^1.0
// fl parameter http://wiki.apache.org/meilisearch/CommonQueryParameters#fl
returnFields = *, score
// see http://wiki.apache.org/meilisearch/DisMaxRequestHandler#mm_.28Minimum_.27Should.27_Match.29
minimumMatch =
// see http://wiki.apache.org/meilisearch/DisMaxRequestHandler#bf_.28Boost_Functions.29
boostFunction =
// see http://wiki.apache.org/meilisearch/DisMaxQParserPlugin#bq_.28Boost_Query.29
boostQuery =
// see http://lucene.apache.org/meilisearch/guide/7_0/the-dismax-query-parser.html#the-tie-tie-breaker-parameter
tieParameter =
filter {
}
sortBy =
// see https://lucene.apache.org/meilisearch/guide/7_0/the-dismax-query-parser.html#TheDisMaxQueryParser-Thepf_PhraseFields_Parameter
// EXT:Meilisearch configures Schemas from Meilisearch to use content field with boost of 2.0 per default.
// By enabling of phrase search, Meilisearch will build a phrase queries for a list of defined fields(phrase.fields) and boost the documents containing the terms in defined proximity(phrase.slop).
// phrase.querySlop
phrase = 0
phrase {
// Note: Those are field for implicit phrase searching. On explicit "phrase searching" Meilisearch uses queryFields("qf" parameter)
fields = content^10.0, title^10.0, tagsH1^10.0, tagsH2H3^10.0, tagsH4H5H6^10.0, tagsInline^10.0, description^10.0, abstract^10.0, subtitle^10.0, navtitle^10.0
// The number of words between words in query phrase is the slop-value.
// e.g. on query phrase "Hello World"
// @ slop = 0 will math "Hello World" but not "Hello wonderful World"
// @ slop = 1 will math "Hello World" and/or "Hello wonderful World"
// Note: this value is for implicit phrase searching(without double quotes)
slop = 0
// The concept of query slop is similar to phrase.slop but it applies to the explicit phrase queries from the user and to match documents instead of boosting.
// Also if the user uses double quotes in the search term, then
// the query slop value is used and
// the result contains only the documents with those phrase.
// see https://lucene.apache.org/meilisearch/guide/7_0/the-extended-dismax-query-parser.html http://lucene.472066.n3.nabble.com/Query-slop-vs-phrase-slop-td1637041.html
// Note: this value is for explicit "phrase searching"(with double quotes)
querySlop = 0
}
// bigram phrase functionality is similar to the Ngram filters, difference is that
// filters strip down the words to chars(char combinations)
// bigraming phrases strip down the sentence to the two-word combinations(phrases)
// e.g. "bigraming phrases strip down the sentence to phrases" generates following
// "bigraming phrases"
// "phrases strip"
// "strip down"
// "down the"
// "the sentence"
// "sentence to"
// "to phrases"
// Note: The triplets phrases will be stripped down to two two-word phrases
bigramPhrase = 0
bigramPhrase {
fields = content^10.0, title^10.0, tagsH1^10.0, tagsH2H3^10.0, tagsH4H5H6^10.0, tagsInline^10.0, description^10.0, abstract^10.0, subtitle^10.0, navtitle^10.0
slop = 0
}
// Please see bigram phrases. Difference to bi is tri, which means building of triplets phrases.
// e.g. "trigraming phrases strip down the sentence to triplets phrases" generates following triplets
// "trigraming phrases strip"
// "phrases strip down"
// "strip down the"
// "down the sentence"
// "the sentence to"
// "sentence to triplets"
// "to triplets phrases"
trigramPhrase = 0
trigramPhrase {
fields = content^10.0, title^10.0, tagsH1^10.0, tagsH2H3^10.0, tagsH4H5H6^10.0, tagsInline^10.0, description^10.0, abstract^10.0, subtitle^10.0, navtitle^10.0
slop = 0
}
}
results {
resultsHighlighting = 0
resultsHighlighting {
highlightFields = content
fragmentSize = 200
fragmentSeparator = [...]
wrap = <span class="results-highlight">|</span>
}
siteHighlighting = 0
resultsPerPage = {$plugin.tx_meilisearch.search.results.resultsPerPage}
resultsPerPageSwitchOptions = 10, 25, 50
showDocumentScoreAnalysis = 0
}
spellchecking = 0
spellchecking {
wrap = |<div class="spelling-suggestions">###LLL:didYouMean### |</div>|
searchUsingSpellCheckerSuggestion = 0
numberOfSuggestionsToTry = 1
}
lastSearches = 0
lastSearches {
limit = 10
// tracking mode "user" or "global"
mode = user
}
frequentSearches = 0
frequentSearches {
useLowercaseKeywords = 0
minSize = 14
maxSize = 32
limit = 20
select {
SELECT = keywords as search_term, count(*) as hits
FROM = tx_meilisearch_statistics
ADD_WHERE = AND num_found != 0
GROUP_BY = keywords
ORDER_BY = hits DESC, search_term ASC
checkRootPageId = 1
checkLanguage = 1
}
// cache lifetime in seconds (default is 86400s = 24h)
cacheLifetime = 86400
}
sorting = 0
sorting {
defaultOrder = asc
options {
relevance {
field = relevance
label = Relevance
}
title {
field = sortTitle
label = Title
}
type {
field = type
label = Type
}
author {
field = sortAuthor
label = Author
}
created {
field = created
label = Creation Date
}
}
}
faceting = 0
faceting {
minimumCount = 1
sortBy = count
limit = 10
showEmptyFacets = 0
keepAllFacetsOnSelection = 0
facetLinkUrlParameters =
facets {
type {
label = Content Type
field = type
2021-04-17 00:26:33 +02:00
}
2021-04-17 21:20:54 +02:00
}
showAllLink.wrap = <li>|</li>
}
elevation = 0
elevation {
markElevatedResults = 1
forceElevation = 1
}
variants = 0
variants {
expand = 1
// variantField needs to be a string or a numeric field
variantField = variantId
limit = 10
}
}
suggest = 0
suggest {
numberOfSuggestions = 10
suggestField = spell
forceHttps = 0
showTopResults = 1
numberOfTopResults = 5
}
statistics = 0
statistics {
anonymizeIP = 1
}
logging {
exceptions = 1
debugOutput = 0
indexing {
indexQueueInitialization = 0
missingTypo3SearchMarkers = 1
pageIndexed = 0
queue {
pages = 0
}
}
query {
filters = 0
searchWords = 0
queryString = 0
rawPost = 0
rawGet = 0
rawDelete = 0
}
}
features {
requireCHashArgumentForActionArguments = 0
useRawDocuments = 1
}
2021-04-17 00:26:33 +02:00
}
# Provide typoscript libraries
2021-04-17 21:20:54 +02:00
lib.meilisearch_extbase_bootstrap = USER
lib.meilisearch_extbase_bootstrap {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
vendorName = WapplerSystems
extensionName = Meilisearch
settings < plugin.tx_meilisearch.settings
persistence < plugin.tx_meilisearch.persistence
view < plugin.tx_meilisearch.view
2021-04-17 00:26:33 +02:00
}
2021-04-17 21:20:54 +02:00
plugin.tx_meilisearch_PiResults_Results < lib.meilisearch_extbase_bootstrap
2021-04-17 00:26:33 +02:00
plugin.tx_meilisearch_PiResults_Results = USER_INT
plugin.tx_meilisearch_PiResults_Results {
2021-04-17 21:20:54 +02:00
pluginName = pi_results
switchableControllerActions {
Search {
1 = results
2 = form
}
}
2021-04-17 00:26:33 +02:00
}
2021-04-17 21:20:54 +02:00
plugin.tx_meilisearch_PiSearch_Search < lib.meilisearch_extbase_bootstrap
2021-04-17 00:26:33 +02:00
plugin.tx_meilisearch_PiSearch_Search {
2021-04-17 21:20:54 +02:00
pluginName = pi_search
switchableControllerActions {
Search {
1 = form
}
}
2021-04-17 00:26:33 +02:00
}
2021-04-17 21:20:54 +02:00
plugin.tx_meilisearch_PiFrequentSearches_FrequentSearches < lib.meilisearch_extbase_bootstrap
2021-04-17 00:26:33 +02:00
plugin.tx_meilisearch_PiFrequentSearches_FrequentSearches {
2021-04-17 21:20:54 +02:00
pluginName = pi_frequentlySearched
switchableControllerActions {
Search {
1 = frequentlySearched
}
}
2021-04-17 00:26:33 +02:00
}