You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
This is missing feature, not a problem.
When using parent/child documents and importing fields from parent, there is no way to retrieve imported fields using document/v1 api.
Describe the solution you'd like
document/v1 API has fieldSet query param documented. Though currently passing imported field to this param does not result in error.
Example:
search advertiser {
document advertiser {
field company_name type string {
indexing: attribute | summary
}
}
}
search campaign {
document campaign {
field advertiser_ref type reference<advertiser> {
indexing: attribute
}
field name type string {
indexing: attribute | summary
}
}
import field advertiser_ref.company_name as campaign_company_name {}
}
ReturnCode(ILLEGAL_PARAMETERS, Field campaign_company_name in fieldset campaing:campaign_company_name not found in document)
Describe alternatives you've considered
Alternative would be to use search API with document summary, which includes imported fields. Though this is not that convenient if we only need to retrieve document by id.
This is a very understandable feature request, since it's already possible to use imported fields as part of the document selection visiting predicate via Document V1.
Unfortunately, it's not a trivial change; Document V1 (and the lower level Document API it uses) operates on—and returns—document instances that conform to the document type schema, but imported fields are declared outside of the document type. In other words, there is no concrete field in the document instance that can be populated from an imported field value. The document selection and query evaluation pipelines in the backend have explicit handling of imported fields to create the illusion that they can be used as if they were part of the document type, but this abstraction does not exist on a higher level.
Including imported fields in documents would also break the assumption that you can directly pipe the output of visiting into feeding, as such fields cannot be written to.
We would likely need some way of representing "meta-level" fields in the output, but this does not exist today. Input for Document V2 work...
Is your feature request related to a problem? Please describe.
This is missing feature, not a problem.
When using parent/child documents and importing fields from parent, there is no way to retrieve imported fields using document/v1 api.
Describe the solution you'd like
document/v1 API has
fieldSet
query param documented. Though currently passing imported field to this param does not result in error.Example:
curl --location 'http://localhost:8080/document/v1/campaing/campaign/docid/123456?fieldSet=campaign_company_name'
Returns:
Describe alternatives you've considered
Alternative would be to use search API with document summary, which includes imported fields. Though this is not that convenient if we only need to retrieve document by id.
Additional context
Initial request in slack
The text was updated successfully, but these errors were encountered: