-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] add ext. Solr support (#485)
* [WIP] require composer * [TASK] implement solr url modifier * [TASK] make header template compatible with new solr * [TASK] add special configuration file for solr * [TASK] make suggest script compatible with new solr suggest * [TASK] remove url modifier for solr * [TASK] new TypoScript solr configuration * [TASK] changes in solr templates according to changes in solr 9 * [TASK] add backward compatibility template for document results * [TASK] remove comma and semicolon in suggest.js * [TASK] compile less and css * [TASK] mvoe suggest solr configuration
- Loading branch information
Showing
14 changed files
with
252 additions
and
41 deletions.
There are no files selected for viewing
7 changes: 2 additions & 5 deletions
7
Configuration/TypoScript/ApplicationContext/development.docker.setupts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
[applicationContext = Development/Docker] | ||
#[applicationContext = Development/Docker] | ||
|
||
# set solr host to t3kit_solr | ||
plugin.tx_solr.solr.host = t3kit_solr | ||
|
||
[global] | ||
#[global] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
<div class="tx_solr"> | ||
<f:render section="main" /> | ||
</div> |
44 changes: 44 additions & 0 deletions
44
Resources/Private/Extensions/Solr/Partials/Result/Document.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" | ||
xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers" | ||
xmlns:s="http://typo3.org/ns/ApacheSolrForTypo3/Solr/ViewHelpers"> | ||
|
||
<f:section name="Document"> | ||
|
||
<li class="results-entry{f:if(condition:document.isElevated, then: ' results-elevated')}" | ||
data-document-score="{document.score}" | ||
data-document-id="{document.id}" | ||
data-document-url="{document.url}" | ||
> | ||
<f:if condition="{document.isElevated}"> | ||
<div class="results-elevated-label"><s:translate key="sponsored"/></div> | ||
</f:if> | ||
|
||
<h5 class="results-topic"><a href="{s:uri.result.addSearchWordList(url:document.url, searchWords:resultSet.usedQuery.keywords)}">{document.title}</a></h5> | ||
|
||
<div class="results-teaser"> | ||
<f:render partial="Result/RelevanceBar" section="RelevanceBar" arguments="{resultSet:resultSet, document:document}" /> | ||
|
||
<p class="result-content">{s:document.highlightResult(resultSet:resultSet, document:document, fieldName:'content')}</p> | ||
|
||
<f:if condition="{document.type} == 'tx_solr_file'"> | ||
<p> | ||
<s:translate key="file_mimetype" />: {document.fileMimeType}<br /> | ||
<s:translate key="file_referenced" />: | ||
|
||
<ul class="references"> | ||
<f:if condition="{document.fileReferenceUrl}"> | ||
<li><f:link.typolink title="{document.fileReferenceTitle}" parameter="{document.fileReferenceUrl}">{document.fileReferenceTitle}</f:link.typolink></li> | ||
</f:if> | ||
<f:if condition="{document.variants}"> | ||
<f:for each="{document.variants}" as="variant"> | ||
<li><f:link.typolink title="{variant.fileReferenceTitle}" parameter="{variant.fileReferenceUrl}">{variant.fileReferenceTitle}</f:link.typolink></li> | ||
</f:for> | ||
</f:if> | ||
</ul> | ||
</p> | ||
</f:if> | ||
<s:debug.documentScoreAnalyzer document="{document}" /> | ||
</div> | ||
</li> | ||
|
||
</f:section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" | ||
xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers" | ||
xmlns:s="http://typo3.org/ns/ApacheSolrForTypo3/Solr/ViewHelpers/"> | ||
|
||
<f:layout name="Main"/> | ||
|
||
<f:section name="main"> | ||
<f:render partial="Search/Form" section="Form" arguments="{search:search, additionalFilters:additionalFilters, pluginNamespace:pluginNamespace}" /> | ||
</f:section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
Resources/Private/Extensions/Solr/TypoScript/Includes/suggest.typoscript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Enable search field autocomplete/suggest | ||
# Ajaxify the suggest/results | ||
tx_solr_suggest = PAGE | ||
tx_solr_suggest { | ||
typeNum = 7384 | ||
config { | ||
disableAllHeaderCode = 1 | ||
xhtml_cleaning = 0 | ||
admPanel = 0 | ||
additionalHeaders = Content-type: text/plain | ||
no_cache = 0 | ||
} | ||
|
||
10 = USER | ||
10 { | ||
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run | ||
extensionName = Solr | ||
pluginName = pi_suggest | ||
vendorName = ApacheSolrForTypo3 | ||
controller = Suggest | ||
action = suggest | ||
} | ||
} | ||
|
||
# Enable suggest | ||
plugin.tx_solr.search { | ||
suggest = 1 | ||
suggest { | ||
numberOfSuggestions = 10 | ||
suggestField = spell | ||
} | ||
} |
97 changes: 97 additions & 0 deletions
97
Resources/Private/Extensions/Solr/TypoScript/IndexConfiguration/solr_news.typoscript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
|
||
plugin.tx_solr.index.queue { | ||
|
||
news = 1 | ||
news { | ||
table = tx_news_domain_model_news | ||
|
||
fields { | ||
abstract = teaser | ||
|
||
author = author | ||
authorEmail_stringS = author_email | ||
|
||
title = title | ||
|
||
datetime_stringS = TEXT | ||
datetime_stringS { | ||
field = datetime | ||
date = d.m.Y H:i | ||
} | ||
|
||
datetime_dateS = TEXT | ||
datetime_dateS { | ||
field = datetime | ||
date = Y-m-d\TH:i:s\Z | ||
} | ||
|
||
content = SOLR_CONTENT | ||
content { | ||
cObject = COA | ||
cObject { | ||
10 = TEXT | ||
10 { | ||
field = bodytext | ||
noTrimWrap = || | | ||
} | ||
} | ||
} | ||
|
||
category_stringM = SOLR_RELATION | ||
category_stringM { | ||
localField = categories | ||
multiValue = 1 | ||
} | ||
|
||
keywords = SOLR_MULTIVALUE | ||
keywords { | ||
field = keywords | ||
} | ||
|
||
tags_stringM = SOLR_RELATION | ||
tags_stringM { | ||
localField = tags | ||
multiValue = 1 | ||
} | ||
|
||
url = CASE | ||
url { | ||
key.field = type | ||
|
||
# Internal | ||
1 = TEXT | ||
1 { | ||
if.isTrue.field = internalurl | ||
typolink.parameter.field = internalurl | ||
typolink.useCacheHash = 1 | ||
typolink.returnLast = url | ||
} | ||
|
||
# External | ||
2 = TEXT | ||
2 { | ||
if.isTrue.field = externalurl | ||
field = externalurl | ||
} | ||
|
||
default = TEXT | ||
default { | ||
typolink.parameter = {$themes.configuration.features.newsDefaultDetailPid} | ||
typolink.additionalParams = &tx_news_pi1[controller]=News&tx_news_pi1[action]=detail&tx_news_pi1[news]={field:uid}&L={field:__solr_index_language} | ||
typolink.additionalParams.insertData = 1 | ||
typolink.useCacheHash = 1 | ||
typolink.returnLast = url | ||
} | ||
} | ||
} | ||
|
||
attachments = 1 | ||
attachments { | ||
fields = fal_related_files | ||
fileExtensions = * | ||
} | ||
} | ||
|
||
} | ||
|
||
plugin.tx_solr.logging.indexing.queue.news = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.