)]}'
{"searchlight/api/v1/search.py":[{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"114f2c4555306c639ef15b90cfa1b00fe6657a19","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                # type is always the same as the document type. If this is not"},{"line_number":72,"context_line":"                # the case in future, a reverse lookup\u0027s needed"},{"line_number":73,"context_line":"                for hit in hits:"},{"line_number":74,"context_line":"                    hit[\u0027_source\u0027] \u003d utils.convert_field("},{"line_number":75,"context_line":"                        hit[\u0027_source\u0027], utils.DOT_REPLACEMENT_KEY, \u0027.\u0027)"},{"line_number":76,"context_line":"                    plugin \u003d self.plugins[hit[\u0027_type\u0027]].obj"},{"line_number":77,"context_line":"                    plugin.filter_result(hit, req.context)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_9cb53c33","line":74,"range":{"start_line":74,"start_character":43,"end_line":74,"end_character":56},"updated":"2016-09-27 21:15:47.000000000","message":"I\u0027m inclined to do this in filter_result, for the reason that this can only be a problem if dynamic field mapping is true for a plugin (otherwise it will already be taken care of in serialization and filter_result). The downside is you\u0027ll have to pop and push onto \u0027hit\u0027 rather than replacing it, which may not be worth the effort. See what you think.","commit_id":"b7ba8f0efa1b445a6e36ca443413b4dac883d3a0"},{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"ed1f0a71dda334d148855c55cf2a7413124c714d","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                # type is always the same as the document type. If this is not"},{"line_number":72,"context_line":"                # the case in future, a reverse lookup\u0027s needed"},{"line_number":73,"context_line":"                for hit in hits:"},{"line_number":74,"context_line":"                    hit[\u0027_source\u0027] \u003d utils.convert_field("},{"line_number":75,"context_line":"                        hit[\u0027_source\u0027], utils.DOT_REPLACEMENT_KEY, \u0027.\u0027)"},{"line_number":76,"context_line":"                    plugin \u003d self.plugins[hit[\u0027_type\u0027]].obj"},{"line_number":77,"context_line":"                    plugin.filter_result(hit, req.context)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_6e398dd8","line":74,"range":{"start_line":74,"start_character":43,"end_line":74,"end_character":56},"in_reply_to":"5a8bc5a2_9cb53c33","updated":"2016-09-28 01:28:13.000000000","message":"i\u0027m fine with that","commit_id":"b7ba8f0efa1b445a6e36ca443413b4dac883d3a0"}],"searchlight/common/utils.py":[{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"114f2c4555306c639ef15b90cfa1b00fe6657a19","unresolved":false,"context_lines":[{"line_number":475,"context_line":"    return expanded_types"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":""},{"line_number":478,"context_line":"def convert_field(document, original, current):"},{"line_number":479,"context_line":"    \"\"\"Convert field name from original to current\"\"\""},{"line_number":480,"context_line":"    return {k.replace(original, current): v"},{"line_number":481,"context_line":"            for k, v in six.iteritems(document)}"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_894dfcc6","line":478,"range":{"start_line":478,"start_character":4,"end_line":478,"end_character":17},"updated":"2016-09-27 21:15:47.000000000","message":"I\u0027d be inclined to make this function private and add functions replace_dots_in_field_names and restore_dots_in_field_names to make it really obvious what\u0027s going on; I don\u0027t think DOT_REPLACEMENT_KEY ever need to be visible externally.","commit_id":"b7ba8f0efa1b445a6e36ca443413b4dac883d3a0"},{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"ed1f0a71dda334d148855c55cf2a7413124c714d","unresolved":false,"context_lines":[{"line_number":475,"context_line":"    return expanded_types"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":""},{"line_number":478,"context_line":"def convert_field(document, original, current):"},{"line_number":479,"context_line":"    \"\"\"Convert field name from original to current\"\"\""},{"line_number":480,"context_line":"    return {k.replace(original, current): v"},{"line_number":481,"context_line":"            for k, v in six.iteritems(document)}"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_2e56a506","line":478,"range":{"start_line":478,"start_character":4,"end_line":478,"end_character":17},"in_reply_to":"5a8bc5a2_894dfcc6","updated":"2016-09-28 01:28:13.000000000","message":"Ok, will do.","commit_id":"b7ba8f0efa1b445a6e36ca443413b4dac883d3a0"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"9d183b8a6f573203a0ca90b814b11d6785a3bab2","unresolved":false,"context_lines":[{"line_number":478,"context_line":"def convert_field(document, original, current):"},{"line_number":479,"context_line":"    \"\"\"Convert field name from original to current\"\"\""},{"line_number":480,"context_line":"    return {k.replace(original, current): v"},{"line_number":481,"context_line":"            for k, v in six.iteritems(document)}"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_32eadfac","line":481,"updated":"2016-09-26 18:20:19.000000000","message":"Will we ever have a field like this: \"XX_.YY\"? If so, this will first get converted to \"XX___YY\". We will then revert it to \"XX._YY\", swapping the \u0027_\u0027 and \u0027.\u0027\n\nI don\u0027t even want to think about \"XX_._._.YY\" :)","commit_id":"b7ba8f0efa1b445a6e36ca443413b4dac883d3a0"},{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"3a0e6d3f07ce127b127ef145a1181d5a202e1311","unresolved":false,"context_lines":[{"line_number":478,"context_line":"def convert_field(document, original, current):"},{"line_number":479,"context_line":"    \"\"\"Convert field name from original to current\"\"\""},{"line_number":480,"context_line":"    return {k.replace(original, current): v"},{"line_number":481,"context_line":"            for k, v in six.iteritems(document)}"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_b38183fd","line":481,"in_reply_to":"5a8bc5a2_32eadfac","updated":"2016-09-27 00:56:00.000000000","message":"Yeah, it\u0027s possible even it may be a rare case ;( we need to think about more.","commit_id":"b7ba8f0efa1b445a6e36ca443413b4dac883d3a0"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"114f2c4555306c639ef15b90cfa1b00fe6657a19","unresolved":false,"context_lines":[{"line_number":478,"context_line":"def convert_field(document, original, current):"},{"line_number":479,"context_line":"    \"\"\"Convert field name from original to current\"\"\""},{"line_number":480,"context_line":"    return {k.replace(original, current): v"},{"line_number":481,"context_line":"            for k, v in six.iteritems(document)}"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_c6d1b331","line":481,"in_reply_to":"5a8bc5a2_b38183fd","updated":"2016-09-27 21:15:47.000000000","message":"It\u0027s definitely possible; it\u0027s also possible to have nested lists of dicts.","commit_id":"b7ba8f0efa1b445a6e36ca443413b4dac883d3a0"},{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"ed1f0a71dda334d148855c55cf2a7413124c714d","unresolved":false,"context_lines":[{"line_number":478,"context_line":"def convert_field(document, original, current):"},{"line_number":479,"context_line":"    \"\"\"Convert field name from original to current\"\"\""},{"line_number":480,"context_line":"    return {k.replace(original, current): v"},{"line_number":481,"context_line":"            for k, v in six.iteritems(document)}"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_0ebac9c0","line":481,"in_reply_to":"5a8bc5a2_c6d1b331","updated":"2016-09-28 01:28:13.000000000","message":"About the key, what\u0027s about using \u0027++\u0027 instead?","commit_id":"b7ba8f0efa1b445a6e36ca443413b4dac883d3a0"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"3f805da68360d7ef34bca0a7b12e980d8bea62fc","unresolved":false,"context_lines":[{"line_number":478,"context_line":"def _convert_field(document, original, current):"},{"line_number":479,"context_line":"    \"\"\"Convert field name by replacing original string with current\"\"\""},{"line_number":480,"context_line":"    if isinstance(document, dict):"},{"line_number":481,"context_line":"        for k, v in six.iteritems(document):"},{"line_number":482,"context_line":"            if isinstance(v, list) or isinstance(v, dict):"},{"line_number":483,"context_line":"                _convert_field(v, original, current)"},{"line_number":484,"context_line":"            if original in k:"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a98d1f4_6270eea4","line":481,"range":{"start_line":481,"start_character":20,"end_line":481,"end_character":23},"updated":"2016-10-03 20:42:44.000000000","message":"This is quite likely to cause problems because you\u0027re iterating over the dict with iteritems().  You may not always see problems but there\u0027ll be circumstances that could cause an entry to get skipped. Probably safest to use list(six.iteritems(document))  or even list(document.items()","commit_id":"6f2575593b2e0f5a07a2a4ca0bc10d3e6b9f9dfe"},{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"368f59a0a94b4e8058987e5fc21be1c699cb0968","unresolved":false,"context_lines":[{"line_number":478,"context_line":"def _convert_field(document, original, current):"},{"line_number":479,"context_line":"    \"\"\"Convert field name by replacing original string with current\"\"\""},{"line_number":480,"context_line":"    if isinstance(document, dict):"},{"line_number":481,"context_line":"        for k, v in six.iteritems(document):"},{"line_number":482,"context_line":"            if isinstance(v, list) or isinstance(v, dict):"},{"line_number":483,"context_line":"                _convert_field(v, original, current)"},{"line_number":484,"context_line":"            if original in k:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a95cdbc_7e0b522a","line":481,"range":{"start_line":481,"start_character":20,"end_line":481,"end_character":23},"in_reply_to":"3a98d1f4_6270eea4","updated":"2016-10-08 02:08:00.000000000","message":"Done","commit_id":"6f2575593b2e0f5a07a2a4ca0bc10d3e6b9f9dfe"}],"searchlight/elasticsearch/plugins/base.py":[{"author":{"_account_id":16150,"name":"Lei Zhang","email":"lei.a.zhang@intel.com","username":"leizhang"},"change_message_id":"e5f9f2bd4feb6eab8db4c86f983eeb05044f7e34","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        documents \u003d []"},{"line_number":183,"context_line":"        versions \u003d []"},{"line_number":184,"context_line":"        for obj in object_list:"},{"line_number":185,"context_line":"            document \u003d self.convert_field(self.serialize(obj))"},{"line_number":186,"context_line":"            documents.append(document)"},{"line_number":187,"context_line":"            version \u003d self.NotificationHandlerCls.get_version(document)"},{"line_number":188,"context_line":"            versions.append(version)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_8403f875","line":185,"updated":"2016-09-20 08:59:59.000000000","message":"We may also encounter fields contain dot in incremental updates right? So this check cannot cover all the cases. Perhaps can do it during serialization on per plugin basis.","commit_id":"7c9d730e67be98209e5e5fdb26654e65e3cefb11"}],"searchlight/elasticsearch/plugins/helper.py":[{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"9d183b8a6f573203a0ca90b814b11d6785a3bab2","unresolved":false,"context_lines":[{"line_number":190,"context_line":"            # NOTE: In Elasticsearch 2.0 field names cannot contain \u0027.\u0027, change"},{"line_number":191,"context_line":"            # \u0027.\u0027 to \u0027__\u0027."},{"line_number":192,"context_line":"            converted.append("},{"line_number":193,"context_line":"                utils.convert_field(document, \u0027.\u0027, utils.DOT_REPLACEMENT_KEY))"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        try:"},{"line_number":196,"context_line":"            result \u003d helpers.bulk("}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_b28eefcd","line":193,"updated":"2016-09-26 18:20:19.000000000","message":"I think there may an issue here. After we run through this loop, we will have a list of converted documents. But now when we go to save these converted documents, the document fields will not match the mapping fields. Do we need to apply the same conversion to the mapping fields?","commit_id":"b7ba8f0efa1b445a6e36ca443413b4dac883d3a0"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"5ce4bd082d656babd2639af8c7992f615cf0ea88","unresolved":false,"context_lines":[{"line_number":190,"context_line":"            # NOTE: In Elasticsearch 2.0 field names cannot contain \u0027.\u0027, change"},{"line_number":191,"context_line":"            # \u0027.\u0027 to \u0027__\u0027."},{"line_number":192,"context_line":"            converted.append("},{"line_number":193,"context_line":"                utils.convert_field(document, \u0027.\u0027, utils.DOT_REPLACEMENT_KEY))"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        try:"},{"line_number":196,"context_line":"            result \u003d helpers.bulk("}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_d2633240","line":193,"in_reply_to":"5a8bc5a2_13f7978b","updated":"2016-09-27 20:13:02.000000000","message":"Re-reading my comment, I wasn\u0027t as clear as I thought :(\n\nI\u0027m thinking about reducing the possibility of a human-caused error. As someone in the future is creating a new plugin, they may run into a field with a \u0027.\u0027 in it. Will they know enough to modify the field as we are proposing here? If they\u0027re new, probably not.\n\nDuring turn-on they may get an ES error and so will modify the field by hand. But not knowing about utils.convert_field, they may not match what the documents are expecting.\n\nBy running all mappings though utils.convert_field, this should eliminate the guesswork and produce fields that are always consistent with each other.\n\nThat was the not-so-clearly-written point I was trying to make :)","commit_id":"b7ba8f0efa1b445a6e36ca443413b4dac883d3a0"},{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"eb458baa0dae2af3d4018b901d299f4e0e02015a","unresolved":false,"context_lines":[{"line_number":190,"context_line":"            # NOTE: In Elasticsearch 2.0 field names cannot contain \u0027.\u0027, change"},{"line_number":191,"context_line":"            # \u0027.\u0027 to \u0027__\u0027."},{"line_number":192,"context_line":"            converted.append("},{"line_number":193,"context_line":"                utils.convert_field(document, \u0027.\u0027, utils.DOT_REPLACEMENT_KEY))"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        try:"},{"line_number":196,"context_line":"            result \u003d helpers.bulk("}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_da025b72","line":193,"in_reply_to":"5a8bc5a2_4b020371","updated":"2016-09-28 03:25:47.000000000","message":"Just tested, it\u0027s not possible to use \u0027.\u0027 in mapping field, error as below when indexing:\n\nRequestError: TransportError(400, u\u0027mapper_parsing_exception\u0027, u\"Field name [sahara.tag] cannot contain \u0027.\u0027\")","commit_id":"b7ba8f0efa1b445a6e36ca443413b4dac883d3a0"},{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"3a0e6d3f07ce127b127ef145a1181d5a202e1311","unresolved":false,"context_lines":[{"line_number":190,"context_line":"            # NOTE: In Elasticsearch 2.0 field names cannot contain \u0027.\u0027, change"},{"line_number":191,"context_line":"            # \u0027.\u0027 to \u0027__\u0027."},{"line_number":192,"context_line":"            converted.append("},{"line_number":193,"context_line":"                utils.convert_field(document, \u0027.\u0027, utils.DOT_REPLACEMENT_KEY))"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        try:"},{"line_number":196,"context_line":"            result \u003d helpers.bulk("}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_13f7978b","line":193,"in_reply_to":"5a8bc5a2_b28eefcd","updated":"2016-09-27 00:56:00.000000000","message":"dot cannot be contained in field in the first place in 2.x, so we shouldn\u0027t have mapping field contain \u0027.\u0027 in it. Only if you upgrade elasticsearch 1.x to 2.x. , but i\u0027m wondering if we really need to handle this case.","commit_id":"b7ba8f0efa1b445a6e36ca443413b4dac883d3a0"},{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"ed1f0a71dda334d148855c55cf2a7413124c714d","unresolved":false,"context_lines":[{"line_number":190,"context_line":"            # NOTE: In Elasticsearch 2.0 field names cannot contain \u0027.\u0027, change"},{"line_number":191,"context_line":"            # \u0027.\u0027 to \u0027__\u0027."},{"line_number":192,"context_line":"            converted.append("},{"line_number":193,"context_line":"                utils.convert_field(document, \u0027.\u0027, utils.DOT_REPLACEMENT_KEY))"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        try:"},{"line_number":196,"context_line":"            result \u003d helpers.bulk("}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_4b020371","line":193,"in_reply_to":"5a8bc5a2_d2633240","updated":"2016-09-28 01:28:13.000000000","message":"Make sense, thanks for further clarification","commit_id":"b7ba8f0efa1b445a6e36ca443413b4dac883d3a0"},{"author":{"_account_id":14680,"name":"Rick Aulino","email":"rick.aulino@hpe.com","username":"ricka"},"change_message_id":"ab3f6e27bda99039ab0111c89d7fcf9a5f8204da","unresolved":false,"context_lines":[{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        for document in documents:"},{"line_number":189,"context_line":"            # NOTE: In Elasticsearch 2.0 field names cannot contain \u0027.\u0027, change"},{"line_number":190,"context_line":"            # \u0027.\u0027 to \u0027__\u0027."},{"line_number":191,"context_line":"            utils.replace_dots_in_field_names(document)"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a98d1f4_38e212a0","line":190,"updated":"2016-09-30 01:33:24.000000000","message":"Oops. The comment is for an older version of the patch. We are no longer using \u0027__\u0027. Either change it to \u0027++\u0027 or just reference DOT_REPLACEMENT_KEY to make the comment relevant in the future when someones changes the value of DOT_REPLACEMENT_KEY :)","commit_id":"838652e7da2c4841075615fa0ad359e45432c7f3"},{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"df4c4d3f90ed47d3e0b491eb2ca1573e13d64f14","unresolved":false,"context_lines":[{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        for document in documents:"},{"line_number":189,"context_line":"            # NOTE: In Elasticsearch 2.0 field names cannot contain \u0027.\u0027, change"},{"line_number":190,"context_line":"            # \u0027.\u0027 to \u0027__\u0027."},{"line_number":191,"context_line":"            utils.replace_dots_in_field_names(document)"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a98d1f4_b3f483f2","line":190,"in_reply_to":"3a98d1f4_38e212a0","updated":"2016-09-30 01:53:11.000000000","message":"Done","commit_id":"838652e7da2c4841075615fa0ad359e45432c7f3"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"3f805da68360d7ef34bca0a7b12e980d8bea62fc","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        else:"},{"line_number":186,"context_line":"            use_index \u003d index"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        for document in documents:"},{"line_number":189,"context_line":"            # NOTE: In Elasticsearch 2.0 field names cannot contain \u0027.\u0027, change"},{"line_number":190,"context_line":"            # \u0027.\u0027 to \u0027++\u0027."},{"line_number":191,"context_line":"            utils.replace_dots_in_field_names(document)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a98d1f4_e28a3e63","line":188,"range":{"start_line":188,"start_character":12,"end_line":188,"end_character":20},"updated":"2016-10-03 20:42:44.000000000","message":"I\u0027d still like this to operate only on plugins with dynamic mapping, otherwise this gets done for every document index. However, I\u0027m ok adding that as a performance enhancement later","commit_id":"6f2575593b2e0f5a07a2a4ca0bc10d3e6b9f9dfe"},{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"368f59a0a94b4e8058987e5fc21be1c699cb0968","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        else:"},{"line_number":186,"context_line":"            use_index \u003d index"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        for document in documents:"},{"line_number":189,"context_line":"            # NOTE: In Elasticsearch 2.0 field names cannot contain \u0027.\u0027, change"},{"line_number":190,"context_line":"            # \u0027.\u0027 to \u0027++\u0027."},{"line_number":191,"context_line":"            utils.replace_dots_in_field_names(document)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a95cdbc_f97a1c87","line":188,"range":{"start_line":188,"start_character":12,"end_line":188,"end_character":20},"in_reply_to":"3a98d1f4_e28a3e63","updated":"2016-10-08 02:08:00.000000000","message":"Ok, i\u0027d like to address this in another patch.","commit_id":"6f2575593b2e0f5a07a2a4ca0bc10d3e6b9f9dfe"}]}
