)]}'
{"doc/source/searchlightapi.rst":[{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"7bec63eb0c6d6982a6b2bc3179eab8e76b071b22","unresolved":false,"context_lines":[{"line_number":276,"context_line":"    \"sort\": {\"name\": \"desc\"}"},{"line_number":277,"context_line":"  }"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"This will be turned into an Elasticsearch query::"},{"line_number":280,"context_line":""},{"line_number":281,"context_line":"  {"},{"line_number":282,"context_line":"    \"query\": {"}],"source_content_type":"text/x-rst","patch_set":4,"id":"fa1b9901_8abfa5fb","line":279,"updated":"2015-08-24 19:58:51.000000000","message":"Why is the below example included? This is the internal data structure used to go from request deserializer to SearchController. I don\u0027t think it is a correct statement that this is the actual elasticsearch query.\n\nThe RequestDeserializer parses out a bunch of kwargs.  One of the kwargs it parses out is the query (the above). However, when that gets passed into the SearchController, it is just the value of the query object:\n\nhttps://github.com/openstack/searchlight/blob/master/searchlight/api/v1/search.py#L47\n\nAnd this passes it through the CatalogSearchRepo which just sets it as the body of the search request.\n\nhttps://github.com/openstack/searchlight/blob/master/searchlight/elasticsearch/__init__.py#L53\n\nComing into searchlight.api.v1.search SearchController and into the CatalogSearchRepo, the query argument is the below, which again is just input as the body to the request.\n\n {\"sort\": [{\"created_at\": \"desc\"}], \"query\": {\"match_all\": {}}}\n\nBesides all of that, the below is not valid JSON. The rendered doc is not string highlighting the strings properly. It is missing the : between the sort and sort example.\n\nFinally, just for kicks, I tried correcting the json and sending directly through to ES (not through searchlight) and it fails with  QueryParsingException[[glance] No query registered for [sort]]; }","commit_id":"1c9fdbfa4b931d9ffdff1de968bb8ee708341d03"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"0658f16b77af8f024819b4d1b97542e1caa290b9","unresolved":false,"context_lines":[{"line_number":276,"context_line":"    \"sort\": {\"name\": \"desc\"}"},{"line_number":277,"context_line":"  }"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"This will be turned into an Elasticsearch query::"},{"line_number":280,"context_line":""},{"line_number":281,"context_line":"  {"},{"line_number":282,"context_line":"    \"query\": {"}],"source_content_type":"text/x-rst","patch_set":4,"id":"fa1b9901_70bf9faa","line":279,"in_reply_to":"fa1b9901_8abfa5fb","updated":"2015-08-24 21:07:16.000000000","message":"Removed; you\u0027re right, this isn\u0027t necessary.","commit_id":"1c9fdbfa4b931d9ffdff1de968bb8ee708341d03"}],"searchlight/api/v1/search.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"3c8f66f6abef0447eea8592eba26237056989b6d","unresolved":false,"context_lines":[{"line_number":319,"context_line":"        if sort_order is not None:"},{"line_number":320,"context_line":"            if isinstance(sort_order, (six.text_type, dict)):"},{"line_number":321,"context_line":"                # Elasticsearch expects a list"},{"line_number":322,"context_line":"                sort_order \u003d [sort_order]"},{"line_number":323,"context_line":"            query_params[\u0027query\u0027][\u0027sort\u0027] \u003d sort_order"},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"        return query_params"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa1b9901_196ae7ed","line":322,"updated":"2015-08-25 15:09:52.000000000","message":"So I think we want a check here, like\n\n    elif not isinstance(sort_order, list):  # Or collections.Iterable\n        raise exc.HTTPBadRequest(...)\n\nPeople will send junk and we should catch it for them. E.g., I can imagine someone sending\n\n   \u0027sort\u0027: 1234,","commit_id":"31ff80f887ea3c9702858e8e34778519a8fbe2bb"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"28d648cb92cf8d68b6c1a92f28b05732b5a410ec","unresolved":false,"context_lines":[{"line_number":319,"context_line":"        if sort_order is not None:"},{"line_number":320,"context_line":"            if isinstance(sort_order, (six.text_type, dict)):"},{"line_number":321,"context_line":"                # Elasticsearch expects a list"},{"line_number":322,"context_line":"                sort_order \u003d [sort_order]"},{"line_number":323,"context_line":"            query_params[\u0027query\u0027][\u0027sort\u0027] \u003d sort_order"},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"        return query_params"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa1b9901_bf007b03","line":322,"in_reply_to":"fa1b9901_196ae7ed","updated":"2015-08-25 15:38:53.000000000","message":"Done","commit_id":"31ff80f887ea3c9702858e8e34778519a8fbe2bb"}]}
