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
Alias filters cached/type inferenced incorrectly #2762
Comments
hey, the reason here is not caching I am afraid. This would be simpler to fix :) The problem here is that we parse the filter from the alias and then pre-build it with the "current" knowledge about the field. Since there is no mapping we can't tell that we need to build a numeric filter which is encoded differently in the index. From the top of my head this is not easy to fix really but I will think about it. I guess the easiest fix for you are dynamic templates that add a mapping for those fields on index creation you can maybe prefix them with numierc_ or something like that? |
I had a feeling it might not be as straightforward as a caching issue. For us, this is easy to work around as the field we want to filter on is known at index creation time (user account number), so we can just specify it explicitly in our type mapping. I just wanted to report it as it was something that tripped us up and I'm sure other people might run into it. Couple of ideas/questions (not knowing the guts of ES):
|
I'm also seeing this issue on 0.90.3. While adding an explicit type mapping for the filtered field works, it appears that a default mapping does not. I'm leaning toward adding a specific type mapping for the field in addition to the default type mapping for dynamic types. Here's a brief recreation:
|
Closing in favour of #6664 |
A while ago we started playing with alias filters, but initially ran into a confusing bug.
Our environment creates our index along with its type mappings and aliases all at once, then proceeds to index documents into it.
The problem lies with using a numeric filter in an alias on a field that does not have an explicit type via its mapping. After indexing documents that match the alias' filter, no results are returned. This appears to be due to the alias being cached.
The following is a minimal reproduction of the issue:
Inspecting the alias via the _aliases endpoint doesn't reveal any information that would explain the lack of matching documents.
If you explicitly type the filtered field in the mapping before creating the alias, the alias filter works as expected.
Given that this was relatively tricky to figure out (nothing is mentioned about type inferencing in relation to alias filters in the docs), this struck us as being a bug in how alias filters are being stored/cached.
The text was updated successfully, but these errors were encountered: