# Indexing composite columns

**URL:** <https://discuss.elastic.co/t/indexing-composite-columns/5143>\
**Category:** Elasticsearch\
**Created:** [August 13, 2011, 12:31am UTC](https://discuss.elastic.co/t/indexing-composite-columns/5143 "2011-08-13T00:31:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohit\_Anchlia](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@Mohit\_Anchlia](https://discuss.elastic.co/u/Mohit_Anchlia)\
**Post date:** [August 13, 2011, 12:31am UTC](https://discuss.elastic.co/t/indexing-composite-columns/5143/1 "2011-08-13T00:31:10Z")

</div>

I am going through the first page about how to index documents in  
JSON. Our data is little different, we use Cassandra composite type so  
our column name and values could be something like:

{  
John.Smith.timestamp : tweet  
Aby:Gail:timestamp: tweet  
}

or  
{  
date: John.Smit  
}

How should I go about indexing such data?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 14, 2011, 10:55pm UTC](https://discuss.elastic.co/t/indexing-composite-columns/5143/2 "2011-08-14T22:55:20Z")

</div>

Cassandra data model and elasticsearch data model is different, if you are  
talking about indexing tweets, one simple solution is to index each tweet as  
a different (json) document.

On Sat, Aug 13, 2011 at 3:31 AM, Mohit Anchlia [mohitanchlia@gmail.com](mailto:mohitanchlia@gmail.com)wrote:

> I am going through the first page about how to index documents in  
> JSON. Our data is little different, we use Cassandra composite type so  
> our column name and values could be something like:
> 
> {  
> John.Smith.timestamp : tweet  
> Aby:Gail:timestamp: tweet  
> }
> 
> or  
> {  
> date: John.Smit  
> }
> 
> How should I go about indexing such data?

---

<div class="post-metadata">

**Author:** ![Mohit\_Anchlia](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@Mohit\_Anchlia](https://discuss.elastic.co/u/Mohit_Anchlia)\
**Post date:** [August 14, 2011, 11:00pm UTC](https://discuss.elastic.co/t/indexing-composite-columns/5143/3 "2011-08-14T23:00:06Z")

</div>

On Sun, Aug 14, 2011 at 3:55 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> Cassandra data model and elasticsearch data model is different, if you are  
> talking about indexing tweets, one simple solution is to index each tweet as  
> a different (json) document.

So basically in my example below:

John.Smith.timestamp : tweet

would become:

{

firstname:John  
lastname: Smith  
Timestamp: 12223455  
tweet: Hi

}

> On Sat, Aug 13, 2011 at 3:31 AM, Mohit Anchlia [mohitanchlia@gmail.com](mailto:mohitanchlia@gmail.com)  
> wrote:
> 
> > I am going through the first page about how to index documents in  
> > JSON. Our data is little different, we use Cassandra composite type so  
> > our column name and values could be something like:
> > 
> > {  
> > John.Smith.timestamp : tweet  
> > Aby:Gail:timestamp: tweet  
> > }
> > 
> > or  
> > {  
> > date: John.Smit  
> > }
> > 
> > How should I go about indexing such data?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 14, 2011, 11:21pm UTC](https://discuss.elastic.co/t/indexing-composite-columns/5143/4 "2011-08-14T23:21:09Z")

</div>

Yep.

On Mon, Aug 15, 2011 at 2:00 AM, Mohit Anchlia [mohitanchlia@gmail.com](mailto:mohitanchlia@gmail.com)wrote:

> On Sun, Aug 14, 2011 at 3:55 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > Cassandra data model and elasticsearch data model is different, if you  
> > are  
> > talking about indexing tweets, one simple solution is to index each tweet  
> > as  
> > a different (json) document.
> 
> So basically in my example below:
> 
> John.Smith.timestamp : tweet
> 
> would become:
> 
> {
> 
> firstname:John  
> lastname: Smith  
> Timestamp: 12223455  
> tweet: Hi
> 
> }
> 
> > On Sat, Aug 13, 2011 at 3:31 AM, Mohit Anchlia [mohitanchlia@gmail.com](mailto:mohitanchlia@gmail.com)  
> > wrote:
> > 
> > > I am going through the first page about how to index documents in  
> > > JSON. Our data is little different, we use Cassandra composite type so  
> > > our column name and values could be something like:
> > > 
> > > {  
> > > John.Smith.timestamp : tweet  
> > > Aby:Gail:timestamp: tweet  
> > > }
> > > 
> > > or  
> > > {  
> > > date: John.Smit  
> > > }
> > > 
> > > How should I go about indexing such data?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:57am UTC](https://discuss.elastic.co/t/indexing-composite-columns/5143/5 "2017-07-06T03:57:01Z")

</div>

Closed on July 6, 2017, 3:57am UTC


