Elastic Search Processing Search Result

时间:2016-04-04 19:01:18

标签: elasticsearch tokenize

I can run a search like the following,

curl -XGET 'http://localhost:9200/cms-2016-03-30/job/_search?pretty=true&size=1000' -d '{ "_source":"DESIRED_CMSDataset"}'

which gives results like

{
      "_index" : "cms-2016-03-30",
      "_type" : "job",
      "_id" : "crab3-7@vocms0114.cern.ch#6472621.0#1459313328",
      "_score" : 1.0,
      "_source" : {
        "DESIRED_CMSDataset" : "/BTagCSV/Run2015D-16Dec2015-v1/MINIAOD"
      }
    }

I would like to process this result to only get the MINIAOD part of the DESIRED_CMSDataset string. Various tokenizers exist, but I can't figure out the syntax for any of them.

EDIT:

If you can alternatively tell me how to do this at index time (precisely), that is an acceptable answer. I mostly need the syntax. I don't understand the ElasticSearch syntax

EDIT:

This explains how to do this, but only applies upon the creation of the index. Learning how to do this by updating the index would be ideal.

1 个答案:

答案 0 :(得分:0)

我找到完成任何目标的最佳方法是使用Kibana制作一个漂亮的数据表。设置目标,然后找到Kibana用于在Kibana可视化工具中获取主框架数据底部的ElasticSearch代码。)

这是编写弹性搜索的最简单方法!否则,您将花费数天时间试图找出ElasticSearch查询语言的语法!然后,帮自己一个忙,并在Python中处理生成的JSON ......