field-query.asciidoc 902 B

123456789101112131415161718192021222324252627282930313233
  1. [[query-dsl-field-query]]
  2. === Field Query
  3. A query that executes a query string against a specific field. It is a
  4. simplified version of
  5. <<query-dsl-query-string-query,query_string>>
  6. query (by setting the `default_field` to the field this query executed
  7. against). In its simplest form:
  8. [source,js]
  9. --------------------------------------------------
  10. {
  11. "field" : {
  12. "name.first" : "+something -else"
  13. }
  14. }
  15. --------------------------------------------------
  16. Most of the `query_string` parameters are allowed with the `field` query
  17. as well, in such a case, the query should be formatted as follows:
  18. [source,js]
  19. --------------------------------------------------
  20. {
  21. "field" : {
  22. "name.first" : {
  23. "query" : "+something -else",
  24. "boost" : 2.0,
  25. "enable_position_increments": false
  26. }
  27. }
  28. }
  29. --------------------------------------------------