Searchlight UI: Facets don't work on deep object mapped fields
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Searchlight |
Fix Released
|
High
|
Steve McLellan |
Bug Description
Hypervisor has a deeply nested object. cpu_info.* and cpu_info.topology.*
http://
The following code:
Assumes it is nested and generates this:
{
"query": {
"bool": {
"must": [{
"nested": {
"path": "cpu_info",
"query": {
"
"fields": ["cpu_info.model"],
"query": "SandyBridge"
}
}
}
}]
}
},
"all_projects": true,
"limit": 200,
"sort": [{
"_score": {
"order": "desc"
}
}],
"type": ["OS::Nova:
"version": true
}
BUT it may not be nested: See https:/
This results in an error when submitting the query.
And the query changes to:
{
"query": {
"bool": {
"must": [{
"query_string": {
"fields": ["cpu_info.model"],
"query": "SandyBridge"
}
}]
}
},
"all_projects": true,
"limit": 200,
"sort": [{
"_score": {
"order": "desc"
}
}],
"type": ["OS::Nova:
"version": true
}
Based on the above patch, we shouldn't be assuming nested. And in addition, the UI does not have knowledge to determine whether or not it should be using a nested query or if a standard object path query should work.
I think we should change the UI to assume it is object path... but in a separate patch, we need to know whether or not a facet should be queried using nested or object syntax.
Right now the facet "Type" lies. It flattens them.
{
"type": "string",
"name": "cpu_info.model"
},
{
"type": "string",
"name": "cpu_info.vendor"
},
{
"type": "string",
"name": "cpu_info.features"
},
{
"type": "integer",
"name": "cpu_info.
},
Changed in searchlight: | |
importance: | Undecided → High |
milestone: | none → newton-rc1 |
tags: | added: searchlight-ui |
description: | updated |
description: | updated |
summary: |
- Searchlight UI: Facets don't work on deep fields + Searchlight UI: Facets don't work on deep object mapped fields |
description: | updated |
Changed in searchlight: | |
assignee: | nobody → Steve McLellan (sjmc7) |
My suggestion for fixing this is to add a flag to 'dot' fields indicating whether or not they're nested; we can't use 'type':'nested' because we flatten the structure. This'd allow the UI to make the decision, and if we decide to expose the full mapping in Ocata maybe that's a better longer term solution. I'll put up a patch.