« Previous -
Version 60/84
(diff) -
Next » -
Current version
Ingo Renner, 2012-01-09 10:33
fix some TS paths
tx_solr.search¶
The search section, you probably already guessed it, provides configuration options for the all things related to actually searching the index, setting query parameters, formatting and processing result documents and the result listing.
- tx_solr.search
- query
- results
- highlighting
- spellchecking
- lastSearches
- frequentSearches
- sorting
- faceting
- faceting
- faceting.minimumCount
- faceting.sortBy
- faceting.limit
- faceting.singleFacetMode
- faceting.removeFacetLinkText
- faceting.showAllLink.wrap
- faceting.showEmptyFacets
- faceting.facetLinkATagParams
- faceting.facets
- faceting.facets.[facetName] - single facet configuration
- faceting.facets.[facetName].field
- faceting.facets.[facetName].label
- faceting.facets.[facetName].selectingSelectedFacetOptionRemovesFilter
- faceting.facets.[facetName].keepAllOptionsOnSelection
- faceting.facets.[facetName].singleOptionMode
- faceting.facets.[facetName].operator
- faceting.facets.[facetName].sortBy
- faceting.facets.[facetName].includeInAvailableFacets
- faceting.facets.[facetName].renderer
- faceting.facets.[facetName].filterParser
- faceting.facets.[facetName].renderingInstruction
- faceting.facets.[facetName].facetLinkATagParams
filter¶
Since: 1.0
Default:
Type: String
Adds additional parameters to the search initialization.
targetPage¶
Since: 1.0
Default: 0
Type: Integer
Sets the target page ID for links. If it is empty or 0, the current page ID will be used.
initializeWithEmptyQuery¶
Since: version:1.4
Default: 0
Options: 0,1
Type: Boolean
If enabled, the results plugin (pi_results) issues a "get everything" query during initialization. This is useful, if you want to create a page that shows all available facets although no search has been issued by the user yet. Note: Enabling this option alone will not show results of the get everything query. To also show the results of the query, see option showResultsOfInitialEmptyQuery below.
showResultsOfInitialEmptyQuery¶
Since: version:1.4
Default: 0
Options: 0,1
Type: Boolean
Requires initializeWithEmptyQuery (above) to be enabled to have any effect. If enabled together with initializeWithEmptyQuery the results of the initial "get everything" query are shown. This way, in combination with a filter you can easily list a predefined set of results.
keepExistingParametersForNewSearches¶
Since: 2.0
Default: 0
Options: 0,1
Type: Boolean
When doing a new search, existing parameters like filters will be carried over to the new search. This is useful for a scenario where you want to list all available documents first, then allow the user to filter the documents using facets and finally allow him to specify a search term to refine the search.
query¶
The query sub-section defines a few query parameters for the query that will be sent to the Solr server later on. Some query parameters are also generated and set by the extension itself, f.e. when using facets.
query.allowEmptyQuery¶
Since: version:1.4
Default: 0
Options: 0,1
Type: Boolean
If enabled, empty queries are allowed.
query.fields¶
Since: 1.0
Default: content^40.0, title^5.0, keywords^2.0, tagsH1^5.0, tagsH2H3^3.0, tagsH4H5H6^2.0, tagsInline^1.0
Type: String
Defines what fields to search in the index. Fields are defined as a comma separated list. Each field can be given a boost by appending the boost value separated by the ^ character, that's Lucene query language. The boost value itself is a float value, pay attention to using a dot as the separator for the fractions. Use this option to add more fields to search.
The boost take influence on what score a document gets when searching and thus how documents are ranked and listed in the search results. A higher score will move documents up in the result listing. The boost is a multiplier for the original score value of a document for a search term.
By default if a search term is found in the content field the documents gets scored / ranked higher as if a term was found in the title or keywords field. Although the default should provide a good setting, you can play around with the boost values to find the best ranking for your content.
query.minimumMatch¶
Since: 1.2, 2.0
Default: (empty)
See: http://wiki.apache.org/solr/DisMaxRequestHandler#mm_.28Minimum_.27Should.27_Match.29
Type: String
Sets the minimum match mm query parameter.
By default the mm query parameter is set in solrconfig.xml as 2<-35%. This means that for queries with less than three words they all must match the searched fields of a document. For queries with three or more words at least 65% of them must match rounded up.
Please consult the link to the Solr wiki for a more detailed description of the mm syntax.
query.boostFunction¶
Since: 1.2, 2.0
Default: (empty)
See: http://wiki.apache.org/solr/DisMaxRequestHandler#bf_.28Boost_Functions.29
Type: String
Sets the boost function bf query parameter.
Allows to further manipulate the score of a document by using mathematical functions and field values of the current document.
A common use case for boost functions is to rank newer documents higher than older ones.
Please consult the link to the Solr wiki for a more detailed description of boost functions.
results¶
results.siteHighlighting¶
Since: 2.0
Default: 0
Type: Boolean
Activates TYPO3's highlighting of search words on the actual pages. The words a user searched for will be wrapped with a span and css class csc-sword
Highlighting can be styled using the CSS class csc-sword, you need to add the style definition yourself for the complete site.
results.resultsPerPage¶
Since: 1.0
Default: {$plugin.tx_solr.search.results.resultsPerPage}
Type: Integer
Sets the number of shown results per page.
results.resultsPerPageSwitchOptions¶
Since: 1.0
Default: 10, 20, 30, 50
Type: String
Defines the shown options of possible results per page.
results.fieldProcessingInstructions¶
Since: 1.0
Options: timestamp, utf8Decode, skip
Type: cObject
Mapping of fieldname to processing instructions. Available instructions: timestamp, utf8Decode, skip (removes the field from the result).
results.fieldRenderingInstructions¶
Since: 1.0
Type: cObject
Additional rendering instructions for specified fields.
results.ignorePageBrowser¶
Since: 1.0
Default: 0
Options: 0, 1
Type: Boolean
If enabled, the selected page will be ignored an results by the first record.
results.showDocumentScoreAnalysis¶
Since: 2.0
Default: 0
Options: 0,1
Type: Boolean
If enabled, the analysis and display of the score analysis for logged in backend users will be initialized.
results.markResultTypeBoundaries¶
Since: 2.0, 2.5-dkd
Default: 0
Options: 0,1
Type: Boolean
This option allows for some kind of fake or client side (EXT:solr being the client) grouping of results. First you need to sort results by the type field. Then whenever the type field changes during rendering of the results, special fields are added to the documents at the result document type boundary. In your template you can then use an IF condition to insert markup at those boundaries based on those fields' values. The special document field names are "typeBegin" and "typeEnd". They have a value set to the new/old document type appended with "_begin"/"end".
Example:
A result set with documents of types tt_news, pages, and tt_address:
1 pages -> typeBegin = pages_begin 2 pages 3 pages -> typeEnd = pages_end 4 tt_address -> typeBegin = tt_address_begin 5 tt_address 6 tt_address -> typeEnd = tt_address_end 7 tt_news -> typeBegin = tt_news_begin 8 tt_news 9 tt_news -> typeEnd = tt_news_end
Example template snippet:
<!-- ###LOOP:RESULT_DOCUMENTS### begin --> <!-- ###LOOP_CONTENT### --> <!-- ###IF:###RESULT_DOCUMENT.typeBegin###|==|pages_begin### begin --> <li>Pages</li> <!-- ###IF:###RESULT_DOCUMENT.typeBegin###|==|pages_begin### end --> <! -- ... regular page results here ... --> <!-- ###IF:###RESULT_DOCUMENT.typeEnd###|==|pages_end### begin --> <li>Pages End</li> <!-- ###IF:###RESULT_DOCUMENT.typeEnd###|==|pages_end### end --> ... <!-- ###IF:###RESULT_DOCUMENT.typeBegin###|==|tt_address_begin### begin --> <li>Contacts</li> <!-- ###IF:###RESULT_DOCUMENT.typeBegin###|==|tt_address_begin### end --> <!-- ###IF:###RESULT_DOCUMENT.typeBegin###|==|tt_news_begin### begin --> <li>News</li> <!-- ###IF:###RESULT_DOCUMENT.typeBegin###|==|tt_news_begin### end --> <! -- ... more markup here ... --> <!-- ###LOOP_CONTENT### --> <!-- ###LOOP:RESULT_DOCUMENTS### end -->
highlighting¶
highlighting¶
Since: 1.0
Default: 0
Type: Boolean
Set plugin.tx_solr.highlighting = 1 to enable search term highlighting.
highlighting.highlightFields¶
Since: 1.0
Default: title,content
Type: String
Should be a comma- or space-delimited list of fields to generate highlighted snippets for.
highlighting.fragmentSize¶
Since: 1.0
Default: 200
Type: Integer
The size, in characters, of fragments to consider for highlighting. "0" indicates that the whole field value should be used (no fragmenting).
highlighting.wrap¶
Since: 1.0
Default: <span class="results-highlight">|</span>
Type: String
This is used to format the highlighted parts.
spellchecking¶
spellchecking¶
Since: 1.0
Default: 0
Type: Boolean
Set plugin.tx_solr.search.spellchecking = 1 to enable spellchecking / did you mean.
spellchecking.wrap¶
Since: 1.0
Default: |<div class="spelling-suggestions">###LLL:didYouMean### |</div>|
Type: String
This is used to format spelling suggestions.
lastSearches¶
lastSearches¶
Since: version:1.3-dkd
Default: 0
Type: Boolean
Set plugin.tx_solr.lastSearches = 1 to display a list of the last searches.
lastSearches.limit¶
Since: version:1.3-dkd
Default: 10
Type: Integer
Defines the number of last searches, that should get minded.
lastSearches.mode¶
Since: version:1.3-dkd
Default: user
Options: user, global
Type: String
If mode is user, keywords will get stored into the session. If mode is global keywords will get stored into the database.
frequentSearches¶
frequentSearches¶
Since: version:1.3-dkd
Default: 0
Type: Boolean
Set plugin.tx_solr.search.frequentSearches = 1 to display a list of the frequent / common searches.
frequentSearches.minSize¶
Since: version:1.3-dkd
Default: 14
Type: Integer
The difference between frequentSearches.maxSize and frequentSearches.minsize is getting used for calculating the current step.
frequentSearches.maxSize¶
Since: version:1.3-dkd
Default: 32
Type: Integer
The difference between frequentSearches.maxSize and frequentSearches.minsize is getting used for calculating the current step.
frequentSearches.limit¶
Since: version:1.3-dkd
Default: 20
Type: Integer
Defines the maximum size of the list by frequentSearches.select.
frequentSearches.select¶
Since: version:1.3-dkd
Type: cObject
Defines a database connection for retrieving statistics.
sorting¶
sorting¶
Since: 1.0
Default: 0
Type: Boolean
Set plugin.tx_solr.search.sorting = 1 to allow sorting of results.
sorting.defaultOrder¶
Since: 1.0
Default: ASC
Options: ASC, DESC
Type: String
Sets the order of sortings.
sorting.options¶
This is a list of sorting options. Each option has a field and label to be used. By default the options title, type, author, and created are configured, plus the virtual relevancy field which is used for sorting by default.
sorting.options.[optionName].label¶
Since: 1.0
Type: String
Defines the name of the option's label.
sorting.options.[optionName].field¶
Since: 1.0
Type: String / stdWrap
Defines the option's field, supports stdWrap.
faceting¶
faceting¶
Since: 1.0
Default: 0
Type: Boolean
Set plugin.tx_solr.faceting = 1 to enable faceting.
faceting.minimumCount¶
Since: 1.0
Default: 1
Type: Integer
See: http://wiki.apache.org/solr/SimpleFacetParameters#facet.mincount
This indicates the minimum counts for facet fields should be included in the response.
faceting.sortBy¶
Since: 1.0
Default: count
Options: count, index, 1, 0, true, false, alpha (1.2, 2.0), lex (1.2, 2.0)
See: http://wiki.apache.org/solr/SimpleFacetParameters#facet.sort
Type: String
Defines how facet options are sorted, by default they are sorted by count of results, highest on top. count, 1, true are aliases for each other.
Facet options can also be sorted alphabetically (lexicographic by indexed term) by setting the option to index. index, 0, false, alpha (from version 1.2 and 2.0), and lex (from version 1.2 and 2.0) are aliases for index.
faceting.limit¶
Since: 1.0
Default: 10
Type: Integer
Number of options to display per facet. If more options are returned by Solr, they are hidden and can be expanded by clicking on a "show more" link. This feature uses a small javascript function to collapse/expand the additional options.
faceting.singleFacetMode¶
Since: 1.2, 2.0
Default: 0
Options: 0, 1
Type: Boolean
If enabled, the user can only use one facet at a time.
Lets say you have you have two facets configured, type and author. If the user selects a facet option from type its filter is added to the query. Normally when selecting another option from the other facet - the author facet - this would lead to having two facet filters applied to the query. When this option is activated the option from the author facet will simply replace the first option from the type facet.
faceting.removeFacetLinkText¶
Since: 1.0
Default: @facetText (remove)
Type: String
Defines the text for a link used for removing a given facet from the search results.
faceting.showAllLink.wrap¶
Since: 1.0
Default: <li>|</li>
Type: String
Defines the output of the "Show more" link, that is rendered if there are more facets given than set by faceting.limit.
faceting.showEmptyFacets¶
Since: 1.3
Default: 1
Options: 0, 1
Type: Boolean
By setting this option to 0, you can prevent rendering of empty facets. Usually, although a facet does not offer any options to filter a set of result documents, the facet header might still be shown depending on the template. Using this option prevents the header from appearing when no filter options are provided.
faceting.facetLinkATagParams¶
Since: 2.0
Type: String
With this option you have the possibility to add A-Tag attributes for links of all facet-options.
1 plugin.tx_solr.search.faceting.facetLinkATagParams = class="green"
faceting.facets¶
Since: 1.0
Default: type, author
See: http://wiki.apache.org/solr/SolrFacetingOverview
Type: cObject
Defines on which fields you want to facet. It's a list of facet configurations.
1 plugin.tx_solr.search.faceting.facets {
2 // type is the name of the facet configuration, you can choose whatever name
3 type {
4 field = type // the index field you want to create a facet from
5 label = Content Type // a label
6 sortBy = index // sorte the facet options alphabetically, otherwise they are sorted by count, options with more results on top
7
8 keepAllOptionsOnSelection = 1 // if set allows to choose more than one option from this facet
9 operator = OR // used in combination with keepAllOptionsOnSelection to set how multiple options from one facet are combined, can also be AND
10 selectingSelectedFacetOptionRemovesFilter = 1 // boolean; if enabled, the facet options behave like switches. On first selection they add the filter for the facet option, on a second click they will remove the filter again. Currently requires keepAllOptionsOnSelection to be set to use this.
11 }
12
13 myOtherFacet {
14 ...
15 }
16 }
faceting.facets.[facetName] - single facet configuration¶
You can add new facets by simply adding a new facet configuration in TypoScript. [facetName] represents the facet's name and acts as a configuration "container" for a single facet. All configuration options for a facet are defined within that "container".
A facet will use the values of a configured index field to offer these values as filter options to your site's visitors. You need to make sure that the facet field's type allows to sort the field's value; like string, int, and other primitive types.
To configure a facet you only need to provide the label and field configuration options, all other configuration options are optional.
faceting.facets.[facetName].field¶
Since: 1.0
Type: String
Required
Which field to use to create the facet.
faceting.facets.[facetName].label¶
Since: 1.0
Type: String
Required
Used as a headline or title to describe the options of a facet.
faceting.facets.[facetName].selectingSelectedFacetOptionRemovesFilter¶
Since: 1.2, 2.0
Default: 0
Options: 0, 1
Type: Boolean
Activating this option for a facet makes the facet's option links behave like on/off switches: You click them once to activate a facet, you click them a second time to deactivate the facet again.
Feel free to suggest a better name for this option...
faceting.facets.[facetName].keepAllOptionsOnSelection¶
Since: 1.2, 2.0
Default: 0
Options: 0, 1
Type: Boolean
Normally, when clicking any option link of a facet this would result in only that one option being displayed afterwards. By setting this option to one, you can prevent this. All options will still be displayed.
This is useful if you want to allow the user to select more than one option from a single facet.
faceting.facets.[facetName].singleOptionMode¶
Since: 1.3, 2.0
Default: 0
Options: 0, 1
Type: Boolean
When enabled together with keepAllOptionsOnSelection a user can select one option of the facet only at a time. Selecting a different option than the currently selected option results in the new option to replace the old one. The behavior thus is similar to a select box or a set of radio buttons.
This option can not be used together with selectingSelectedFacetOptionRemovesFilter as it overrides its behavior.
faceting.facets.[facetName].operator¶
Since: 1.2, 2.0
Default: AND
Options: OR, AND
Type: String
When configuring a facet to allow selection of multiple options, you can use this option to decide whether multiple selected options should be combined using AND or OR.
faceting.facets.[facetName].sortBy¶
Since: 1.2
Default: -
Options: alpha (aliases: index, lex)
Type: String
Sets how a single facet's options are sorted, by default they are sorted by number of results, highest on top.
Facet options can also be sorted alphabetically by setting the option to alpha.
faceting.facets.[facetName].includeInAvailableFacets¶
Since: 1.3
Default: 1
Options: 0, 1
Type: Boolean
By setting this option to 0, you can prevent rendering of a given facet within the available facets list.
This is pretty helpful if you render the facet yourself using a view helper and don't want the facet to be rendered twice.
faceting.facets.[facetName].renderer¶
Since: 1.6-dkd
Type: Class name
Defines an alternative renderer class for a facet. The class must implement interface tx_solr_FacetRenderer
Available facet types / renderers:- tx_solr_facet_HierarchicalFacetRenderer - render hierarchical facets, indexed using the "pathToHierarchy" field processing instruction
- tx_solr_facet_DateRangeFacetRenderer - renders two date input fields with date picker
faceting.facets.[facetName].filterParser¶
Since: version:1.7-dkd
Type: Class name
A class name that is used to create a filter parser to turn filter GET parameter generated by a facet renderer (see above) into a Lucene filter. This is useful to have a more readable filter GET parameter in the URL, but sill being able to use Lucene filters internally.
Available filter parser:- tx_solr_query_filterparser_DateRange - resolve a date range filter created by tx_solr_facet_DateRangeFacetRenderer
Example: URL GET parameter for a date range as generated by tx_solr_facet_DateRangeFacetRenderer: dateCreated:200910010000-201107012359 (format is YYYYMMDDHHMM) Transformed into a Lucene filter by tx_solr_query_filterparser_DateRange: created:[2009-10-01T00:00:00Z TO 2011-07-01T23:59:59Z]
faceting.facets.[facetName].renderingInstruction¶
Since: 1.0
Type: cObject
Overwrites how single facet options are rendered using TypoScript cObjects.
Example: (taken from issue #5920)
1 plugin.tx_solr {
2 search {
3 faceting {
4 facets {
5 type {
6 renderingInstruction = CASE
7 renderingInstruction {
8 key.field = optionValue
9
10 pages = TEXT
11 pages.value = Pages
12 pages.lang.de = Seiten
13
14 tx_solr_file = TEXT
15 tx_solr_file.value = Files
16 tx_solr_file.lang.de = Dateien
17
18 tt_news = TEXT
19 tt_news.value = News
20 tt_news.lang.de = Nachrichten
21 }
22 }
23
24 language {
25 renderingInstruction = CASE
26 renderingInstruction {
27 key.field = optionValue
28
29 0 = TEXT
30 0.value = English
31 0.lang.de = Englisch
32
33 1 = TEXT
34 1.value = German
35 1.lang.de = Deutsch
36 }
37 }
38 }
39 }
40 }
41 }
faceting.facets.[facetName].facetLinkATagParams¶
Since: 2.0
Type: String
With this option you have the possibility to add A-Tag attributes for all option-links of a single facet.
This option overwrites the global setting "faceting.facetLinkATagParams".
Check up "faceting.facetLinkATagParams" for more information.