i need to change the field dynamically
this.search = function(search, match) {
var deferred = $q.defer()
search({
size: 10000,
index: "products",
body: {
"query": {
"match": {
[search]: {
"query": match,
// "operator": "and",
type:"phrase"
}
}
}
}
but its showing the error 30:16 error Parsing error: Unexpected token [
searchis overloaded. It is used both as the name of a function and also as a parameter of a function.