Hi
in the past i have all the filters in the query like this :

{
  "from": 0,
  "size": 10,
  "query": {
    "bool": {
      "must": [
        {
          "nested": {
            "path": "readableSpaces",
            "query": {
              "terms": {
                "readableSpaces.id": [
                  43
                ]
              }
            }
          }
        },
        {
          "terms": {
            "postTypes": [
              3,
              4
            ]
          }
        },
        {
          "nested": {
            "path": "folders",
            "query": {
              "terms": {
                "folders.id": [
                  0,
                  23,
                  22
                ]
              }
            }
          }
        }
      ],
      "mustNot": [
        {
          "terms": {
            "status": [
              2,
              0
            ]
          }
        }
      ]
    }
  },
  "fields": [
    "title"
  ]
}



after i read the 
post http://www.elasticsearch.org/blog/all-about-elasticsearch-filter-bitsets/ 
i change all the filter to have better performances but unfortunately no 
improve of performace in the jmeter test so i dont know if i do someting 
wrong ?


{
  "from": 0,
  "size": 10,
  "query": {
    "filtered": {
      "filter": {
        "bool": {
          "must": [
            {
              "nested": {
                "path": "readableSpaces",
                "filter": {
                  "term": {
                    "readableSpaces.id": 43
                  }
                }
              }
            },
            {
              "terms": {
                "postTypes": [
                  3,
                  4
                ]
              }
            },
            {
              "nested": {
                "path": "folders",
                "filter": {
                  "terms": {
                    "folders.id": [
                      0,
                      23,
                      22
                    ]
                  }
                }
              }
            }
          ],
          "mustNot": [
            {
              "terms": {
                "status": [
                  2,
                  0
                ]
              }
            }
          ],
          "_cache": true
        }
      }
    }
  },
  "fields": [
    "title"
  ]
}

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/c3381fdf-6db6-43d3-b878-9bd41ca62406%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to