Type Name Query Interference?


(bailey) #1

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!


(Clinton Gormley) #2

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


(bailey) #3

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 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


(system) #4