# # $Id$ # from sphinxapi import * import sys, time if not sys.argv[1:]: print "Usage: python test.py [OPTIONS] query words\n" print "Options are:" print "-h, --host \tconnect to searchd at host HOST" print "-p, --port\t\tconnect to searchd at port PORT" print "-i, --index \tsearch through index(es) specified by IDX" print "-s, --sortby \tsort matches by 'EXPR'" print "-a, --any\t\tuse 'match any word' matching mode" print "-b, --boolean\t\tuse 'boolean query' matching mode" print "-e, --extended\t\tuse 'extended query' matching mode" print "-f, --filter \tfilter by attribute 'ATTR' (default is 'group_id')" print "-v, --value \tadd VAL to allowed 'group_id' values list" print "-g, --groupby \tgroup matches by 'EXPR'" print "-gs,--groupsort \tsort groups by 'EXPR'" print "-l, --limit \tretrieve COUNT matches (default is 20)" sys.exit(0) q = '' mode = SPH_MATCH_ALL host = 'localhost' port = 9312 index = '*' filtercol = 'group_id' filtervals = [] sortby = '' groupby = '' groupsort = '@group desc' limit = 0 i = 1 while (i