Skip to content

v3: Support for Silverstripe 6#28

Merged
blueo merged 6 commits intomainfrom
feature/v3-silverstripe-6
Sep 11, 2025
Merged

v3: Support for Silverstripe 6#28
blueo merged 6 commits intomainfrom
feature/v3-silverstripe-6

Conversation

@chrispenny
Copy link
Copy Markdown
Contributor

@chrispenny chrispenny commented May 15, 2025

Breaking changes

Return type : self

We love to override classes with Injector in the Silverstripe community. There were a bunch of public methods that had a return type declaration of self, which would not be correct if you extended the class.

  • : self: static

Error logging

Fixes #12
Closes #12

Previously we were using LoggerInterface::error(), with the intension that the error is logged, but the client response can continue as a 200. It turns out that using error() changes the response to a 500, which goes against the original intention.

The Adaptor classes now log to warning() instead of error(), so that the response can be returned.

Results, Suggestions

In line with the above, we want to provide more information about errors in our result objects (Results for search results, and Suggestions for query/spelling suggestions). So that you can, for example, respond to a 401 error, or a 500 error in different ways.

Replaced methods:

  • setSuccess(): Replaced with setStatusCode()
    • isSuccess() will now respond according to the status code set

“index name”

This module had 1/2 of an assumption built in that you would need to support multiple environments for your application. Broadly speaking, I think that assumption has now been proven true.

Something that then becomes confusing when using this module is that it quite often asks for an “index name”, but then it actually expecting you to have provided an “index suffix” (because it’s going to prepend your environment onto that to turn it into the actual full index name).

What I would like to make clear in this new major is what the module is asking for, and when. You might still need to read documentation to understand what an “index prefix” or “index suffix” is, but at least the code will now refer to the correct thing at the correct time; instead of just always saying “index name” and then you having to figure out whether that mean “prefix”, “suffix”, or the full “name”.

SearchService

New construct requirement:

  • indexPrefix: Covered by a default configuration which sets this to the value of your SS_ENVIRONMENT_TYPE

Argument name changes:

  • $indexName$indexSuffix

New methods:

  • environmentizeIndex(): A standardised implementation for the transformation applied to "index suffix" to turn it into a full "index name"

AnalyticsData

Consistent use of the word "index" (rather than "engine").

Renamed methods:

  • getEngineName()getIndexName()
  • setEngineName()setIndexName()

Template data key change:

  • engineNameindexName

@chrispenny chrispenny force-pushed the feature/v3-silverstripe-6 branch 10 times, most recently from 19d1d5a to a803830 Compare May 16, 2025 03:07
@chrispenny chrispenny force-pushed the feature/v3-silverstripe-6 branch 2 times, most recently from 1af1254 to d33e498 Compare July 8, 2025 22:00
@chrispenny chrispenny force-pushed the feature/v3-silverstripe-6 branch 2 times, most recently from 12580c4 to 088cebc Compare July 14, 2025 22:33
@chrispenny chrispenny force-pushed the feature/v3-silverstripe-6 branch from 088cebc to bffba7d Compare July 18, 2025 02:21
@chrispenny chrispenny force-pushed the feature/v3-silverstripe-6 branch 2 times, most recently from de5c0a6 to 61070b6 Compare July 28, 2025 01:18
@chrispenny chrispenny force-pushed the feature/v3-silverstripe-6 branch from 61070b6 to ba01ec0 Compare July 28, 2025 01:30
@chrispenny chrispenny marked this pull request as ready for review July 28, 2025 02:02
@blueo blueo merged commit 734d6c7 into main Sep 11, 2025
8 checks passed
@blueo blueo deleted the feature/v3-silverstripe-6 branch September 11, 2025 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants