studioespresso / craft-scout

Craft Scout provides a simple solution for adding full-text search to your entries. Scout will automatically keep your search indexes in sync with your entries.
MIT License
81 stars 54 forks source link

[STU-65] Only one index shows in the control panel #280

Closed tyssen closed 8 months ago

tyssen commented 8 months ago

I have two indices configured in scout.php e.g.

return [
    'indices' => [
        \rias\scout\ScoutIndex::create('reviews')
        ->elementType(\craft\elements\Entry::class)
        ->criteria(function (\craft\elements\db\EntryQuery $query) {
            return $query->section('reviews');
        })
        ->transformer(function (\craft\elements\Entry $entry) {

            return [
                'title' => $entry->title,
                …
            ];
        })
    ],
    [
        \rias\scout\ScoutIndex::create('articles')
        ->elementType(\craft\elements\Entry::class)
        ->criteria(function (\craft\elements\db\EntryQuery $query) {
            return $query->section('articles');
        })
        ->transformer(function (\craft\elements\Entry $entry) {

            return [
                'title' => $entry->title,
                …
            ];
        })
    ],
];

but when visiting /utilities/scout-indices I can only see the first one listed. Is that to be expected?

STU-65

janhenckens commented 8 months ago

Hey @tyssen, that seems like a bug (possibly introduced in #275). Will have a look and try to have a bugfix out over the weekend.

janhenckens commented 8 months ago

Hey @tyssen, it looks like your second index isn't in the "indices" key, is that just in this example?

Could you also let me know which version of Craft & Scout your are running? I can't reproduce it on my end with the current release (3.3.0).

tyssen commented 8 months ago

@janhenckens yep, sorry, I hadn't set that up quite right. Fixed now and I can see both of them in the control panel. Sorry for wasting your time.

janhenckens commented 8 months ago

No worries!