EXT:solr
The academic extensions ship no search configuration. This page shows the index queues a site needs to find profiles of EXT:academic_persons and the pages of EXT:academic_programs, EXT:academic_projects and EXT:academic_partners with EXT:solr.
Note
Written for EXT:solr 13.1 on TYPO3 v13 and checked against the source of release 13.1.4. This repository does not install EXT:solr, so nothing on this page is covered by a test. A section for TYPO3 v14 follows once an EXT:solr release for it has been checked.
The TypoScript below belongs to the site package, after the TypoScript of EXT:solr.
Profiles
Profiles are records, so they get an index queue of their own that names the
table. The text of a profile is spread over several rich text fields, and the
link leads to the detail plugin on the page that the constant
plugin. names, the detail page the
list plugins link to unless a content element names another one:
plugin.tx_solr.index.queue {
profiles = 1
profiles {
type = tx_academicpersons_domain_model_profile
fields {
title = TEXT
title {
value = {field:title} {field:first_name} {field:last_name}
insertData = 1
}
content = SOLR_CONTENT
content {
cObject = COA
cObject {
10 = TEXT
10.field = teaching_area
10.noTrimWrap = || |
20 = TEXT
20.field = core_competences
20.noTrimWrap = || |
30 = TEXT
30.field = supervised_thesis
30.noTrimWrap = || |
40 = TEXT
40.field = supervised_doctoral_thesis
40.noTrimWrap = || |
50 = TEXT
50.field = miscellaneous
}
}
url = TEXT
url {
typolink.parameter = {$plugin.tx_academicpersons.detailPid}
typolink.additionalParams = &tx_academicpersons_detail[controller]=Profile&tx_academicpersons_detail[action]=detail&tx_academicpersons_detail[profile]={field:uid}&L={field:__solr_index_language}
typolink.additionalParams.insertData = 1
typolink.returnLast = url
}
}
}
}
The arguments of the link are those of the detail plugin, namespace
tx_. A site that imports the route enhancer
EXT: gets the speaking
URL of the profile for this link, as for every other link to a profile.
There is no column free_ in any version of
EXT:academic_persons, so a mapping to it stays empty. The text
columns of the profile are the five above, and
title
,
first_,
middle_ and
last_ hold the name. The publications,
projects and other entries of a profile are records of
tx_ and are not part of
this queue.
EXT:solr indexes the records whose folder lies inside the page tree of the site.
Profiles kept in a folder outside of it need the uid of that folder in
additional of the queue.
Program, project and partner pages
Programs, projects and partners are pages of their own page type, so EXT:solr
indexes them like any other page, by rendering them. Its queue pages covers
the page types 1 and 7 only. A queue per page type, copied from pages, keeps
them apart in the index. Each copy names its table with
type
:
plugin.tx_solr.index.queue {
programs < plugin.tx_solr.index.queue.pages
programs {
type = pages
allowedPageTypes = 20
additionalWhereClause = doktype = 20 AND no_search = 0
fields.academicPageType_stringS = TEXT
fields.academicPageType_stringS.value = program
}
projects < plugin.tx_solr.index.queue.pages
projects {
type = pages
allowedPageTypes = 30
additionalWhereClause = doktype = 30 AND no_search = 0
fields.academicPageType_stringS = TEXT
fields.academicPageType_stringS.value = project
}
partners < plugin.tx_solr.index.queue.pages
partners {
type = pages
allowedPageTypes = 40
additionalWhereClause = doktype = 40 AND no_search = 0
fields.academicPageType_stringS = TEXT
fields.academicPageType_stringS.value = partner
}
}
| Page type | Doktype | Extension |
|---|---|---|
| Program | 20 | EXT:academic_programs |
| Project | 30 | EXT:academic_projects |
| Partner | 40 | EXT:academic_partners |
What makes this work in EXT:solr 13.1:
- EXT:solr takes the table of a queue from
type, and from the name of the queue whentypeis not set. The initializer of a copiedpagesqueue readspageseither way, but the check that queues a page again after an editor changed it does not. Withouttype = pagesa program page is indexed when the queue is initialized, a later change of the page never reaches the index, and moving the page removes it from the index. - EXT:solr checks a page against the
allowedof the queue it is added to, and against those of every enabled queue when no queue is named. The queuePage Types pagestherefore keeps its own value. - The
fieldsof a copied queue are applied to its pages only. The dynamic fieldacademicabove gives a search a value to filter or facet by.Page Type_ string S - The Solr field
typeof a document cannot be set by a mapping: EXT:solr refuses it with the exception 1435441863. Every document of these queues has the typepages, and the field above is what tells them apart. - A scheduler task Re-Index that names one of these queues
removes every document of the type
pagesof the site from the index before it queues the pages again, not the pages of that queue only.