# Type Name Query Interference?

**URL:** <https://discuss.elastic.co/t/type-name-query-interference/3271>\
**Category:** Elasticsearch\
**Created:** [August 27, 2010, 5:28pm UTC](https://discuss.elastic.co/t/type-name-query-interference/3271 "2010-08-27T17:28:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bailey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bailey/32/3278_2.png) [@bailey](https://discuss.elastic.co/u/bailey)\
**Post date:** [August 27, 2010, 5:28pm UTC](https://discuss.elastic.co/t/type-name-query-interference/3271/1 "2010-08-27T17:28:03Z")

</div>

Hi All-

I'm experiencing some perceived 'weirdness' while searching but I'm  
curious if it's actually expected behavior.

I have one type titled "activities" and another type titled  
"activityStream" both in the same index.  
In "activityStream" we have an attribute in the data that is titled  
"activities" which is an array of objects.  
If I try to query into the activityStream.activities array of objects  
I do not get the expected results.  
Now, if I change the activitryStream.activities attribute name to  
"acts", reflect the update in the query and run it, I receive the  
expected results.

So is it not possible to have a data attribute titled the same as  
type?

Thanks!

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [August 27, 2010, 5:37pm UTC](https://discuss.elastic.co/t/type-name-query-interference/3271/2 "2010-08-27T17:37:43Z")

</div>

Hi Bailey

> I have one type titled "activities" and another type titled  
> "activityStream" both in the same index.  
> In "activityStream" we have an attribute in the data that is titled  
> "activities" which is an array of objects.  
> If I try to query into the activityStream.activities array of objects  
> I do not get the expected results.  
> Now, if I change the activitryStream.activities attribute name to  
> "acts", reflect the update in the query and run it, I receive the  
> expected results.
> 
> So is it not possible to have a data attribute titled the same as  
> type?

This may be a bug - would you mind providing a small example of the  
mappings and queries that you're using, to replicate this issue?

thanks

clint

---

<div class="post-metadata">

**Author:** ![bailey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bailey/32/3278_2.png) [@bailey](https://discuss.elastic.co/u/bailey)\
**Post date:** [August 27, 2010, 6:45pm UTC](https://discuss.elastic.co/t/type-name-query-interference/3271/3 "2010-08-27T18:45:05Z")

</div>

Hi Clint-  
A sample of activities type date would be:  
{  
"dataType" : "activities",  
"actor" : {  
"\_id" : "01015d9889734977ab41aa9c55c88bcc",  
"username" : "testUser",  
"profilePicture" : {  
"url" : "/images/bighead.jpg",  
"title" : "My Profile Picture",  
"dateCreated" : "",  
"currentProfilePicture" : true  
},  
"fullName" : "Joe Tester",  
"dataType" : "profiles"  
},  
"verb" : "C",  
"direct" : {  
"\_id" : "efbcd969be54410b95e891ce758face6",  
"fullName" : "Test Business",  
"username" : "TestBusiness",  
"idea" : false,  
"active" : true,  
"dataType" : "business",  
"dateCreated" : "2010-08-27T17:51:21Z"  
}  
}

A sample of the activityStream type data would be:

{  
"\_id" : "01015d9889734977ab41aa9c55c88bcc",  
"activities" : [ {  
"dataType" : "activities",  
"actor" : {  
"\_id" : "01015d9889734977ab41aa9c55c88bcc",  
"username" : "testUser",  
"profilePicture" : {  
"url" : "/images/bighead.jpg",  
"title" : "My Profile Picture",  
"dateCreated" : "",  
"currentProfilePicture" : true  
},  
"fullName" : "Joe Tester",  
"dataType" : "profiles"  
},  
"verb" : "C",  
"direct" : {  
"\_id" : "efbcd969be54410b95e891ce758face6",  
"fullName" : "Test Business",  
"username" : "TestBusiness",  
"idea" : false,  
"active" : true,  
"dataType" : "business",  
"dateCreated" : "2010-08-27T17:51:21Z"  
},  
"about" : {},  
"dateCreated" : "2010-08-27T17:51:22Z",  
"\_id" : "69a327ca8db64dc6acad467c1260b701"  
},  
{  
"dataType" : "activities",  
"actor" : {  
"\_id" : "01015d9889734977ab41aa9c55c88bcc",  
"username" : "testUser",  
"profilePicture" : {  
"url" : "/images/bighead.jpg",  
"title" : "My Profile Picture",  
"dateCreated" : "",  
"currentProfilePicture" : true  
},  
"fullName" : "Joe Tester",  
"dataType" : "profiles"  
},  
"verb" : "U",  
"direct" : {  
"\_id" : "01015d9889734977ab41aa9c55c88bcc",  
"username" : "JoeTester",  
"profilePicture" : {  
"url" : "/images/bighead.jpg",  
"title" : "My Profile Picture",  
"dateCreated" : "",  
"currentProfilePicture" : true  
},  
"fullName" : "Joe Tester",  
"dataType" : "profiles"  
},  
"about" : {},  
"dateCreated" : "2010-08-27T18:25:11Z",  
"\_id" : "a54e03756b8d4a48b36061e8b50451a9"  
}  
]  
}

The query looks like:  
{"query":  
{"query\_string":  
{  
"fields":  
["activities.actor.\_id","activities.direct.\_id","activities.about.\_id"],  
"query":"01015d9889734977ab41aa9c55c88bcc"  
}  
}  
}

I should also note that mappings have not yet been set up for these  
types yet.

Thanks.

On Aug 27, 1:37 pm, Clinton Gormley [clin...@iannounce.co.uk](mailto:clin...@iannounce.co.uk) wrote:

> Hi Bailey
> 
> > I have one type titled "activities" and another type titled  
> > "activityStream" both in the same index.  
> > In "activityStream" we have an attribute in the data that is titled  
> > "activities" which is an array of objects.  
> > If I try to query into the activityStream.activities array of objects  
> > I do not get the expected results.  
> > Now, if I change the activitryStream.activities attribute name to  
> > "acts", reflect the update in the query and run it, I receive the  
> > expected results.
> 
> > So is it not possible to have a data attribute titled the same as  
> > type?
> 
> This may be a bug - would you mind providing a small example of the  
> mappings and queries that you're using, to replicate this issue?
> 
> thanks
> 
> clint

---

<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, 4:20am UTC](https://discuss.elastic.co/t/type-name-query-interference/3271/4 "2017-07-06T04:20:12Z")

</div>

Closed on July 6, 2017, 4:20am UTC


