Skip to content

Latest commit

 

History

History
27 lines (23 loc) · 577 Bytes

File metadata and controls

27 lines (23 loc) · 577 Bytes

Query Choices

  • Avoid wild-card and regex queries to increase performance
  • When using full-text and non-analyzed searches on the same filed - use multi-fields
  • Return fields required only, rather than all the fields:
    curl 'localhost:9200/_search?pretty=true' -d '
    {
      "stored_fields": ["placedOn"]
    }'
    
  • Use filter whenever possibly to suppress scoring:
    curl -XPOST 'localhost:9200/_search?pretty=true' -d '
    {
     "query": {
        "bool": {
           "filter": {
              "term": { "status": "pending" }
           }
        }
     }
    }'