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

Aggragations/Filter - fix for es1.2 when no sub aggregations #619

Merged
merged 1 commit into from
May 29, 2014

Conversation

krzaczek
Copy link
Contributor

Hi,

Small fix for Elastica/Aggregation/Filter.php. There is a bug when no subaggregation is set ... see "by_category_feature"

"aggs": {
        "global": {
            "global": {},
            "aggs": {
                "by_category_feature": {
                    "filter": {
                        "match_all": {}
                    },
                  "aggs": []
                }
            }
        }
    }

This will cause an error in elasticsearch because "aggs" cannot be [] ... it should be {} .. or we can just omit the aggs when there are none present.

"aggs": {
        "global": {
            "global": {},
            "aggs": {
                "by_category_feature": {
                    "filter": {
                        "match_all": {}
                    }
                }
            }
        }
    }

This will work fine :)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) when pulling e0f6271 on krzaczek:fix-aggs-filter into 58b0928 on ruflin:master.

@krzaczek
Copy link
Contributor Author

Sorry for the mess .. wil squash this to one commit .. but just don't have the time right now ...

@krzaczek
Copy link
Contributor Author

Ok squashed

@ruflin
Copy link
Owner

ruflin commented May 24, 2014

Can you update the changes.txt file and add a small test to make sure, it works as expected also in the future?

@krzaczek
Copy link
Contributor Author

sure will do on monday

pawel (at) mobile

On 24 maj 2014, at 23:45, Nicolas Ruflin [email protected] wrote:

Can you update the changes.txt file and add a small test to make sure, it works as expected also in the future?


Reply to this email directly or view it on GitHub.

@krzaczek
Copy link
Contributor Author

Should work now ....

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) when pulling 09a223c on krzaczek:fix-aggs-filter into 83fd5c4 on ruflin:master.

ruflin added a commit that referenced this pull request May 29, 2014
Aggragations/Filter - fix for es1.2 when no sub aggregations
@ruflin ruflin merged commit 5e06d03 into ruflin:master May 29, 2014
@ruflin
Copy link
Owner

ruflin commented May 29, 2014

Merged. Thx.

@krzaczek krzaczek deleted the fix-aggs-filter branch July 2, 2014 13:41
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

Successfully merging this pull request may close these issues.

3 participants