Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not getting All data in case of multiple types. Getting data for one specific type. #15533

Closed
cheonsoo opened this issue Dec 18, 2015 · 1 comment

Comments

@cheonsoo
Copy link

Hi. I have a problem with multiple types.
If I specify multiple type with comma, It's getting data from just one specific type.

Let's assume that we have an index which name is "account_test"
"account" has 3 types in it which are "Campaign", "Advertiser", "Agency"

"Campaign" has one data as below

{
    "_index": "account_test",
    "_type": "Campaign",
    "_id": "102399",
    "_score": 1,
    "_source": {
    "ID": "CM_12022015",
    "NAME": "CM_12022015",
    "Advertiser": {
        "ID": "Adv_12022015",
        "NAME": "unknown_advertiser"
    }
}

"Advertiser" has one data as below

{
    "_index": "account_test",
    "_type": "Advertiser",
    "_id": "52957",
    "_score": 1,
    "_source": {
        "ID": "Adv_12022015",
        "NAME": "unknown_advertiser",
    }
}

Now I want to find these with the keyword "Adv_12022015".

  • No type specified in URL
http://eshost:9200/account_test/_search?q=Campaign.Advertiser.ID:*adv_12022015* OR Advertiser.ID:*adv_12022015*
// Total : 2

It is getting both 2 data correctly.
However If I specify types in it, It only gets "Campaign" data.

  • Single type
http://eshost:9200/account_test/Campaign/_search?q=Campaign.Advertiser.ID:*adv_12022015* OR Advertiser.ID:*adv_12022015*
// Total : 1

and

http://eshost:9200/account_test/Advertiser/_search?q=Campaign.Advertiser.ID:*adv_12022015* OR Advertiser.ID:*adv_12022015*
// Total : 1

It works correctly. Both query gets data from each specified type.

  • Multiple types with comma
http://eshost:9200/account_test/Advertiser,Campaign/_search?q=Campaign.Advertiser.ID:*adv_12022015* OR Advertiser.ID:*adv_12022015*
// Total : 1

However If I specify multiple types with comma in url, it gets only data from "Campaign".

Single type is fine, It is only a problem when I use multiple type with comma.
I think it is similar to the issue #2218

Please check it out.
Thank you.

Installed Elastic Search Info
{
"status": 200,
"name": "node1",
"cluster_name": "es.oas.cluster",
"version": {
"number": "1.4.2",
"build_hash": "927caff6f05403e936c20bf4529f144f0c89fd8c",
"build_timestamp": "2014-12-16T14:11:12Z",
"build_snapshot": false,
"lucene_version": "4.10.2"
},
"tagline": "You Know, for Search"
}

@cheonsoo cheonsoo changed the title Not getting All data in case of multiple types. Getting data for specific type. Not getting All data in case of multiple types. Getting data for one specific type. Dec 18, 2015
@clintongormley
Copy link

Hi @cheonsoo

The problem is that you have object fields that are the same as your type names, which is producing ambiguity. 2.0 had a major mapping rewrite to fix these kinds of issues (see #8870)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants