这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Conversation

@kylebrandt
Copy link
Member

No description provided.

@kylebrandt
Copy link
Member Author

Currently if the time series is missing it errors inside ESDateHistrogram when it can't get the expected time series in the result. This result gets cached. Before when it would error on no indices in getFn, a wrapper for func (e ElasticHosts) Query(r *ElasticRequest) (*elastic.SearchResult, error), ensuring it was not cached. But now a lack of indices throws an error. Need to research inspecting the shards of the result and understanding what the means in this context.

@kylebrandt
Copy link
Member Author

I think counting the resulting shards and erroring when there were no shards that matched will get the result I want.

However, it depends on the following PR olivere/elastic#373

Alternatively, I could go for the date math method mentioned in #1926 (comment) . But only if allow_no_indices applies to datemath and not just wildcard. According to the documentation it only applies to wildcard which I haven't tested yet. Even if does work I think the implementation will be a bit of pain.

@kylebrandt
Copy link
Member Author

note: forgot to fmt, force pushed the fmt.

@kylebrandt kylebrandt changed the title WIP: don't fetch indices , add indices to cache don't fetch indices , add indices to cache, and add esmonthly func Oct 20, 2016
return "", fmt.Errorf("failed to generate json representation of search source for cache key: %s", s)
}
return str, nil
return fmt.Sprintf("%v\n%s", r.Indices, b), nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably use string(b) here. Don't want [42 31 13] in you key.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

additionally, what does the source have that causes it to be a different key? What varies?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ask because it surprises me that something like getting a cache key even has a possibility of erroring.

@kylebrandt
Copy link
Member Author

fixes #1926

@kylebrandt kylebrandt merged commit 3438de5 into master Oct 20, 2016
@gbrayut gbrayut deleted the esNoIndexRefactor branch March 1, 2017 19:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants