Skip to content

Instantly share code, notes, and snippets.

{
"filtered":{
"filter":{
"nested":{
"path":"productsOptionValues",
"filter":{
"and":[
{
"or":[
{
curl -XGET http://localhost:9200/test/prodtest/_search -d '{"query":
{
"filtered":{
"filter":{
"nested":{
"path":"productsOptionValues",
"filter":{
"and":[
{
"or":[
curl -XDELETE "http://localhost:9200/test/"
curl -XPUT "http://localhost:9200/test/"
curl -XPUT 'http://localhost:9200/test/prodtest/_mapping' -d '
{
"prodtest" : {
"properties" : {
"category" : {
"type" : "string",
$finder = $this->container->get('fos_elastica.finder.ooo.product');
$option1 = new \Elastica\Filter\Term();
$option1->setTerm('productsOptionValues.productOption', 'resolution');
$value1 = new \Elastica\Filter\Term();
$value1->setTerm('productsOptionValues.value', '1920x1080');
$andResolution1 = new \Elastica\Filter\BoolAnd();
$andResolution1->addFilter($option1);
$andResolution1->addFilter($value1);
{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 4,
{
"filtered":{
"filter":{
"nested":{
"path":"productsOptionValues",
"filter":{
"and":[
{
"or":[
{
{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 4,
{
"filtered":{
"filter":{
"nested":{
"path":"productsOptionValues",
"filter":{
"bool":{
"must":[
{
"bool":{
{
"filtered":{
"filter":{
"nested":{
"path":"productsOptionValues",
"filter":{
"bool":{
"must":[
{
"and":[
{
"filtered":{
"filter":{
"nested":{
"path":"productsOptionValues",
"filter":{
"and":[
{
"or":[
{