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

[BUG] Searching multiple rollup indexes not working as expected #1265

Closed
MahendraAkkina opened this issue Sep 23, 2024 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@MahendraAkkina
Copy link

MahendraAkkina commented Sep 23, 2024

What is the bug?
Searching multiple rollup indexes not working as expected.

How can one reproduce the bug?
Followed the example provided at Index rollups - OpenSearch Documentation

I do see Rollups for multiple indexes being created (rollup_ndx-metric-000001, rollup_ndx-metric-000002, rollup_ndx-metric-000003) and I am able to query them individually. But when I try to search multiple Rollups via the following way, it does not seem to be using all the rolled up indexes to get the results as I am not seeing the results as expected.

GET /rollup_ndx-metric-*/_search

{
    "size": 0,
    "query": {
        "match_all": {}
    },
    "aggs": {
        "max": {
            "max": {
                "field": "value"
            }
        },
        "min": {
            "min": {
                "field": "value"
            }
        },
        "avg": {
            "avg": {
                "field": "value"
            }
        },
        "sum": {
            "sum": {
                "field": "value"
            }
        }
    }
}

Result:

{
    "took": 359,
    "timed_out": false,
    "_shards": {
        "total": 12,
        "successful": 12,
        "skipped": 0,
        "failed": 0
    },
    "hits": {
        "total": {
            "value": 1,
            "relation": "eq"
        },
        "max_score": null,
        "hits": []
    },
    "aggregations": {
        "avg": {
            "value": 85.0
        },
        "min": {
            "value": 85.0
        },
        "max": {
            "value": 85.0
        },
        "sum": {
            "value": 85.0
        },
        "value_count": {
            "value": 1
        }
    }
}

But if I remove the match all query, I see the it is showing correct info in the total hits. If query is not working as expected, seems like rollup feature is unusable when we want to search/filter data via query

    "query": {
        "match_all": {}
    },  

Result:

{
    "took": 502,
    "timed_out": false,
    "_shards": {
        "total": 12,
        "successful": 12,
        "skipped": 0,
        "failed": 0
    },
    "hits": {
        "total": {
            "value": 20,
            "relation": "eq"
        },
        "max_score": null,
        "hits": []
    },
    "aggregations": {
        "avg": {
            "value": 58.47826086956522
        },
        "min": {
            "value": 5.0
        },
        "max": {
            "value": 95.0
        },
        "sum": {
            "value": 1345.0
        },
        "value_count": {
            "value": 23
        }
    }
}

What is the expected behavior?
Expect the query to work.

What is your host/environment?

“version”: {
“distribution”: “opensearch”,
“number”: “2.4.0”,
“build_type”: “tar”,
“build_hash”: “744ca260b892d119be8164f48d92b8810bd7801c”,
“build_date”: “2022-11-15T04:42:29.671309257Z”,
“build_snapshot”: false,
“lucene_version”: “9.4.1”,
“minimum_wire_compatibility_version”: “7.10.0”,
“minimum_index_compatibility_version”: “7.0.0”
}

Do you have any screenshots?
If applicable, add screenshots to help explain your problem.

Do you have any additional context?
Add any other context about the problem.

@MahendraAkkina MahendraAkkina added bug Something isn't working untriaged labels Sep 23, 2024
@MahendraAkkina
Copy link
Author

MahendraAkkina commented Sep 26, 2024

From Opensearch 2.5 release notes: You can now search your rollup indexes using query string search queries.
https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.5.0.md

I upgraded my setup to 2.11, and retried the whole scenario and still having the same issue, i.e. it does not seem to be using all the rolled up indexes to get the results when I use a query via
GET /rollup_ndx-metric-*/_search

@MahendraAkkina
Copy link
Author

This is a show stopper for us. Given that the release notes says this is supported in 2.5 version, it will help if someone can check if I am missing something or if there are some known issues? Would love to see a working sample.

@tandonks
Copy link
Contributor

Hi, we have a setting for this plugins.rollup.search.search_all_jobs which when enabled allows multiple rolled up indices to be searched together. Default value of this is false, so we need to explicitly set it to true in order to perform the search.
Documentation: https://opensearch.org/docs/latest/im-plugin/index-rollups/settings/
Hope it answers your query!

@MahendraAkkina
Copy link
Author

Thanks @tandonks It works. Will close this for now and reopen if i come across any further issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants