When i am searching in ES index, i am getting 2 or 3 multiple records. I want those results as a single record

Hello,

I am using jdbc input plugin to fetch data from database.
I have created ES index using 6 different sql queries and in that 6 queries some columns are same.
After that i have created one index pattern in endeca.
when i have searched value from same column then it is giving me 6 different results from 6 different queries.
I want to show them as a one record.
How I can achieve this?

for example,
I have two tables: Test_tb and Result_tb
in Test_tb, I have 3 columns, contentid, title and object_summary
and in Result_tb, i have 3 columns contentid, segment_name and helpdesk_name.

So when i am searching contentid 1234. Contentid 1234 is present in both the tables. In this case it is giving me results as 2. Because contentid 1234 is matching in 2 tables.
But my requirement is to show those 2 records as a one record with contentid as common record.

Regards,
Priyanka

So you want to "join" 2 documents to be only one.

You should solve that problem at index time and index only one single document.

Hello @dadoonet,

How to index only one single document at index time?

Regards,
Priyanka

Instead of sending:

PUT index/_doc/test_12345
{
  "contentid": "12345", 
  "title": "foo",
  "object_summary": "bar"
}
PUT index/_doc/result_12345
{
  "contentid": "12345", 
  "segment_name": "foo",
  "helpdesk_name": "bar"
}

You can send:

PUT index/_doc/12345
{
  "contentid": "12345",
  "test": { 
    "title": "foo",
    "object_summary": "bar"
  },
  "result": {
    "segment_name": "foo",
    "helpdesk_name": "bar"
  }
}

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