Download the PHP package cywolf/semantic-suggestion-solr without Composer

On this page you can find all versions of the php package cywolf/semantic-suggestion-solr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package semantic-suggestion-solr

Semantic Suggestion Solr

TYPO3 extension that displays related content suggestions using Solr. Supports two similarity algorithms: MLT (lexical) and SMLT (semantic hybrid, combining MLT + KNN vector search server-side).

Similarity modes

MLT — More Like This

Solr's built-in MLT compares term frequency (TF-IDF) across configurable fields (title, content, keywords). Fast, no external model needed.

SMLT — Semantic More Like This

A custom Solr SearchComponent that combines classical MLT with KNN vector search server-side in a single Solr request. Normalizes both score sets to [0,1] and merges them:

Default weights: 0.3 MLT / 0.7 vector (configurable per request).

Three internal sub-modes: hybrid (default), vector_only, mlt_only (useful for A/B testing).

Results are returned in a separate semanticMoreLikeThis response section, independent of the main search query.

Auto mode (default)

When similarityMode = auto, the algorithm is chosen automatically based on EXT:solr's TypoScript:

How it works

Cross-content-type suggestions

Suggestions can mix pages and news (or any indexed content type). By default, no type filter is applied, so a page about leather sewing machines may suggest both related pages and news articles about leather.

Use the allowedTypes setting (or FlexForm) to restrict suggestions to specific types if needed.

Language handling

EXT:solr maintains one core per site language. The plugin reads the current frontend language from the request and connects to the matching Solr core via ConnectionManager->getConnectionByRootPageId($rootPageId, $languageUid). Results are always in the same language as the current page.

Context detection

The plugin detects the current content type automatically:

Image enrichment

When showImage = 1, the extension resolves the first media file for each suggestion:

Requirements

Installation

Flush TYPO3 caches, then include the extension's static TypoScript in the site template.

SMLT setup (Semantic More Like This)

1. Build and deploy the SMLT JAR

The Java source is in .ddev/typo3-solr/smlt-plugin/. Build with Maven:

Copy the JAR to the Solr typo3lib directory (alongside solr-typo3-plugin-6.0.0.jar):

2. Register the SearchComponent in solrconfig.xml

Add to vendor/.../configsets/ext_solr_13_1_0/conf/solrconfig.xml:

And add <str>smlt</str> to the /select handler's <arr name="last-components">.

3. Set vector field to stored=true

In general_schema_fields.xml, ensure the vector field has stored="true":

4. Enable vector indexing and re-index

Re-initialize the Index Queue and run the scheduler. Each document will be sent to the OpenAI embedding API during indexing.

Note: query.type = 1 also enables native KNN for the frontend search. If KNN doesn't work in your setup, set it back to 0 after re-indexing. The SMLT component works independently — it reads pre-indexed vectors directly, regardless of query.type.

5. Set the similarity mode

Or use auto (default) to let the extension detect query.type automatically.

News indexing

To include news articles in Solr (required for cross-type suggestions), add the index queue configuration in your sitepackage TypoScript:

Then initialize the news index queue and run the Solr indexer.

Usage

As a content element

Insert the plugin "Similar content (Solr)" via the backend. The FlexForm provides per-instance settings:

In a Fluid template

Via TypoScript (auto-render on all pages)

Then render {semanticSuggestionsSolr -> f:format.raw()} in your page layout.

Use includePageTrees / excludePageTrees to control which page trees show suggestions (see Visibility below).

Configuration

TypoScript constants

All settings under plugin.tx_semanticsuggestionsolr_suggestions.settings.

Similarity algorithm

Setting Default Description
similarityMode auto Algorithm: auto, mlt, or smlt
maxResults 6 Max suggestions returned

MLT parameters

Setting Default Description
minTermFreq 1 Minimum term frequency (mlt.mintf)
minDocFreq 1 Minimum document frequency (mlt.mindf)
mltFields content,title,keywords Fields used for similarity
boostFields content^0.5,title^1.2,keywords^2.0 Field weights (mlt.qf)

SMLT parameters

Setting Default Description
smltMode hybrid Internal mode: hybrid, vector_only, mlt_only
smltMltWeight 0.3 Weight for MLT score in hybrid mode (0.0-1.0)
smltVectorWeight 0.7 Weight for vector score in hybrid mode (0.0-1.0)

Relevance filtering

Applies to both MLT and SMLT. Use these to drop weakly-related suggestions.

Setting Default Description
minScoreRatio 0 Keep only suggestions scoring at least X% of the best result. 0 = off, 0.3 = lenient, 0.5 = balanced, 0.7 = strict. Preferred over minScore in most cases.
minScore 0 Absolute score floor below which suggestions are hidden. SMLT range: 0-1 (try 0.3-0.7); MLT range depends on the corpus. 0 = off.

Visibility

Control which page trees show suggestions. Both settings accept comma-separated parent page UIDs. A page "matches" a tree when the parent UID appears anywhere in its rootline (the page itself or any ancestor). This works identically across all site languages.

Setting Default Description
includePageTrees (empty) Show only in these page trees. Empty = show everywhere (default). Example: 130,42
excludePageTrees (empty) Never show in these page trees. Exclude takes priority over include. Example: 1,95

Example: show suggestions only in the News section (page 130) and Blog (page 42), but never on the Legal page (135):

Display

Setting Default Description
allowedTypes (empty) Whitelist of Solr types. Empty = all (pages + news mixed).
excludeContentTypes (empty) Blacklist. Only used when allowedTypes is empty.
filterByPids (empty) Restrict to specific parent pages / storage folders
showScore 0 Display the relevance score + active mode badge
showContentType 1 Display a type badge (Page, News, etc.)
showImage 1 Display the first media image of each suggestion

FlexForm vs TypoScript

FlexForm settings (per content element) override TypoScript settings for the same keys.

Multi-language support

The extension is fully multi-language aware:

Architecture

SMLT Solr SearchComponent

Solr API parameters:

Parameter Default Description
smlt false Enable the component
smlt.id (required) Source document Solr ID
smlt.count 5 Number of results
smlt.mode hybrid hybrid, vector_only, mlt_only
smlt.mltWeight 0.3 MLT weight in hybrid mode
smlt.vectorWeight 0.7 Vector weight in hybrid mode
smlt.vectorField vector DenseVectorField name
smlt.mltFields title,content,keywords Fields for MLT

Solr access chain

Suggestion data structure

Each suggestion returned by the service:

Template customization

Override the template path via TypoScript:

Then create Suggestions/List.html in that directory. Available template variables: {suggestions} (array) and {settings} (merged TypoScript + FlexForm).

License

GPL-2.0-or-later


All versions of semantic-suggestion-solr with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
typo3/cms-core Version ^13.4
typo3/cms-extbase Version ^13.4
typo3/cms-fluid Version ^13.4
apache-solr-for-typo3/solr Version ^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cywolf/semantic-suggestion-solr contains the following files

Loading the files please wait ...