Closed markhowardnz closed 6 years ago
Can you please show the version of silverstripe/fulltextsearch you're using? I believe we've fixed this in master (reference: https://github.com/silverstripe/silverstripe-fulltextsearch/pull/204) and updating your version to 3.x-dev might fix it.
Looks like it's pulling:
{
"name": "silverstripe/fulltextsearch",
"version": "3.0.0-rc1",
"source": {
"type": "git",
"url": "https://github.com/silverstripe/silverstripe-fulltextsearch.git",
"reference": "10344580c9905fa3a9ee97c529e877ad1aa58ad2"
},
Will tweak my composer dependencies to point fulltextsearch to 3.x-dev and report back.
Looks like changing fulltextsearch to 3.x-dev has sorted it.
I've gone explicit and added the following to composer.json:
"silverstripe/fulltextsearch": "3.x-dev",
"silverstripe/fulltextsearch-localsolr": "dev-master"
Running vendor/bin/sake dev/tasks/Solr_Configure now produces no errors and I see that ElementalSolrIndex has been successfully created in the solr logs.
Cool. We'll be tagging a new release of fulltextsearch in the coming days. Thanks for reporting!
No worries. Thanks for your extremely fast and helpful response to the issue - It is very much appreciated.
With a default Silverstripe setup, plus the dnadesign/silverstripe-elemental and silverstripe/fulltextsearch-localsolr dependencies, I cannot successfully run vendor/bin/sake dev/tasks/Solr_Configure
I have project which is happily using Elemental. I then add the fulltextsearch-localsolr dependency and follow the instructions on https://github.com/silverstripe/silverstripe-fulltextsearch/blob/master/docs/en/Solr.md
I configure the SS _config.php and create my own subclass of SolrIndex. I get as far as running vendor/bin/sake dev/tasks/Solr_Configure
At this point, the Solr_Configure task finds my index and works OK, then finds the ElementalSolrIndex class and tries to build that index. It fails with:
This appears to happen because my Page class has empty arrays arrays for $db and $has_one, which is "sanity checked" in for in SearchIndex->addClass(). According to the check, Page has no database fields. For some reason, the check does not consider fields defined in a superclass as being part of the "field set".
My Page.php implementation is the same as the one provided by the default "silverstripe/recipe-cms": "1.0.2@stable" package. All my other CMS page types are subclasses of Page, and I haven't needed to modify the provided/default Page class.
I understand that the ElementalSolrIndex is intended to be more of an "example" - is there any way to stop it being picked up and used by Solr_Configure? It's a useful reference, but I don't actually need to build that index!
The dependency lines from my composer:
Happy to provide a git repo with test case if it helps.