Elasticsearch Search Engine

Implement powerful search functionality with Elasticsearch and the ELK stack

# Elasticsearch Search

This document provides comprehensive guidelines for elasticsearch search development and best practices.

---

## Elasticsearch Fundamentals

1. **Document-oriented**
   - Document-oriented search engine
   - Implement proper document-oriented search engine
   - Follow best practices for optimal results

2. **RESTful**
   - RESTful API for all operations
   - Implement proper restful api for all operations
   - Follow best practices for optimal results

3. **Distributed**
   - Distributed and scalable architecture
   - Implement proper distributed and scalable architecture
   - Follow best practices for optimal results

4. **Real-time**
   - Real-time indexing and search
   - Implement proper real-time indexing and search
   - Follow best practices for optimal results

5. **JSON-based**
   - JSON-based query DSL
   - Implement proper json-based query dsl
   - Follow best practices for optimal results

---

## Index Management

6. **Index**
   - Index creation and configuration
   - Implement proper index creation and configuration
   - Follow best practices for optimal results

7. **Mapping**
   - Mapping definition for document structure
   - Implement proper mapping definition for document structure
   - Follow best practices for optimal results

8. **Index**
   - Index templates for consistent settings
   - Implement proper index templates for consistent settings
   - Follow best practices for optimal results

9. **Index**
   - Index lifecycle management (ILM)
   - Implement proper index lifecycle management (ilm)
   - Follow best practices for optimal results

10. **Shard**
   - Shard and replica configuration
   - Implement proper shard and replica configuration
   - Follow best practices for optimal results

---

## Document Operations

11. **Document**
   - Document indexing and updates
   - Implement proper document indexing and updates
   - Follow best practices for optimal results

12. **Bulk**
   - Bulk operations for performance
   - Implement proper bulk operations for performance
   - Follow best practices for optimal results

13. **Document**
   - Document versioning and conflicts
   - Implement proper document versioning and conflicts
   - Follow best practices for optimal results

14. **Parent-child**
   - Parent-child relationships
   - Implement proper parent-child relationships
   - Follow best practices for optimal results

15. **Nested**
   - Nested document handling
   - Implement proper nested document handling
   - Follow best practices for optimal results

---

## Query DSL

16. **Match**
   - Match queries for full-text search
   - Implement proper match queries for full-text search
   - Follow best practices for optimal results

17. **Term**
   - Term queries for exact matches
   - Implement proper term queries for exact matches
   - Follow best practices for optimal results

18. **Bool**
   - Bool queries for complex logic
   - Implement proper bool queries for complex logic
   - Follow best practices for optimal results

19. **Range**
   - Range queries for numeric/date ranges
   - Implement proper range queries for numeric/date ranges
   - Follow best practices for optimal results

20. **Aggregation**
   - Aggregation queries for analytics
   - Implement proper aggregation queries for analytics
   - Follow best practices for optimal results

---

## Search Features

21. **Full-text**
   - Full-text search with relevance scoring
   - Implement proper full-text search with relevance scoring
   - Follow best practices for optimal results

22. **Faceted**
   - Faceted search and filtering
   - Implement proper faceted search and filtering
   - Follow best practices for optimal results

23. **Auto-completion**
   - Auto-completion and suggestions
   - Implement proper auto-completion and suggestions
   - Follow best practices for optimal results

24. **Highlighting**
   - Highlighting search results
   - Implement proper highlighting search results
   - Follow best practices for optimal results

25. **Search**
   - Search result pagination
   - Implement proper search result pagination
   - Follow best practices for optimal results

---

## Analyzers & Tokenizers

26. **Text**
   - Text analysis pipeline
   - Implement proper text analysis pipeline
   - Follow best practices for optimal results

27. **Built-in**
   - Built-in analyzers (standard, keyword, language)
   - Implement proper built-in analyzers (standard, keyword, language)
   - Follow best practices for optimal results

28. **Custom**
   - Custom analyzer creation
   - Implement proper custom analyzer creation
   - Follow best practices for optimal results

29. **Tokenizers**
   - Tokenizers and token filters
   - Implement proper tokenizers and token filters
   - Follow best practices for optimal results

30. **Language-specific**
   - Language-specific analysis
   - Implement proper language-specific analysis
   - Follow best practices for optimal results

---

## Aggregations

31. **Bucket**
   - Bucket aggregations for grouping
   - Implement proper bucket aggregations for grouping
   - Follow best practices for optimal results

32. **Metric**
   - Metric aggregations for calculations
   - Implement proper metric aggregations for calculations
   - Follow best practices for optimal results

33. **Pipeline**
   - Pipeline aggregations for complex analysis
   - Implement proper pipeline aggregations for complex analysis
   - Follow best practices for optimal results

34. **Terms**
   - Terms aggregation for facets
   - Implement proper terms aggregation for facets
   - Follow best practices for optimal results

35. **Date**
   - Date histogram for time-based analysis
   - Implement proper date histogram for time-based analysis
   - Follow best practices for optimal results

---

## Performance Optimization

36. **Index**
   - Index optimization strategies
   - Implement proper index optimization strategies
   - Follow best practices for optimal results

37. **Query**
   - Query performance tuning
   - Implement proper query performance tuning
   - Follow best practices for optimal results

38. **Caching**
   - Caching configuration
   - Implement proper caching configuration
   - Follow best practices for optimal results

39. **Shard**
   - Shard sizing and distribution
   - Implement proper shard sizing and distribution
   - Follow best practices for optimal results

40. **Hardware**
   - Hardware resource optimization
   - Implement proper hardware resource optimization
   - Follow best practices for optimal results

---

## Monitoring & Operations

41. **Cluster**
   - Cluster health monitoring
   - Implement proper cluster health monitoring
   - Follow best practices for optimal results

42. **Performance**
   - Performance metrics collection
   - Implement proper performance metrics collection
   - Follow best practices for optimal results

43. **Log**
   - Log analysis and debugging
   - Implement proper log analysis and debugging
   - Follow best practices for optimal results

44. **Backup**
   - Backup and restore procedures
   - Implement proper backup and restore procedures
   - Follow best practices for optimal results

45. **Security**
   - Security configuration
   - Implement proper security configuration
   - Follow best practices for optimal results

---

## ELK Stack Integration

46. **Logstash**
   - Logstash for data ingestion
   - Implement proper logstash for data ingestion
   - Follow best practices for optimal results

47. **Kibana**
   - Kibana for visualization and dashboards
   - Implement proper kibana for visualization and dashboards
   - Follow best practices for optimal results

48. **Beats**
   - Beats for lightweight data shippers
   - Implement proper beats for lightweight data shippers
   - Follow best practices for optimal results

49. **Data**
   - Data pipeline orchestration
   - Implement proper data pipeline orchestration
   - Follow best practices for optimal results

50. **Real-time**
   - Real-time analytics
   - Implement proper real-time analytics
   - Follow best practices for optimal results

---

## Application Integration

51. **Official**
   - Official client libraries usage
   - Implement proper official client libraries usage
   - Follow best practices for optimal results

52. **Connection**
   - Connection pooling and error handling
   - Implement proper connection pooling and error handling
   - Follow best practices for optimal results

53. **Search**
   - Search result processing
   - Implement proper search result processing
   - Follow best practices for optimal results

54. **Asynchronous**
   - Asynchronous search operations
   - Implement proper asynchronous search operations
   - Follow best practices for optimal results

55. **Circuit**
   - Circuit breaker patterns
   - Implement proper circuit breaker patterns
   - Follow best practices for optimal results

---

## Advanced Features

56. **Machine**
   - Machine learning for anomaly detection
   - Implement proper machine learning for anomaly detection
   - Follow best practices for optimal results

57. **Graph**
   - Graph analytics for relationship analysis
   - Implement proper graph analytics for relationship analysis
   - Follow best practices for optimal results

58. **Geospatial**
   - Geospatial search capabilities
   - Implement proper geospatial search capabilities
   - Follow best practices for optimal results

59. **Vector**
   - Vector search for similarity matching
   - Implement proper vector search for similarity matching
   - Follow best practices for optimal results

60. **Security**
   - Security features (authentication, authorization)
   - Implement proper security features (authentication, authorization)
   - Follow best practices for optimal results

---

## Scaling & Architecture

61. **Cluster**
   - Cluster design and topology
   - Implement proper cluster design and topology
   - Follow best practices for optimal results

62. **Hot-warm-cold**
   - Hot-warm-cold architecture
   - Implement proper hot-warm-cold architecture
   - Follow best practices for optimal results

63. **Cross-cluster**
   - Cross-cluster replication
   - Implement proper cross-cluster replication
   - Follow best practices for optimal results

64. **Snapshot**
   - Snapshot and restore strategies
   - Implement proper snapshot and restore strategies
   - Follow best practices for optimal results

65. **Disaster**
   - Disaster recovery planning
   - Implement proper disaster recovery planning
   - Follow best practices for optimal results

---

## Development Best Practices

66. **Index**
   - Index naming conventions
   - Implement proper index naming conventions
   - Follow best practices for optimal results

67. **Mapping**
   - Mapping design principles
   - Implement proper mapping design principles
   - Follow best practices for optimal results

68. **Query**
   - Query optimization techniques
   - Implement proper query optimization techniques
   - Follow best practices for optimal results

69. **Testing**
   - Testing strategies
   - Implement proper testing strategies
   - Follow best practices for optimal results

70. **Documentation**
   - Documentation and monitoring
   - Implement proper documentation and monitoring
   - Follow best practices for optimal results

---

## Summary Checklist

- [ ] Core principles implemented
- [ ] Best practices followed
- [ ] Performance optimized
- [ ] Security measures in place
- [ ] Testing strategy implemented
- [ ] Documentation completed
- [ ] Monitoring configured
- [ ] Production deployment ready

---

Follow these comprehensive guidelines for successful elasticsearch search implementation.
Elasticsearch Search Engine - Cursor IDE AI Rule