)]}'
{"searchlightclient/osc/v1/search.py":[{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"ee43c3e28b17a71aa5737366efaac156897fa90c","unresolved":false,"context_lines":[{"line_number":32,"context_line":"            \"query\","},{"line_number":33,"context_line":"            metavar\u003d\"\u003cquery\u003e\","},{"line_number":34,"context_line":"            help\u003d\"Query resources by Elasticsearch query string or json \""},{"line_number":35,"context_line":"                 \"format DSL. Query String Example: \u0027name: cirros AND \""},{"line_number":36,"context_line":"                 \"updated_at: [now-1y TO now]\u0027. DSL Example \u0027{\\\"query\\\": \""},{"line_number":37,"context_line":"                 \"{\\\"term\\\": {\\\"name\\\": \\\"cirros\\\"}}}\u0027. \""},{"line_number":38,"context_line":"                 \"See Elasticsearch DSL or Searchlight documentation for \""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a5ae5dd_cbbb77c3","line":35,"updated":"2016-02-03 19:54:17.000000000","message":"Let\u0027s put the examples on their own line if possible. It makes it easier to read and copy / paste","commit_id":"4eabfdd69dfd668934f5bd8d31ab99b57d74fd3a"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"f7e1937e8d6c0c8cd063503b3d4518670693e6d2","unresolved":false,"context_lines":[{"line_number":97,"context_line":"                    print(\"ERROR: There must be a \u0027query\u0027 parameter within \""},{"line_number":98,"context_line":"                          \"the query request body when using Query DSL.\")"},{"line_number":99,"context_line":"                    exit(1)"},{"line_number":100,"context_line":"            except ValueError:"},{"line_number":101,"context_line":"                query \u003d {\"query_string\": {\"query\": parsed_args.query}}"},{"line_number":102,"context_line":"            params[\u0027query\u0027] \u003d query"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a57f1b5_e69df066","line":100,"updated":"2016-02-11 22:39:14.000000000","message":"Consider the case where the user wants to do a DSL query, but has a typo in the JSON (very easy to do). In this case, we will hit the exception and treat it as a non-DSL query. But this query will not be correct and return the wrong results to the user. Since the user is not aware of the typo, they will not realize the results are wrong. Is this OK?","commit_id":"4eabfdd69dfd668934f5bd8d31ab99b57d74fd3a"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"f36e82a0a3999c015cd78a301ff3f4fe5e773e12","unresolved":false,"context_lines":[{"line_number":97,"context_line":"                    print(\"ERROR: There must be a \u0027query\u0027 parameter within \""},{"line_number":98,"context_line":"                          \"the query request body when using Query DSL.\")"},{"line_number":99,"context_line":"                    exit(1)"},{"line_number":100,"context_line":"            except ValueError:"},{"line_number":101,"context_line":"                query \u003d {\"query_string\": {\"query\": parsed_args.query}}"},{"line_number":102,"context_line":"            params[\u0027query\u0027] \u003d query"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a57f1b5_057017db","line":100,"in_reply_to":"3a57f1b5_e69df066","updated":"2016-02-12 16:36:48.000000000","message":"I think Travis has brought this up too; it\u0027s quite easy to miss a brace and accidentally run a bizarre query_string. For now, I think let\u0027s play safe and add an explicit --json flag (this also potentially allows other formats later) and perhaps leave the parsing code in and warn if a non-\u0027--json\u0027 query looks like valid json (i.e. a valid JSON object, or a *quoted* string).","commit_id":"4eabfdd69dfd668934f5bd8d31ab99b57d74fd3a"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"d81388f09c75702486361814203b7aef1a2e4bec","unresolved":false,"context_lines":[{"line_number":32,"context_line":"            \"query\","},{"line_number":33,"context_line":"            metavar\u003d\"\u003cquery\u003e\","},{"line_number":34,"context_line":"            help\u003d\"Query resources by Elasticsearch query string or json \""},{"line_number":35,"context_line":"                 \"format DSL. Query String Example: \u0027name: cirros AND \""},{"line_number":36,"context_line":"                 \"updated_at: [now-1y TO now]\u0027. DSL Example \u0027{\\\"query\\\": \""},{"line_number":37,"context_line":"                 \"{\\\"term\\\": {\\\"name\\\": \\\"cirros\\\"}}}\u0027. \""},{"line_number":38,"context_line":"                 \"See Elasticsearch DSL or Searchlight documentation for \""}],"source_content_type":"text/x-python","patch_set":2,"id":"dae33548_b3a98726","line":35,"range":{"start_line":35,"start_character":36,"end_line":35,"end_character":42},"updated":"2016-02-18 16:54:40.000000000","message":"Nitpick - upper case \u0027S\u0027 and \u0027E\u0027 are not necessary (Query string example:)","commit_id":"5786f03679faf551adc63d94101fcbfa82f5faf2"},{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"840b4f7b3c1c4e7969d7b25681b2b28a4d7f6f2b","unresolved":false,"context_lines":[{"line_number":32,"context_line":"            \"query\","},{"line_number":33,"context_line":"            metavar\u003d\"\u003cquery\u003e\","},{"line_number":34,"context_line":"            help\u003d\"Query resources by Elasticsearch query string or json \""},{"line_number":35,"context_line":"                 \"format DSL. Query String Example: \u0027name: cirros AND \""},{"line_number":36,"context_line":"                 \"updated_at: [now-1y TO now]\u0027. DSL Example \u0027{\\\"query\\\": \""},{"line_number":37,"context_line":"                 \"{\\\"term\\\": {\\\"name\\\": \\\"cirros\\\"}}}\u0027. \""},{"line_number":38,"context_line":"                 \"See Elasticsearch DSL or Searchlight documentation for \""}],"source_content_type":"text/x-python","patch_set":2,"id":"dae33548_a77c8eec","line":35,"range":{"start_line":35,"start_character":36,"end_line":35,"end_character":42},"in_reply_to":"dae33548_b3a98726","updated":"2016-02-19 01:45:52.000000000","message":"Done","commit_id":"5786f03679faf551adc63d94101fcbfa82f5faf2"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"d81388f09c75702486361814203b7aef1a2e4bec","unresolved":false,"context_lines":[{"line_number":33,"context_line":"            metavar\u003d\"\u003cquery\u003e\","},{"line_number":34,"context_line":"            help\u003d\"Query resources by Elasticsearch query string or json \""},{"line_number":35,"context_line":"                 \"format DSL. Query String Example: \u0027name: cirros AND \""},{"line_number":36,"context_line":"                 \"updated_at: [now-1y TO now]\u0027. DSL Example \u0027{\\\"query\\\": \""},{"line_number":37,"context_line":"                 \"{\\\"term\\\": {\\\"name\\\": \\\"cirros\\\"}}}\u0027. \""},{"line_number":38,"context_line":"                 \"See Elasticsearch DSL or Searchlight documentation for \""},{"line_number":39,"context_line":"                 \"more detail.\""}],"source_content_type":"text/x-python","patch_set":2,"id":"dae33548_53759bc8","line":36,"range":{"start_line":36,"start_character":52,"end_line":36,"end_character":59},"updated":"2016-02-18 16:54:40.000000000","message":"Same, upper case \u0027E\u0027 not required","commit_id":"5786f03679faf551adc63d94101fcbfa82f5faf2"},{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"840b4f7b3c1c4e7969d7b25681b2b28a4d7f6f2b","unresolved":false,"context_lines":[{"line_number":33,"context_line":"            metavar\u003d\"\u003cquery\u003e\","},{"line_number":34,"context_line":"            help\u003d\"Query resources by Elasticsearch query string or json \""},{"line_number":35,"context_line":"                 \"format DSL. Query String Example: \u0027name: cirros AND \""},{"line_number":36,"context_line":"                 \"updated_at: [now-1y TO now]\u0027. DSL Example \u0027{\\\"query\\\": \""},{"line_number":37,"context_line":"                 \"{\\\"term\\\": {\\\"name\\\": \\\"cirros\\\"}}}\u0027. \""},{"line_number":38,"context_line":"                 \"See Elasticsearch DSL or Searchlight documentation for \""},{"line_number":39,"context_line":"                 \"more detail.\""}],"source_content_type":"text/x-python","patch_set":2,"id":"dae33548_e78696da","line":36,"range":{"start_line":36,"start_character":52,"end_line":36,"end_character":59},"in_reply_to":"dae33548_53759bc8","updated":"2016-02-19 01:45:52.000000000","message":"Done","commit_id":"5786f03679faf551adc63d94101fcbfa82f5faf2"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"d81388f09c75702486361814203b7aef1a2e4bec","unresolved":false,"context_lines":[{"line_number":42,"context_line":"            \"--json\","},{"line_number":43,"context_line":"            action\u003d\u0027store_true\u0027,"},{"line_number":44,"context_line":"            default\u003dFalse,"},{"line_number":45,"context_line":"            help\u003d\"Whether to pass json format query string for query.\""},{"line_number":46,"context_line":"        )"},{"line_number":47,"context_line":"        parser.add_argument("},{"line_number":48,"context_line":"            \"--type\","}],"source_content_type":"text/x-python","patch_set":2,"id":"dae33548_3311f652","line":45,"range":{"start_line":45,"start_character":26,"end_line":45,"end_character":28},"updated":"2016-02-18 16:54:40.000000000","message":"Phrasing is a bit awkward. Maybe \"Treat the query argument as a JSON formatted DSL query\"","commit_id":"5786f03679faf551adc63d94101fcbfa82f5faf2"},{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"840b4f7b3c1c4e7969d7b25681b2b28a4d7f6f2b","unresolved":false,"context_lines":[{"line_number":42,"context_line":"            \"--json\","},{"line_number":43,"context_line":"            action\u003d\u0027store_true\u0027,"},{"line_number":44,"context_line":"            default\u003dFalse,"},{"line_number":45,"context_line":"            help\u003d\"Whether to pass json format query string for query.\""},{"line_number":46,"context_line":"        )"},{"line_number":47,"context_line":"        parser.add_argument("},{"line_number":48,"context_line":"            \"--type\","}],"source_content_type":"text/x-python","patch_set":2,"id":"dae33548_a763ee40","line":45,"range":{"start_line":45,"start_character":26,"end_line":45,"end_character":28},"in_reply_to":"dae33548_3311f652","updated":"2016-02-19 01:45:52.000000000","message":"This looks better, Done","commit_id":"5786f03679faf551adc63d94101fcbfa82f5faf2"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"d81388f09c75702486361814203b7aef1a2e4bec","unresolved":false,"context_lines":[{"line_number":105,"context_line":"            else:"},{"line_number":106,"context_line":"                try:"},{"line_number":107,"context_line":"                    json.loads(parsed_args.query)"},{"line_number":108,"context_line":"                    print(\"You should use --json flag when doing an json \""},{"line_number":109,"context_line":"                          \"format query.\")"},{"line_number":110,"context_line":"                    exit(1)"},{"line_number":111,"context_line":"                except Exception:"}],"source_content_type":"text/x-python","patch_set":2,"id":"dae33548_3338d6d2","line":108,"range":{"start_line":108,"start_character":42,"end_line":108,"end_character":44},"updated":"2016-02-18 16:54:40.000000000","message":"nitpick - \"the --json flag\"","commit_id":"5786f03679faf551adc63d94101fcbfa82f5faf2"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"9aea3a19cabd86c652e3411050662b3081c0979e","unresolved":false,"context_lines":[{"line_number":105,"context_line":"            else:"},{"line_number":106,"context_line":"                try:"},{"line_number":107,"context_line":"                    json.loads(parsed_args.query)"},{"line_number":108,"context_line":"                    print(\"You should use --json flag when doing an json \""},{"line_number":109,"context_line":"                          \"format query.\")"},{"line_number":110,"context_line":"                    exit(1)"},{"line_number":111,"context_line":"                except Exception:"}],"source_content_type":"text/x-python","patch_set":2,"id":"dae33548_d2f4fbf1","line":108,"range":{"start_line":108,"start_character":42,"end_line":108,"end_character":44},"in_reply_to":"dae33548_3338d6d2","updated":"2016-02-18 20:30:24.000000000","message":"Further nitpick. \"...when specifying JSON\" or \"...when specifying a JSON object\".","commit_id":"5786f03679faf551adc63d94101fcbfa82f5faf2"},{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"840b4f7b3c1c4e7969d7b25681b2b28a4d7f6f2b","unresolved":false,"context_lines":[{"line_number":105,"context_line":"            else:"},{"line_number":106,"context_line":"                try:"},{"line_number":107,"context_line":"                    json.loads(parsed_args.query)"},{"line_number":108,"context_line":"                    print(\"You should use --json flag when doing an json \""},{"line_number":109,"context_line":"                          \"format query.\")"},{"line_number":110,"context_line":"                    exit(1)"},{"line_number":111,"context_line":"                except Exception:"}],"source_content_type":"text/x-python","patch_set":2,"id":"dae33548_07d0dac8","line":108,"range":{"start_line":108,"start_character":42,"end_line":108,"end_character":44},"in_reply_to":"dae33548_d2f4fbf1","updated":"2016-02-19 01:45:52.000000000","message":"Done","commit_id":"5786f03679faf551adc63d94101fcbfa82f5faf2"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"d81388f09c75702486361814203b7aef1a2e4bec","unresolved":false,"context_lines":[{"line_number":110,"context_line":"                    exit(1)"},{"line_number":111,"context_line":"                except Exception:"},{"line_number":112,"context_line":"                    query \u003d {\"query_string\": {\"query\": parsed_args.query}}"},{"line_number":113,"context_line":"            params[\u0027query\u0027] \u003d query"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        data \u003d search_client.search.search(**params)"},{"line_number":116,"context_line":"        result \u003d []"}],"source_content_type":"text/x-python","patch_set":2,"id":"dae33548_53d91bf2","line":113,"range":{"start_line":113,"start_character":12,"end_line":113,"end_character":18},"updated":"2016-02-18 16:54:40.000000000","message":"Just noticed this while testing. If we\u0027re ignoring everything other than \"query\" why require it at all?\n\nopenstack search query --json \u0027{\"term\": {\"name\": \"cirros\"}}\u0027\n\nOtherwise, we should allow the JSON payload to include a full query DSL object:\n\nopenstack search query --json \u0027{\"query\": {\"term\": {\"name\": \"cirros\"}}, \"type\": \"OS::Glance::Image\"}\u0027\n\nI\u0027m ok with either approach; I moderately prefer not requiring \"query\" (e.g. my first example)","commit_id":"5786f03679faf551adc63d94101fcbfa82f5faf2"},{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"840b4f7b3c1c4e7969d7b25681b2b28a4d7f6f2b","unresolved":false,"context_lines":[{"line_number":110,"context_line":"                    exit(1)"},{"line_number":111,"context_line":"                except Exception:"},{"line_number":112,"context_line":"                    query \u003d {\"query_string\": {\"query\": parsed_args.query}}"},{"line_number":113,"context_line":"            params[\u0027query\u0027] \u003d query"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        data \u003d search_client.search.search(**params)"},{"line_number":116,"context_line":"        result \u003d []"}],"source_content_type":"text/x-python","patch_set":2,"id":"dae33548_2a08432d","line":113,"range":{"start_line":113,"start_character":12,"end_line":113,"end_character":18},"in_reply_to":"dae33548_53d91bf2","updated":"2016-02-19 01:45:52.000000000","message":"Done","commit_id":"5786f03679faf551adc63d94101fcbfa82f5faf2"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"c89320dc89039329de281494a1504b65518a2f24","unresolved":false,"context_lines":[{"line_number":105,"context_line":"                    exit(1)"},{"line_number":106,"context_line":"                except Exception:"},{"line_number":107,"context_line":"                    query \u003d {\"query_string\": {\"query\": parsed_args.query}}"},{"line_number":108,"context_line":"            params[\u0027query\u0027] \u003d query"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        data \u003d search_client.search.search(**params)"},{"line_number":111,"context_line":"        result \u003d []"}],"source_content_type":"text/x-python","patch_set":3,"id":"bae84128_0de612b4","line":108,"updated":"2016-02-19 23:34:45.000000000","message":"I saw Steve had this go to just the query...  I guess that\u0027s okay. I does mean we can\u0027t send in extra params like \"all_projects\": true that aren\u0027t part of the query.  I guess this is okay and since those extras are searchlight specific we could later add CLI flags for them.  Or later add back support for either syntax (nested query or this). I\u0027m not sure which is better, so I\u0027ll go with the simpler input for now.","commit_id":"7b1c2c72d372170cf7667e95629383500e5ef8d4"},{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"17404b1dfa3554827ff8b78dbd04e55fb444ba01","unresolved":false,"context_lines":[{"line_number":105,"context_line":"                    exit(1)"},{"line_number":106,"context_line":"                except Exception:"},{"line_number":107,"context_line":"                    query \u003d {\"query_string\": {\"query\": parsed_args.query}}"},{"line_number":108,"context_line":"            params[\u0027query\u0027] \u003d query"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        data \u003d search_client.search.search(**params)"},{"line_number":111,"context_line":"        result \u003d []"}],"source_content_type":"text/x-python","patch_set":3,"id":"bae84128_a5a0afa0","line":108,"in_reply_to":"bae84128_0de612b4","updated":"2016-02-22 06:12:22.000000000","message":"There are already some extra searchlight specific flags like \u0027type\u0027, \u0027all_projects\u0027, and \u0027source\u0027, it covers most of the cases, so i think it is ok for now.","commit_id":"7b1c2c72d372170cf7667e95629383500e5ef8d4"}],"searchlightclient/tests/unit/osc/v1/test_search.py":[{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"06a995182c7206bc5e8dbd14ec74e07a3e90c15a","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        self._test_search([\u0027{\"query\": {\"term\": {\"status\": \"active\"}}}\u0027],"},{"line_number":88,"context_line":"                          query\u003d{\u0027term\u0027: {\u0027status\u0027: \u0027active\u0027}},"},{"line_number":89,"context_line":"                          _source\u003d[\u0027name\u0027, \u0027updated_at\u0027],"},{"line_number":90,"context_line":"                          all_projects\u003dFalse, type\u003dNone)"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def test_list_all_projects(self):"},{"line_number":93,"context_line":"        self._test_search([\"name: fake\", \"--all-projects\"],"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a5ae5dd_56e72be4","line":90,"updated":"2016-02-03 21:56:36.000000000","message":"Can we also test for invalid json?","commit_id":"4eabfdd69dfd668934f5bd8d31ab99b57d74fd3a"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"d81388f09c75702486361814203b7aef1a2e4bec","unresolved":false,"context_lines":[{"line_number":97,"context_line":"            query\u003d{\u0027term\u0027: {\u0027status\u0027: \u0027active\u0027}},"},{"line_number":98,"context_line":"            _source\u003d[\u0027name\u0027, \u0027updated_at\u0027],"},{"line_number":99,"context_line":"            all_projects\u003dFalse, type\u003dNone)"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def test_list_all_projects(self):"},{"line_number":102,"context_line":"        self._test_search([\"name: fake\", \"--all-projects\"],"},{"line_number":103,"context_line":"                          query\u003d{\"query_string\": {\"query\": \"name: fake\"}},"}],"source_content_type":"text/x-python","patch_set":2,"id":"dae33548_b39227f4","line":100,"updated":"2016-02-18 16:54:40.000000000","message":"If we\u0027re requiring \"query\" to be in the query payload, should test that too. If not, then this can be ignored.","commit_id":"5786f03679faf551adc63d94101fcbfa82f5faf2"}]}
