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

Support configuring the SearchIndexListener behaviour #983

Merged
merged 5 commits into from
Nov 27, 2019

Conversation

Toflar
Copy link
Member

@Toflar Toflar commented Nov 14, 2019

This will allow to configure how the SearchIndexListener behaves.
Right now it updates the index when the response was successful and it deletes it from the index, if it was not.

If you have cronjobs doing that work for you, you may want to disable that listener completely or have it e.g. only delete from the index. You can configure all 4 possible states using the config now:

contao:
    search:
        listener:
            index: true
            delete: false

@Toflar Toflar requested review from leofeyer and ausi November 14, 2019 14:50
ausi
ausi previously approved these changes Nov 14, 2019
@leofeyer
Copy link
Member

I think I would prefer to configure the listener like this:

contao:
    search:
        default_indexer:
            enable: true
        listener:
            index: true
            delete: true

IMHO this is more understandable and less error-prone than a string.

@Toflar
Copy link
Member Author

Toflar commented Nov 27, 2019

Configuration simplified as suggested in cf3de3b.

@Toflar Toflar requested review from leofeyer and ausi November 27, 2019 09:02
@Toflar
Copy link
Member Author

Toflar commented Nov 27, 2019

All tests pass, merged master too. This should be RTM.

@Toflar Toflar self-assigned this Nov 27, 2019
@Toflar Toflar added the feature label Nov 27, 2019
@Toflar Toflar added this to the 4.9 milestone Nov 27, 2019
@leofeyer leofeyer merged commit b71024e into master Nov 27, 2019
@leofeyer
Copy link
Member

Thank you @Toflar.

@Toflar Toflar deleted the feature/searchindexlistener-configuration branch November 27, 2019 11:41
@leofeyer leofeyer changed the title Added support for configuring the SearchIndexListener behaviour Support configuring the SearchIndexListener behaviour Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants