Conversation
19d1d5a to
a803830
Compare
1af1254 to
d33e498
Compare
12580c4 to
088cebc
Compare
088cebc to
bffba7d
Compare
de5c0a6 to
61070b6
Compare
61070b6 to
ba01ec0
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Breaking changes
Return type
: selfWe 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→: staticError 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 a200. It turns out that usingerror()changes the response to a500, which goes against the original intention.The Adaptor classes now log to
warning()instead oferror(), so that the response can be returned.Results,SuggestionsIn line with the above, we want to provide more information about errors in our result objects (
Resultsfor search results, andSuggestionsfor query/spelling suggestions). So that you can, for example, respond to a401error, or a500error in different ways.Replaced methods:
setSuccess(): Replaced withsetStatusCode()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”.
SearchServiceNew construct requirement:
indexPrefix: Covered by a default configuration which sets this to the value of yourSS_ENVIRONMENT_TYPEArgument name changes:
$indexName→$indexSuffixNew methods:
environmentizeIndex(): A standardised implementation for the transformation applied to "index suffix" to turn it into a full "index name"AnalyticsDataConsistent use of the word "index" (rather than "engine").
Renamed methods:
getEngineName()→getIndexName()setEngineName()→setIndexName()Template data key change:
engineName→indexName