feat(analytics): add analytics rules and events support#72
Merged
kishorenc merged 3 commits intotypesense:masterfrom Nov 4, 2024
Merged
feat(analytics): add analytics rules and events support#72kishorenc merged 3 commits intotypesense:masterfrom
kishorenc merged 3 commits intotypesense:masterfrom
Conversation
Initial implementation of Analytics rules API for the Typesense Java client. Includes CRUD operations for analytics rules and corresponding test coverage. The changes include: - New Analytics, AnalyticsRule, and AnalyticsRules classes - Analytics rules integration in Client class - Comprehensive test coverage for analytics operations - Documentation updates showcasing how to use the new feature feat(analytics): implement Analytics class feat(analytics): add AnalyticsRule class for individual rule operations feat(analytics): add AnalyticsRules class for bulk operations test(analytics): add comprehensive test coverage for analytics rules refactor(client): integrate analytics support docs(analytics): add documenation on proper analytics rules usage
Implements analytics events tracking capabilities to complement existing rules functionality. Adds ability to create custom analytics events with type, name and data fields. Changes include: - New AnalyticsEvents class for event operations - Integration with Analytics class - Test coverage with sample search event creation - Helper updates for events in analytics rules - Documentation updates on how to use new feature feat(analytics): add AnalyticsEvents class test(analytics): add AnalyticsEventsTest feat(analytics): integrate events into Analytics class refactor(helper): update createTestAnalyticsRule for events docs(analytics): add documenation on proper analytics rules usage
kishorenc
approved these changes
Nov 4, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Summary
Rationale
The Typesense server provides analytics capabilities through its
/analyticsendpoints, but these features were not accessible through the Java client. Users needed to track search analytics and user interactions but had to implement their own HTTP calls or workarounds.This PR adds complete support for Analytics Rules and Events.
Changes
Added Features:
Analytics.java):AnalyticsRules.java,AnalyticsRule.java):create(): Create new analytics collection rulesupsert(): Create or update existing rulesretrieve(): Get single or all analytics rulesdelete(): Remove analytics rulesAnalyticsEvents.java):create(): Track custom analytics eventsCode Changes:
Client.java:Helper.java:Documentation Updates:
README.md:Tests:
AnalyticsRulesTest.java: Complete test coverage for rules APIAnalyticsEventsTest.java: Event creation and validation testsContext
This implementation addresses and closes the feature request in #71 by @danipenaperez for analytics support in the Java client. It provides a complete solution for both analytics rules and events tracking, giving users the full power of Typesense analytics.
The changes follow the existing client architecture patterns and include comprehensive tests and documentation to ensure reliable usage.
PR Checklist