2017-03-20 14 views
0

は、次のフィールドelasticsearch更新クエリ

  • IDとElasticSearch文書/テーブルを 'タスク' を作成(挿入中に自動生成された)
  • TASK_ID(整数)
  • 優先(整数)
  • キュー(varchar型)
  • プロセス(varchar型)
  • タスク(varchar型)
  • 秒tatus(文字)
  • ユーザー(文字)
  • 説明(varchar型)
  • DUE_DATE(日付・曜日)
  • CREATED_ON(日付時刻)
  • updated_on(日付時刻)
+0

あなたも考える必要がマッピングを作成します各分野の適切なアナライザとインデックスオプションを選択するために、検索の用途について – user3775217

+0

私はこのelasticsearchの新しい私は多くを知らない – Gaja

+0

これまでに何を試しましたか? – Adonis

答えて

0

ここにいます基本的なESインデックスを設定するのに役立つカップルのコマンド:

  1. マップをセットアップするイングス:

    curl -XPUT http://localhost:9200/my_tasks -d ' 
    { 
        "mappings": { 
        "task": { 
         "properties": { 
         "task_id": { 
          "type":  "integer" 
         }, 
         "priority": { 
          "type":  "integer" 
         }, 
         "queue": { 
          "type":  "string" 
         }, 
         "process": { 
          "type":  "string" 
         }, 
         "task": { 
          "type":  "string" 
         }, 
         "status": { 
          "type":  "string" 
         }, 
         "user": { 
          "type":  "string" 
         }, 
         "description": { 
          "type":  "string" 
         }, 
         "due_date": { 
          "type":  "date" 
         }, 
         "created_on": { 
          "type":  "date" 
         }, 
         "updated_on": { 
          "type":  "date" 
         } 
         } 
        } 
        } 
    }' 
    
  2. セットアップの簡単な文書:

    curl -XPOST http://localhost:9200/my_tasks/task/ -d ' 
    { 
        "task_id": "64123", 
        "priority": "2", 
        "queue": "Implementation", 
        "process": "Project Sample", 
        "task": "Feature-64123", 
        "status": "In Progress", 
        "user": "John Smith", 
        "description": "Set-up basic ElasticSearch task", 
        "due_date": "2017-03-24T00:00:00Z", 
        "created_on": "2017-03-21T01:51:12Z", 
        "updated_on": "2017-03-21T01:56:54Z" 
    }' 
    
  3. クエリ索引(愚かmatch_allクエリ):

    curl -XGET http://localhost:9200/my_tasks/_search -d ' 
    { 
        "query": { 
         "match_all": {} 
        } 
    }' 
    
+0

解析に失敗しましたありがとう – Gaja