Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. curl -XPUT 'http://localhost:9200/3click/text/<номер блока>' -d '
  2. {
  3. "id":"<номер блока>",
  4. "filename": "имя_файла",
  5. "content":"<строка индексируемого текста, состоит ТОЛЬКО из букв латинницы и кириллицы, цифр и пробелов>",
  6. "tags":"test,дед_мороз"
  7. }'
  8.  
  9. {"_index":"3click","_type":"text","_id":"1","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
  10.  
  11. curl -XPUT "http://localhost:9200/3click/text/_mapping" -d '{
  12. "text": {
  13. "_all" : {"analyzer" : "russian_morphology"},
  14. "properties" : {
  15. "id" : {"type" : "integer"},
  16. "filename":{"type":"string"},
  17. "content" : { "type" : "string", "analyzer" : "russian_morphology" },
  18. "tags" : {"type":"string"}
  19. }
  20. }
  21. }'
  22.  
  23. curl -XPUT "http://localhost:9200/3click" -d '{
  24. "settings": {
  25. "analysis": {
  26. "analyzer": {
  27. "my_analyzer": {
  28. "type": "custom",
  29. "tokenizer": "standard",
  30. "filter": ["lowercase", "russian_morphology", "english_morphology", "my_stopwords"]
  31. }
  32. },
  33. "filter": {
  34. "my_stopwords": {
  35. "type": "stop",
  36. "stopwords": "а,без,...,will,with"
  37. }
  38. }
  39. }
  40. }
  41. }' здесь как-то можно перевод строк нормально добавлять?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement