Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibly unwanted Entries in Index #21

Open
scholejo opened this issue Apr 12, 2024 · 2 comments
Open

Possibly unwanted Entries in Index #21

scholejo opened this issue Apr 12, 2024 · 2 comments

Comments

@scholejo
Copy link

Thanks for this really cool plugin! I have some questions or feature requests though:

I was looking into the after save events and recognized that there is no check against the index criteria. So in theory it would be possible that an unwanted entry could appear in a collection.
For example if I defined my index criteria to include a check if a Lightswitch Field 'includeInSearch' was true that wouldn't be checked in the after save event, wouldn't it? So eventually if I unchecked this field in an entry and saved it, that entry would still be sent to the index.

Also it seems to me that an entry which could match the criteria for more than one collection would only be updated in one collection automatically. For such cases it would actually be necessary to check against all collections and update the entry in all matching collections.

Besides that I think it would be nice to have another console command to check for expired events like the scheduled posts command. Right now expired entries don't get deleted automatically because Craft doesn't fire an event for that. So it's necessary to have the sync commands run as cron jobs to ensure that expired entries get deleted.

Also, I was having issues because I didn't stick to the naming schema for the 'section' attribute. I didn't recognize until today that it was more or less mandatory to name it like 'section.type'. It would be nice to have this mentioned in the Readme or docs.

@scholejo
Copy link
Author

Just a quick update because I actually observed unwanted Entries in my index now. I'm using this criteria:

->criteria(function (EntryQuery $query) {
        return $query->section('members')->level(1);
    });

but still there were Entries from lower levels in my index.

@michtio
Copy link
Contributor

michtio commented May 6, 2024

Thank you for mentioning. We are doing quite some rework on Typesense at the moment to improve it, we will definitely investigate your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants