Hi!
I am facing some issues with the javascript client of app search and maybe you can help me.
I have an engine with documents loaded into elastic and now I'm playing with this js client to fetch the data.
I created 4 facets and I want to perform a query filtering by one of them. As a result, I want to receive all the facets, even if there are no results for any of them.
To do that I read the guide of the client in GitHub and I ran into the disjunctiveFacets option.
As far as I understand, if you include the 4 facets into a String array two queries will be performed, one returning the filtered results and another one retrieving all the facets in the disjunctive array. am I right?
Currently, the facet query only retrieves the facets for the field I am filtering and I need to have them all.
this is the options object I am building right now:
const options = {
facets: {
creator: {
type: 'value',
size: 100,
},
name: {
type: 'value',
size: 100,
},
stage: {
type: 'value',
size: 100,
},
assignee: {
type: 'value',
size: 100,
},
},
filters: {
any: [
{
creator: 'whatever',
},
],
},
disjunctiveFacets: ['creator', 'name', 'stage', 'assignee'],
result_fields: { //truncated},
page: {
size: 20,
current: 1,
},
};
Thank you very much in advance!