You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have inherited an older Silverstripe 3.7 site, running version 2.5 of this module. Working well.
This model that the Index uses is being extended to have a new field called "Hidden".
class Tour extends Product
{
private static $db = [
'TourName' => 'Varchar(50)',
'TourDescription' => 'HTMLText',
'TourLengthDays' => 'Int',
'Hidden' => 'Boolean', // <--- New field added
];
}
I have added this new field to the existing Index:
class TourIndex extends SolrIndex {
function init() {
$this->addClass('Tour');
// Fields for searching
$this->addFulltextField('TourName');
$this->addFulltextField('TourDescription');
// Fields we filter on
$this->addFilterField('TourLengthDays', 'Int');
$this->addFilterField('Hidden', 'Boolean');
}
}
I then run the following process:
Delete public_html/.solr
sake /dev/tasks/Solr_Configure
sake /dev/tasks/Solr_Reindex
No errors on either task. Output from both looks as it usually does. However when I look at the Schema Browser in Solr, Hidden is not present. Same thing if I manually open ./solr/TourIndex/conf/schema.xml. The new field is just not there. I have tried changing the type passed to $this->addFilterField('Hidden', 'Int'); but no difference.
Am I missing a step? I can't see another config file relating to existing fields anywhere.
The text was updated successfully, but these errors were encountered:
Update: I stepped debugged Solr_Configure locally and I see it using renderWith() on schema.ss. When I inspect the string in that, it most definately shows the new field being added.
But it doesn't appear in the final schema.xml when running the task on Production. But I was running the commands via CLI instead of browser. When I repeated the process and ran them in browser, the index was all good. I imagine a template cache thing between CLI and Browser.
I have inherited an older Silverstripe 3.7 site, running version 2.5 of this module. Working well.
This model that the Index uses is being extended to have a new field called "Hidden".
I have added this new field to the existing Index:
I then run the following process:
No errors on either task. Output from both looks as it usually does. However when I look at the Schema Browser in Solr,
Hidden
is not present. Same thing if I manually open./solr/TourIndex/conf/schema.xml
. The new field is just not there. I have tried changing the type passed to$this->addFilterField('Hidden', 'Int');
but no difference.Am I missing a step? I can't see another config file relating to existing fields anywhere.
The text was updated successfully, but these errors were encountered: