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

Add explicit throw methods for getting index state and fields #762

Merged

Conversation

aprudhomme
Copy link
Contributor

IndexState.getField(name), GlobalState.getIndex(name), and GlobalState.getIndexStateManager(name) all throw an IllegalArgumentException if the index/field does not exist. This makes it harder to handles cases where something not existing is acceptable.

I modified these methods to return null instead of throwing an exception. Separate methods have been added (*OrThrow()) that preserve the status quo behavior. Almost all existing usage of these methods has been change to use the throwing version. The DocLookup in the IndexState uses the non-throwing version, as this provides consistent behavior with the lookup created during search request processing.

None of the currently ported plugins use this api, so they should still be compatible.

The example-plugin test is expected to fail until it gets updated for the alpha.2 release.

@aprudhomme aprudhomme requested a review from sarthakn7 October 9, 2024 02:07
@aprudhomme aprudhomme merged commit dfd991f into Yelp:main Oct 9, 2024
1 check failed
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

Successfully merging this pull request may close these issues.

2 participants