Elastica
Elastica copied to clipboard
Is it possible to add raw query with array?
I have :
$matchQuery = new MatchQuery();
$matchQuery->setField('testString, 'test');
$query->addShould($matchQuery);
and that gives me:
"query": {
"bool": {
"should": [
{
"match": {
"testString": "test"
}
}
]
}
}
Now I want something like this:
$matchQuery = new MatchQuery();
$matchQuery->setField('testString, 'test');
$query->addShould($matchQuery);
$query->addShould(new RawQuery([
"match": [
"testString" => "test2"
]
]));
to get this in query:
"query": {
"bool": {
"should": [
{
"match": {
"testString": "test"
}
},
{
"match": {
"testString": "test2"
}
}
]
}
}