Created
May 14, 2019 22:06
-
-
Save wilr/1e70c7ab8efba86174dd506832229c2c to your computer and use it in GitHub Desktop.
solr-issues-silverstripe
This file contains 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
--- a/app/src/Search/CustomerSolrIndex.php | |
+++ b/app/src/Search/CustomerSolrIndex.php | |
@@ -9,10 +9,14 @@ use SilverStripe\Control\Director; | |
*/ | |
class CustomerSolrIndex extends GazetteSolrIndex | |
{ | |
+ private static $casting = [ | |
+ 'FieldDefinitions' => 'HTMLFragment', | |
+ 'CopyFieldDefinitions' => 'HTMLFragment' | |
+ ]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While upgrading to SilverStripe 4 I found that my custom Solr indexes stopped working with the following error
default search field '_text' not defined or not indexed.
Upon checking the
schema.xml
file - it would be in a mess e.g<field name="_spellcheckText" type="textSpellHtml" indexed="true" stored="false" multivalued="true"></field></field></field></field></field></field></field></field></field>
.The issue - I have overloaded
getFieldDefinitions
to modify the XML but it was being returned as a string object (SilverStripe 4 no longer assumes the parents function casting).