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
Percolation does not seem to work fully on dynamically templated fields #5750
Comments
I think this doesn't has to do with dynamic templates, but how queries resolve field name that are not an exact match. At query parse time the field is resolved in the mapping of an index. However if the field can't be found in the mapping under its exact name, the smart name resolving kicks in and tries to find the best field with the same suffix and uses that concrete field. However at the time when the percolator query is added the query parsing kicks in as well, but there field configured yet, so it fallbacks to using the name I think this is expected behaviour, since that just how the percolator works, the fields of the queries are resolved at query registration time. So one of the workarounds you mentioned should be used in order for fields to get resolved correctly. (use of full names, reindex queries, or have the mapping configured before indexing queries (either via indexing a percolator doc or adding a mapping)) Actually just registering the percolator queries should have been enough in order for the queries to match with the document being percolated. The mapping does get modified, but not properly propagated into the cluster state. This is an issue that needs to be addressed. |
Hi Martijn, thanks for taking the time!
|
Hi Emmanuel,
I think it is better to approach this problem from a different perspective. You can configure |
Martijn, thanks a lot for the quick fix on #5776. As for the automatic reloading of the percolator query on mapping updates, I understand that it's not trivial to do. As far as we are concerned we can live with using the fully qualified names.Using the |
Enable subscription queries for percolation to be added to (schema specific) document indices even when the index does not contain mappings for some of the fields referenced by the query. This is useful in the case where the query includes fields that have changed between metadata data schema versions, such as when the 'species' field changed from type text to type object representing an ontology. This also helps resolve internal constraints of needing to have the mappings defined in an index before a subscription query for percolation can be added to the index. This is accomplished by setting index.percolator.map_unmapped_fields_as_string to true, which also works in the case of other field types (e.g. numeric, date). Note that when dynamic templates are used and queries for percolation have been added to an index before the index contains mappings of fields referenced by those queries, the queries must be reloaded when the mappings are present for the queries to match. For more information, see: elastic/elasticsearch#5750
Enable subscription queries for percolation to be added to (schema specific) document indices even when the index does not contain mappings for some of the fields referenced by the query. This is useful in the case where the query includes fields that have changed between metadata data schema versions, such as when the 'species' field changed from type text to type object representing an ontology. This also helps resolve internal constraints of needing to have the mappings defined in an index before a subscription query for percolation can be added to the index. This is accomplished by setting index.percolator.map_unmapped_fields_as_string to true, which also works in the case of other field types (e.g. numeric, date). Note that when dynamic templates are used and queries for percolation have been added to an index before the index contains mappings of fields referenced by those queries, the queries must be reloaded when the mappings are present for the queries to match. For more information, see: elastic/elasticsearch#5750
Enable subscription queries for percolation to be added to (schema specific) document indices even when the index does not contain mappings for some of the fields referenced by the query. This is useful in the case where the query includes fields that have changed between metadata data schema versions, such as when the 'species' field changed from type text to type object representing an ontology. This also helps resolve internal constraints of needing to have the mappings defined in an index before a subscription query for percolation can be added to the index. This is accomplished by setting index.percolator.map_unmapped_fields_as_string to true, which also works in the case of other field types (e.g. numeric, date). Note that when dynamic templates are used and queries for percolation have been added to an index before the index contains mappings of fields referenced by those queries, the queries must be reloaded when the mappings are present for the queries to match. For more information, see: elastic/elasticsearch#5750
Enable subscription queries for percolation to be added to (schema specific) document indices even when the index does not contain mappings for some of the fields referenced by the query. This is useful in the case where the query includes fields that have changed between metadata data schema versions, such as when the 'species' field changed from type text to type object representing an ontology. This also resolves internal constraints of needing to have the mappings defined in an index before a subscription query for percolation can be added to the index. This is accomplished by setting index.percolator.map_unmapped_fields_as_string to true, which also works in the case of other field types (e.g. numeric, date). Note that when dynamic templates are used and queries for percolation have been added to an index before the index contains mappings of fields referenced by those queries, the queries must be reloaded when the mappings are present for the queries to match. For more information, see: elastic/elasticsearch#5750
Ensure subscription queries are added to indices, and do so in a way that allows queries including fields not defined in the index mappings. This enables subscription of queries that work across metadata schema versions, including fields that are not present in a schema version or have changed between versions, such as a field changing from type text to type object. This also resolves internal constraints of needing to have the mappings defined in an index before a subscription query for percolation can be added to the index. This is accomplished by setting index.percolator.map_unmapped_fields_as_string to true, which also works in the case of other field types (e.g. numeric, date). Note when dynamic templates are used and queries for percolation have been added to an index before the index contains mappings of fields referenced by those queries, the queries must be reloaded when the mappings change for the queries to match. For more information, see: elastic/elasticsearch#5750
Ensure subscription queries are added to indices, and do so in a way that allows queries including fields not defined in the index mappings. This enables subscription of queries that work across metadata schema versions, including fields that are not present in a schema version or have changed between versions, such as a field changing from type text to type object. This also resolves internal constraints of needing to have the mappings defined in an index before a subscription query for percolation can be added to the index. This is accomplished by setting index.percolator.map_unmapped_fields_as_string to true, which also works in the case of other field types (e.g. numeric, date). Note when dynamic templates are used and queries for percolation have been added to an index before the index contains mappings of fields referenced by those queries, the queries must be reloaded when the mappings change for the queries to match. For more information, see: elastic/elasticsearch#5750
…687) * Finish changes for schema version specific subscription/notification Ensure subscription queries are added to indices, and do so in a way that allows queries including fields not defined in the index mappings. This enables subscription of queries that work across metadata schema versions, including fields that are not present in a schema version or have changed between versions, such as a field changing from type text to type object. This also resolves internal constraints of needing to have the mappings defined in an index before a subscription query for percolation can be added to the index. This is accomplished by setting index.percolator.map_unmapped_fields_as_string to true, which also works in the case of other field types (e.g. numeric, date). Note when dynamic templates are used and queries for percolation have been added to an index before the index contains mappings of fields referenced by those queries, the queries must be reloaded when the mappings change for the queries to match. For more information, see: elastic/elasticsearch#5750
…650) Ensure subscription queries are added to indices, and do so in a way that allows queries including fields not defined in the index mappings. This enables subscription of queries that work across metadata schema versions, including fields that are not present in a schema version or have changed between versions, such as a field changing from type text to type object. This also resolves internal constraints of needing to have the mappings defined in an index before a subscription query for percolation can be added to the index. This is accomplished by setting index.percolator.map_unmapped_fields_as_string to true, which also works in the case of other field types (e.g. numeric, date). Note when dynamic templates are used and queries for percolation have been added to an index before the index contains mappings of fields referenced by those queries, the queries must be reloaded when the mappings change for the queries to match. For more information, see: elastic/elasticsearch#5750 Unit tests for multiple schema version indexing, search and subscription/notification (#688)
Hi all,
it looks like when using dynamic_templates with percolation, new fields introduced in the percolated document do not get properly picked up. Here is the test scenario:
Create an index with a type with all
custom.*
fields not analysed:Then register two queries one matching docs with
color:red
and the othercolor:blue
Then percolate. Note that we did not insert any document in the index. It will be the first time it sees the
custom.color
field.We get no match when it should find one.
Interesting notes:
custom.color
in the queries it worksTests run on OSX 10.9.2.
Elasticsearch Info:
Thanks,
Emmanuel
The text was updated successfully, but these errors were encountered: