スノーボールトークンフィルター

スノーボール生成のステマーを使用して単語をステム化するフィルターです。languageパラメータは、次の利用可能な値でステマーを制御します: Arabic, Armenian, Basque, Catalan, Danish, Dutch, English, Estonian, Finnish, French, German, German2, Hungarian, Italian, Irish, Kp, Lithuanian, Lovins, Norwegian, Porter, Portuguese, Romanian, Russian, Serbian, Spanish, Swedish, Turkish

例えば:

Python

  1. resp = client.indices.create(
  2. index="my-index-000001",
  3. settings={
  4. "analysis": {
  5. "analyzer": {
  6. "my_analyzer": {
  7. "tokenizer": "standard",
  8. "filter": [
  9. "lowercase",
  10. "my_snow"
  11. ]
  12. }
  13. },
  14. "filter": {
  15. "my_snow": {
  16. "type": "snowball",
  17. "language": "Lovins"
  18. }
  19. }
  20. }
  21. },
  22. )
  23. print(resp)

Ruby

  1. response = client.indices.create(
  2. index: 'my-index-000001',
  3. body: {
  4. settings: {
  5. analysis: {
  6. analyzer: {
  7. my_analyzer: {
  8. tokenizer: 'standard',
  9. filter: [
  10. 'lowercase',
  11. 'my_snow'
  12. ]
  13. }
  14. },
  15. filter: {
  16. my_snow: {
  17. type: 'snowball',
  18. language: 'Lovins'
  19. }
  20. }
  21. }
  22. }
  23. }
  24. )
  25. puts response

Js

  1. const response = await client.indices.create({
  2. index: "my-index-000001",
  3. settings: {
  4. analysis: {
  5. analyzer: {
  6. my_analyzer: {
  7. tokenizer: "standard",
  8. filter: ["lowercase", "my_snow"],
  9. },
  10. },
  11. filter: {
  12. my_snow: {
  13. type: "snowball",
  14. language: "Lovins",
  15. },
  16. },
  17. },
  18. },
  19. });
  20. console.log(response);

コンソール

  1. PUT /my-index-000001
  2. {
  3. "settings": {
  4. "analysis": {
  5. "analyzer": {
  6. "my_analyzer": {
  7. "tokenizer": "standard",
  8. "filter": [ "lowercase", "my_snow" ]
  9. }
  10. },
  11. "filter": {
  12. "my_snow": {
  13. "type": "snowball",
  14. "language": "Lovins"
  15. }
  16. }
  17. }
  18. }
  19. }