DCausse has uploaded a new change for review. https://gerrit.wikimedia.org/r/324389
Change subject: Use "docId" instead of "pageId" ...................................................................... Use "docId" instead of "pageId" Change-Id: I74f1d11b8a3a62a2f643a80db77d6a044ba3201b --- M jsondiff.py M relcomp.py 2 files changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/relevanceForge refs/changes/89/324389/1 diff --git a/jsondiff.py b/jsondiff.py index 7f3651b..a273c46 100755 --- a/jsondiff.py +++ b/jsondiff.py @@ -5,7 +5,7 @@ # This program does diffs of two files with one JSON blob per line, # outputting one color-coded HTML diff per line into a target directory. # It performs a diff on the ordered list of results (based on a key value, -# either pageId or title). It then notes differences within the details of +# either docId or title). It then notes differences within the details of # a given result. # # It has a number of hacks specific to diffing JSON from CirrusSearch @@ -265,7 +265,7 @@ <b>score:</b> {0:}<br>\n'''.format(result['score']) for item in sorted(result.keys()): - if item not in ('pageId', 'score', 'title'): + if item not in ('docId', 'score', 'title'): retval += html_result_item(result[item], item) retval += '''\ @@ -469,10 +469,10 @@ parser.add_argument('-d', '--dir', dest='dir', default='./diffs/', help='output directory, default is ./diffs/') parser.add_argument("-t", "--bytitle", dest="bytitle", action='store_true', default=False, - help="use title rather than pageId to match results") + help="use title rather than docId to match results") args = parser.parse_args() - key = 'pageId' + key = 'docId' if (args.bytitle): key = 'title' diff --git a/relcomp.py b/relcomp.py index e2f71ea..87ceee2 100755 --- a/relcomp.py +++ b/relcomp.py @@ -218,7 +218,7 @@ class TopNDiff(Metric): """Percentage of query pairs where the top N results DO NOT have the - same pageIds (ignoring order by default) + same docIds (ignoring order by default) """ __metaclass__ = ABCMeta @@ -260,8 +260,8 @@ x["rows"] = list() if "rows" not in y: y["rows"] = list() - x_ids = map((lambda r: r["pageId"]), x["rows"][0:self.topN]) - y_ids = map((lambda r: r["pageId"]), y["rows"][0:self.topN]) + x_ids = map((lambda r: r["docId"]), x["rows"][0:self.topN]) + y_ids = map((lambda r: r["docId"]), y["rows"][0:self.topN]) if self.sorted: if len(x_ids) != len(y_ids): -- To view, visit https://gerrit.wikimedia.org/r/324389 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I74f1d11b8a3a62a2f643a80db77d6a044ba3201b Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/discovery/relevanceForge Gerrit-Branch: master Gerrit-Owner: DCausse <dcau...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits