Elasticsearch join query


(Colin) #1

I don't think it's possible to do what I'm trying to accomplish, but I thought I'd see if anyone has any ideas before I give up.

Here are what my documents look like:

  "hits": {
    "total": 2,
    "max_score": 10.277645,
    "hits": [
      {
        "_index": "test",
        "_type": "test",
        "_id": "test",
        "_score": 10.277645,
        "_source": {
          "process_id": "1234test",
          "user": "jsmith"
        }
      },
      {
        "_index": "test",
        "_type": "test,
        "_id": "test",
        "_score": 10.277599,
        "_source": {
          "time_took_in_ms": 150,
          "process_id": "1234test"
        }
      }
    ]
  }

My goal is to get a document returned that looks something like this:

{
  "_index": "test",
  "_type": "test,
  "_id": "test",
  "_score": 10.277599,
  "_source": {
    "time_took_in_ms": 150,
    "user": "jsmith",
    "process_id": "1234test"
  }
}

I don't want to have to provide the process_id though; I want to be able to query the entire index and join all results like this. Is this possible and if so could someone point me in the right direction?


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.