term-level-queries.asciidoc 2.6 KB

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