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

feat(stopwords): add stopwords support #73

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

tharropoulos
Copy link
Contributor

Change Summary

Rationale

This enhancement adds support for managing stopwords in the Typesense Java client.

By implementing stopwords management, users can:

  • Create and maintain custom stopwords lists
  • Apply different stopwords sets for different use cases
  • Easily manage stopwords through a clean API interface

Changes

Added Features:

  1. New Class Stopwords.java:

    • upsert(): Creates or updates a stopwords set with specified ID
    • retrieve(): Gets all available stopwords sets
    • Base endpoint management for stopwords operations
  2. New Class StopwordsSet.java:

    • retrieve(): Gets details of a specific stopwords set
    • delete(): Removes a stopwords set
    • Individual stopwords set management functionality
  3. Client Integration in Client.java:

    • stopwords(): New method providing access to global stopwords operations
    • stopwords(String stopwordsSetId): Method for accessing individual stopwords set operations
    • Added proper instance management for stopwords functionality

Code Changes:

  1. In Client.java:
    • Added stopwords management instance variables
    • Implemented stopwords access methods
    • Added initialization in constructor

Documentation Updates:

  1. In README.md:
    • Added code examples for all stopwords operations:
      • Upserting a stopwords set
      • Retrieving individual and all stopwords sets
      • Deleting stopwords sets
    • Clear usage examples with realistic data

Test Coverage:

  1. New Test Class StopwordsTest.java:

    • Comprehensive test coverage for all stopwords operations
    • Tests for upsert, retrieve, retrieve all, and delete operations
    • Proper setup and teardown handling
  2. Updates to Helper.java:

    • Added stopwords support in test utilities
    • Implemented cleanup for stopwords in teardown

Context

This implementation aligns with Typesense's stopwords management API endpoints and provides a Java-friendly interface for managing stopwords. The changes follow existing patterns in the client library for consistency and ease of use. All operations are properly tested and documented to ensure reliability and maintainability.

PR Checklist

Implements stopwords management capabilities allowing users to create and manage
stopwords sets for search optimization. Adds complete CRUD operations for
stopwords with proper error handling and test coverage.

Changes include:
- New Stopwords and StopwordsSet classes for managing stopwords
- Client integration for stopwords management
- Full test coverage with realistic scenarios
- Helper class updates for testing stopwords functionality
- Documentation updates with usage examples

feat(stopwords): add Stopwords class for bulk operations
feat(stopwords): add StopwordsSet class for individual set management
test(stopwords): add StopwordsTest test coverage
refactor(client): integrate stopwords support
refactor(helper): add stopwords support in test helper
docs(stopwords): add documentation and examples
@kishorenc kishorenc merged commit 1eee81d into typesense:master Nov 7, 2024
3 checks passed
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