I am currently implementing a RESTful API for Elastic Search. Is there a way to query ES with a generic value? For example, this will allow the user to pass in any key and value and this would convert the value to whatever typeof field it is. I feel like I am complicating it. Is there a simpler way to query ES with generic values being passed to it?
Ex:
I could pass the following: POST command -
RulesGreaterThanDictionary is :
public Dictionary<string, Object> RulesGreaterThanDictionary { get; set; }
And the POST call is :
{
"RuleEquals":
{
"RulesEqualDictionary":
{
"email" : "ggg@gmail.com",
"validUser" : true
}
},
"RuleGreaterThan" :
{
"RulesGreaterThanDictionary" :
{
"minamount" : 10
}
}
}
As this would query ES to find documents that have email equal to some email, and is a valid user as well as the minamount of the item is at least 10.
Something generic like that.
Has this already been implemented before? Thank you!