term-level-queries.asciidoc 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. [[term-level-queries]]
  2. == Term level queries
  3. While the <<full-text-queries,full text queries>> will analyze the query
  4. string before executing, the _term-level queries_ operate on the exact terms
  5. that are stored in the inverted index, and will normalize terms before executing
  6. only for <<keyword,`keyword`>> fields with <<normalizer,`normalizer`>> property.
  7. These queries are usually used for structured data like numbers, dates, and
  8. enums, rather than full text fields. Alternatively, they allow you to craft
  9. low-level queries, foregoing the analysis process.
  10. The queries in this group are:
  11. <<query-dsl-term-query,`term` query>>::
  12. Find documents which contain the exact term specified in the field
  13. specified.
  14. <<query-dsl-terms-query,`terms` query>>::
  15. Find documents which contain any of the exact terms specified in the field
  16. specified.
  17. <<query-dsl-terms-set-query,`terms_set` query>>::
  18. Find documents which match with one or more of the specified terms. The
  19. number of terms that must match depend on the specified minimum should
  20. match field or script.
  21. <<query-dsl-range-query,`range` query>>::
  22. Find documents where the field specified contains values (dates, numbers,
  23. or strings) in the range specified.
  24. <<query-dsl-exists-query,`exists` query>>::
  25. Find documents where the field specified contains any non-null value.
  26. <<query-dsl-prefix-query,`prefix` query>>::
  27. Find documents where the field specified contains terms which begin with
  28. the exact prefix specified.
  29. <<query-dsl-wildcard-query,`wildcard` query>>::
  30. Find documents where the field specified contains terms which match the
  31. pattern specified, where the pattern supports single character wildcards
  32. (`?`) and multi-character wildcards (`*`)
  33. <<query-dsl-regexp-query,`regexp` query>>::
  34. Find documents where the field specified contains terms which match the
  35. <<regexp-syntax,regular expression>> specified.
  36. <<query-dsl-fuzzy-query,`fuzzy` query>>::
  37. Find documents where the field specified contains terms which are fuzzily
  38. similar to the specified term. Fuzziness is measured as a
  39. http://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance[Levenshtein edit distance]
  40. of 1 or 2.
  41. <<query-dsl-type-query,`type` query>>::
  42. Find documents of the specified type.
  43. <<query-dsl-ids-query,`ids` query>>::
  44. Find documents with the specified type and IDs.
  45. include::term-query.asciidoc[]
  46. include::terms-query.asciidoc[]
  47. include::terms-set-query.asciidoc[]
  48. include::range-query.asciidoc[]
  49. include::exists-query.asciidoc[]
  50. include::prefix-query.asciidoc[]
  51. include::wildcard-query.asciidoc[]
  52. include::regexp-query.asciidoc[]
  53. include::fuzzy-query.asciidoc[]
  54. include::type-query.asciidoc[]
  55. include::ids-query.asciidoc[]