craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.28k stars 635 forks source link

Can't search expired entries in the CP #10670

Closed Tam closed 2 years ago

Tam commented 2 years ago

Description

When searching through entries, whether the view status is set to All or Expired, expired entries are never returned.

Steps to reproduce

  1. Mark an entry as expired
  2. Search for the entry

Additional info

Plugin Version
Control Panel JS 2.4.0
Control Panel Nav 3.0.17
DigitalOcean Spaces Volume 1.1.3
Download Assets 1.0.2
Easy Search 1.0.3
Field Manager 2.2.4
Formie 1.5.10
GraphQL Authentication 1.12.3
Jason 2.0.1
Logs 3.0.5
Maps 3.9.3
Notes 1.0.6
Redactor 2.10.5
Searchit 1.0.8
Super Table 2.7.1
Two-Factor Authentication 2.10.0
brandonkelly commented 2 years ago

Strange… not able to reproduce that.

Screenshot of searching for “barrel” and an expired entry with “barrel” in the title is included in the results

Can you try running the following command for one of the entries you know to be expired?

php craft resave/entries --element-id=1234 --update-search-index
alexjcollins commented 2 years ago

Thanks for coming back to us on this one @brandonkelly

I gave that a go for one of the entries and got this response: No entries exist for that criteria.

So, feeling brave, I ran the resave command without the element-id flag. Strangely, for us, it only had 119 entries to save when I know that we have around 5,000 entries.

It's worth mentioning that we have multiple sites set up (30), and 16 sections. Some of the sections are set up to only save for the site they're created in and others save to all sites. In that list of 119, I observed entry titles that I believe, belong in sections of both types.

I think, possibly, that the entries not showing up are ones that have generated titles; all of the ones in the list of 119 had manually input titles (the majority of our sections have generated titles).

brandonkelly commented 2 years ago

Ah, you will need to pass the --site argument, set to the handle of the site you wish to resave the entries in.

alexjcollins commented 2 years ago

That's done it! Thanks very much 😃

brandonkelly commented 2 years ago

Sweet, glad to hear!