Skip to content
New issue

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

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

Already on GitHub? # to your account

[ISSUE #2442]Add algolia support #2443

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions rocketmq-doc/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ search: true # true, false (default)
search_full_content: true # true, false (default)
search_provider: algolia # lunr (default), algolia
algolia:
application_id: #QB6HVGBSBA # YOUR_APPLICATION_ID
index_name: rocketmq-rust #minimal_mistakes # YOUR_INDEX_NAME
search_only_api_key: #9d5014e5bbc77372547bce778dfa5663 # YOUR_SEARCH_ONLY_API_KEY
application_id: A7P4XEL1X0 # YOUR_APPLICATION_ID
#index_name: rocketmq-rust #minimal_mistakes # YOUR_INDEX_NAME
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Configuration: Uncomment and set the index_name

The index_name is currently commented out, which will prevent Algolia search from working correctly. This value is required for the search functionality to work.

search_only_api_key: db1ad68e86dd7d47a5988ab78dcc8347 # YOUR_SEARCH_ONLY_API_KEY
Comment on lines +60 to +62
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Documentation: Add setup instructions for Algolia search

To help other contributors and maintainers, please add documentation that covers:

  1. How to set up Algolia search for local development
  2. How to configure the indexing process
  3. Required environment variables

Would you like me to help create a documentation template for the Algolia setup?


⚠️ Potential issue

⚠️ Security: Avoid committing API credentials directly in the configuration file

While this is a search-only API key, it's still recommended to use environment variables for all API credentials. This prevents accidental exposure and makes it easier to manage different environments (development, staging, production).

Replace the hardcoded values with environment variables:

-  application_id: A7P4XEL1X0  # YOUR_APPLICATION_ID
-  #index_name: rocketmq-rust #minimal_mistakes # YOUR_INDEX_NAME
-  search_only_api_key: db1ad68e86dd7d47a5988ab78dcc8347 # YOUR_SEARCH_ONLY_API_KEY
+  application_id: <%= ENV['ALGOLIA_APPLICATION_ID'] %>
+  index_name: <%= ENV['ALGOLIA_INDEX_NAME'] %>
+  search_only_api_key: <%= ENV['ALGOLIA_SEARCH_ONLY_API_KEY'] %>

Additionally, please:

  1. Revoke the current API key and generate a new one
  2. Add these variables to your CI/CD environment
  3. Document the required environment variables in the README
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
application_id: A7P4XEL1X0 # YOUR_APPLICATION_ID
#index_name: rocketmq-rust #minimal_mistakes # YOUR_INDEX_NAME
search_only_api_key: db1ad68e86dd7d47a5988ab78dcc8347 # YOUR_SEARCH_ONLY_API_KEY
application_id: <%= ENV['ALGOLIA_APPLICATION_ID'] %>
index_name: <%= ENV['ALGOLIA_INDEX_NAME'] %>
search_only_api_key: <%= ENV['ALGOLIA_SEARCH_ONLY_API_KEY'] %>

powered_by: true # true (default), false
files_to_exclude:
- _posts/2017-11-28-post-exclude-search.md
Expand Down
Loading