Command
curl -X GET 'http://localhost:9200/_analyze?pretty' -H 'Content-Type: application/json' -d '{"text":"Elasticsearch is awesome"}'Explanation
Runs text through analyzers to show how Elasticsearch tokenizes and processes text.
Common Use Cases
- •Debugging search issues
- •Designing custom analyzers
- •Testing stemming, synonyms, tokenization
Best Practices
- ✓Always test analyzers before indexing data
- ✓Use custom analyzers for multilingual search
Common Mistakes to Avoid
- ⚠Analyzing with incorrect analyzer type
- ⚠Expecting keyword fields to tokenize text
Troubleshooting
Problem: Unexpected tokens
Solution: Verify analyzer configuration or mapping.
Problem: Analyzer not found
Solution: Ensure analyzer is defined in index settings.
Examples
Analyze using standard analyzer
curl -X GET 'http://localhost:9200/_analyze?pretty' -H 'Content-Type: application/json' -d '{"analyzer":"standard","text":"searching data"}'