mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 00:28:22 +00:00
-l added -> dumping all terms indexed
This commit is contained in:
parent
f3d1ca052e
commit
f65a94d47b
1 changed files with 8 additions and 1 deletions
|
@ -24,7 +24,8 @@ indexertype = cfg.get("Indexer", "type")
|
||||||
|
|
||||||
argParser = argparse.ArgumentParser(description='Fulltext search for AIL')
|
argParser = argparse.ArgumentParser(description='Fulltext search for AIL')
|
||||||
argParser.add_argument('-q', action='append', help='query to lookup (one or more)')
|
argParser.add_argument('-q', action='append', help='query to lookup (one or more)')
|
||||||
argParser.add_argument('-n', action='store_true', default=False, help='Return numbers of document indexed')
|
argParser.add_argument('-n', action='store_true', default=False, help='return numbers of indexed documents')
|
||||||
|
argParser.add_argument('-l', action='store_true', default=False, help='dump all terms encountered in indexed documents')
|
||||||
args = argParser.parse_args()
|
args = argParser.parse_args()
|
||||||
|
|
||||||
from whoosh import index
|
from whoosh import index
|
||||||
|
@ -39,6 +40,12 @@ if args.n:
|
||||||
print ix.doc_count_all()
|
print ix.doc_count_all()
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
|
if args.l:
|
||||||
|
xr = ix.searcher().reader()
|
||||||
|
for x in xr.lexicon("content"):
|
||||||
|
print (x)
|
||||||
|
exit(0)
|
||||||
|
|
||||||
if args.q is None:
|
if args.q is None:
|
||||||
argParser.print_help()
|
argParser.print_help()
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
Loading…
Reference in a new issue