Last active
December 21, 2015 22:58
-
-
Save btiernay/6378567 to your computer and use it in GitHub Desktop.
Revisions
-
btiernay revised this gist
Sep 17, 2013 . 1 changed file with 6 additions and 17 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,43 +1,32 @@ #!/bin/bash # # Description: # Example that shows how using a `facet_filter` with a `nested` filter fails to return `nested` facet terms. # Remove index if it exists already curl -XDELETE http://localhost:9200/nested # Create a fresh index curl -XPOST http://localhost:9200/nested # Create a nested mapping curl -XPOST http://localhost:9200/nested/type/_mapping -d ' { "type":{ "properties":{ "nested1":{ "type":"nested" } } } }' # Insert a document with a nested doc curl -XPOST http://localhost:9200/nested/type/ -d ' { "nested1":[ { "x":1 } ] }' @@ -66,7 +55,7 @@ curl -XGET http://localhost:9200/nested/type/_search -d ' "nested":"nested1", "facet_filter":{ "nested":{ "path":"nested1", "query":{ "match_all":{} } -
btiernay revised this gist
Aug 30, 2013 . 1 changed file with 8 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,13 +3,13 @@ # Description: # Example that shows how using a `facet_filter` with a `nested` filter fails to return facet terms. # Remove index if it exists already curl -XDELETE http://localhost:9200/nested # Create a fresh index curl -XPOST http://localhost:9200/nested # Create a doubly nested mapping curl -XPOST http://localhost:9200/nested/type/_mapping -d ' { "type":{ @@ -27,7 +27,7 @@ curl -XPOST http://localhost:9200/nested/type/_mapping -d ' } }' # Insert a document with a doubly nested doc curl -XPOST http://localhost:9200/nested/type/ -d ' { "nested1":[ @@ -42,10 +42,12 @@ curl -XPOST http://localhost:9200/nested/type/ -d ' ] }' # Ensure the previous document is searchable curl -XPOST 'http://localhost:9200/nested/_refresh' # Demonstrate that the following query with `facet_filter` and `nested` filter fails to return any terms. Note that # removing the `facet_filter` gives the expected results. # # Expected: # { ... "hits":{"total":1,"max_score":1.0,"hits":[]},"facets":{"nested1":{"_type":"terms","missing":0,"total":1,"other":0,"terms":[{"term":1,"count":1}]}}} # Actual: -
btiernay revised this gist
Aug 30, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,7 +42,7 @@ curl -XPOST http://localhost:9200/nested/type/ -d ' ] }' # Ensure the previous doc is searchable curl -XPOST 'http://localhost:9200/nested/_refresh' # This fails to return any terms: -
btiernay revised this gist
Aug 30, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -74,4 +74,4 @@ curl -XGET http://localhost:9200/nested/type/_search -d ' } }' -
btiernay revised this gist
Aug 30, 2013 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,6 +42,9 @@ curl -XPOST http://localhost:9200/nested/type/ -d ' ] }' # Refresh curl -XPOST 'http://localhost:9200/nested/_refresh' # This fails to return any terms: # Expected: # { ... "hits":{"total":1,"max_score":1.0,"hits":[]},"facets":{"nested1":{"_type":"terms","missing":0,"total":1,"other":0,"terms":[{"term":1,"count":1}]}}} @@ -70,3 +73,5 @@ curl -XGET http://localhost:9200/nested/type/_search -d ' } } }' echo 'Done!' -
btiernay revised this gist
Aug 30, 2013 . 1 changed file with 1 addition and 19 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,24 +42,6 @@ curl -XPOST http://localhost:9200/nested/type/ -d ' ] }' # This fails to return any terms: # Expected: # { ... "hits":{"total":1,"max_score":1.0,"hits":[]},"facets":{"nested1":{"_type":"terms","missing":0,"total":1,"other":0,"terms":[{"term":1,"count":1}]}}} @@ -87,4 +69,4 @@ curl -XGET http://localhost:9200/nested/type/_search -d ' } } } }' -
btiernay revised this gist
Aug 30, 2013 . 1 changed file with 23 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,7 +42,29 @@ curl -XPOST http://localhost:9200/nested/type/ -d ' ] }' # This returns terms: # { ... "hits":{"total":1,"max_score":1.0,"hits":[]},"facets":{"nested1":{"_type":"terms","missing":0,"total":1,"other":0,"terms":[{"term":1,"count":1}]}}} curl -XGET http://localhost:9200/nested/type/_search -d ' { "size":0, "query":{ "match_all":{} }, "facets":{ "nested1":{ "terms":{ "field":"x" }, "nested":"nested1" } } }' # This fails to return any terms: # Expected: # { ... "hits":{"total":1,"max_score":1.0,"hits":[]},"facets":{"nested1":{"_type":"terms","missing":0,"total":1,"other":0,"terms":[{"term":1,"count":1}]}}} # Actual: # { ... "hits":{"total":0,"max_score":null,"hits":[]},"facets":{"nested1":{"_type":"terms","missing":0,"total":0,"other":0,"terms":[]}}} curl -XGET http://localhost:9200/nested/type/_search -d ' { "size":0, -
btiernay revised this gist
Aug 30, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ #!/bin/bash # # Description: # Example that shows how using a `facet_filter` with a `nested` filter fails to return facet terms. # Clean curl -XDELETE http://localhost:9200/nested -
btiernay revised this gist
Aug 30, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,7 +42,7 @@ curl -XPOST http://localhost:9200/nested/type/ -d ' ] }' # This fails to return any terms curl -XGET http://localhost:9200/nested/type/_search -d ' { "size":0, -
btiernay revised this gist
Aug 29, 2013 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -46,7 +46,6 @@ curl -XPOST http://localhost:9200/nested/type/ -d ' curl -XGET http://localhost:9200/nested/type/_search -d ' { "size":0, "query":{ "match_all":{} }, @@ -66,4 +65,4 @@ curl -XGET http://localhost:9200/nested/type/_search -d ' } } } }' -
btiernay revised this gist
Aug 29, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -53,7 +53,7 @@ curl -XGET http://localhost:9200/nested/type/_search -d ' "facets":{ "nested1":{ "terms":{ "field":"x" }, "nested":"nested1", "facet_filter":{ @@ -66,4 +66,4 @@ curl -XGET http://localhost:9200/nested/type/_search -d ' } } } }' -
btiernay revised this gist
Aug 29, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,8 +14,8 @@ curl -XPOST http://localhost:9200/nested/type/_mapping -d ' { "type":{ "properties":{ "nested1":{ "type":"nested", "properties":{ "nested2":{ "type":"nested", @@ -58,7 +58,7 @@ curl -XGET http://localhost:9200/nested/type/_search -d ' "nested":"nested1", "facet_filter":{ "nested":{ "path":"nested1.nested2", "query":{ "match_all":{} } -
btiernay revised this gist
Aug 29, 2013 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,14 +17,14 @@ curl -XPOST http://localhost:9200/nested/type/_mapping -d ' "list":{ "nested1":"nested", "properties":{ "nested2":{ "type":"nested", "properties":{} } } } } } }' # Insert document with a doubly nested doc -
btiernay revised this gist
Aug 29, 2013 . 1 changed file with 8 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,15 +31,15 @@ curl -XPOST http://localhost:9200/nested/type/_mapping -d ' curl -XPOST http://localhost:9200/nested/type/ -d ' { "nested1":[ { "x":1, "nested2":[ { "y":2 } ] } ] }' # This fails with QueryParsingException[[nested] [nested] failed to find nested object under path [nested2]]; -
btiernay revised this gist
Aug 29, 2013 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -60,9 +60,7 @@ curl -XGET http://localhost:9200/nested/type/_search -d ' "nested":{ "path":"nested2", "query":{ "match_all":{} } } } -
btiernay created this gist
Aug 29, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,71 @@ #!/bin/bash # # Description: # Example that shows how using a `facet_filter` with a `nested` filter fails to execute. # Clean curl -XDELETE http://localhost:9200/nested # Create index curl -XPOST http://localhost:9200/nested # Create doubly nested mapping curl -XPOST http://localhost:9200/nested/type/_mapping -d ' { "type":{ "properties":{ "list":{ "nested1":"nested", "properties":{ "nested2":{ "type":"nested", "properties":{} } } } } } }' # Insert document with a doubly nested doc curl -XPOST http://localhost:9200/nested/type/ -d ' { "nested1":[ { "x" : 1, "nested2":[ { "y" : 2 } ] } ] }' # This fails with QueryParsingException[[nested] [nested] failed to find nested object under path [nested2]]; curl -XGET http://localhost:9200/nested/type/_search -d ' { "size":0, "fields":[], "query":{ "match_all":{} }, "facets":{ "nested1":{ "terms":{ "field":"tags" }, "nested":"nested1", "facet_filter":{ "nested":{ "path":"nested2", "query":{ "match_all":{ } } } } } } }'