Initial commit
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
module.exports = function (hitsQuery) {
|
||||
// A shallow copy will prevent hitsQuery from being modified.
|
||||
const queryDsl = { ...hitsQuery }
|
||||
|
||||
queryDsl.from = 0
|
||||
queryDsl.size = 0
|
||||
|
||||
queryDsl.aggs = {
|
||||
primaryDomains: {
|
||||
terms: {
|
||||
field: 'primaryDomain.id',
|
||||
size: 100
|
||||
}
|
||||
},
|
||||
dictionaries: {
|
||||
terms: {
|
||||
field: 'dictionary.id',
|
||||
size: 200
|
||||
}
|
||||
},
|
||||
sources: {
|
||||
terms: {
|
||||
field: 'source.code'
|
||||
}
|
||||
},
|
||||
foreign: {
|
||||
nested: {
|
||||
path: 'foreignEntries'
|
||||
},
|
||||
aggs: {
|
||||
targetLanguages: {
|
||||
terms: {
|
||||
field: 'foreignEntries.lang.id',
|
||||
size: 50
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return queryDsl
|
||||
}
|
||||
Reference in New Issue
Block a user