From cdd0725e88abfe236895208521b1e56591bf3cef Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Tue, 22 Dec 2015 21:37:05 +0000 Subject: [PATCH] -v option added to list the path --- bin/indexer_lookup.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/indexer_lookup.py b/bin/indexer_lookup.py index b8fc6e1a..c7674d38 100644 --- a/bin/indexer_lookup.py +++ b/bin/indexer_lookup.py @@ -36,6 +36,7 @@ argParser.add_argument('-n', action='store_true', default=False, help='return nu argParser.add_argument('-t', action='store_true', default=False, help='dump top 500 terms') argParser.add_argument('-l', action='store_true', default=False, help='dump all terms encountered in indexed documents') argParser.add_argument('-f', action='store_true', default=False, help='dump each matching document') +argParser.add_argument('-v', action='store_true', default=False, help='Include filepath') argParser.add_argument('-s', action='append', help='search similar documents') args = argParser.parse_args() @@ -84,6 +85,8 @@ with ix.searcher() as searcher: results = searcher.search(query, limit=None) for x in results: if args.f: + if args.v: + print (x.items()[0][1]) print (readdoc(path=x.items()[0][1])) else: print (x.items()[0][1])