analyzers.asciidoc 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. [[analysis-analyzers]]
  2. == Analyzers
  3. Analyzers are composed of a single <<analysis-tokenizers,Tokenizer>>
  4. and zero or more <<analysis-tokenfilters,TokenFilters>>. The tokenizer may
  5. be preceded by one or more <<analysis-charfilters,CharFilters>>.
  6. The analysis module allows you to register `Analyzers` under logical
  7. names which can then be referenced either in mapping definitions or in
  8. certain APIs.
  9. Elasticsearch comes with a number of prebuilt analyzers which are
  10. ready to use. Alternatively, you can combine the built in
  11. character filters, tokenizers and token filters to create
  12. <<analysis-custom-analyzer,custom analyzers>>.
  13. [float]
  14. [[default-analyzers]]
  15. === Default Analyzers
  16. An analyzer is registered under a logical name. It can then be
  17. referenced from mapping definitions or certain APIs. When none are
  18. defined, defaults are used. There is an option to define which analyzers
  19. will be used by default when none can be derived.
  20. The `default` logical name allows one to configure an analyzer that will
  21. be used both for indexing and for searching APIs. The `default_index`
  22. logical name can be used to configure a default analyzer that will be
  23. used just when indexing, and the `default_search` can be used to
  24. configure a default analyzer that will be used just when searching.
  25. [float]
  26. [[aliasing-analyzers]]
  27. === Aliasing Analyzers
  28. Analyzers can be aliased to have several registered lookup names
  29. associated with them. For example, the following will allow
  30. the `standard` analyzer to also be referenced with `alias1`
  31. and `alias2` values.
  32. [source,js]
  33. --------------------------------------------------
  34. index :
  35. analysis :
  36. analyzer :
  37. standard :
  38. alias: [alias1, alias2]
  39. type : standard
  40. stopwords : [test1, test2, test3]
  41. --------------------------------------------------
  42. Below is a list of the built in analyzers.
  43. include::analyzers/standard-analyzer.asciidoc[]
  44. include::analyzers/simple-analyzer.asciidoc[]
  45. include::analyzers/whitespace-analyzer.asciidoc[]
  46. include::analyzers/stop-analyzer.asciidoc[]
  47. include::analyzers/keyword-analyzer.asciidoc[]
  48. include::analyzers/pattern-analyzer.asciidoc[]
  49. include::analyzers/lang-analyzer.asciidoc[]
  50. include::analyzers/snowball-analyzer.asciidoc[]
  51. include::analyzers/custom-analyzer.asciidoc[]