import searchform, resultlist, drilldown #import cqlparser, cqlwebutils #def createCqlQuery(query, drilldownargs): # q = cqlwebutils.parseCqlFromWeb(query) # if q.isEmpty(): # q.add('meresco.exists') # q.add('true') # q.EXACT() # for fieldAndTerm in drilldownargs: # field, term = drilldown.fieldAndTermSplit(fieldAndTerm) # q.add(field) # q.add(term) # q.EXACT() # q.AND() # # cqlQuery = str(q) # return cqlQuery def main(headers={}, arguments={}, *args, **kwargs): httpQuery = arguments.get('query', [''])[0] sortBy = sortDescending = None sortKeys = arguments.get('sortKeys', [''])[0] if not sortKeys: sortKeys = any.configuration().get('defaultSortKeys', None) if sortKeys: sortBy, ignored, sortDescending = sortKeys.split(',') sortDescending = sortDescending == '1' # cqlQuery = createCqlQuery(httpQuery, arguments.get('drilldown', [])) # parsetree = cqlparser.parseString(cqlQuery) drilldownArguments = arguments.get('drilldown', []) ### parsetree wordt doorgegeven aan search engine via de call executeCQL ### cqlQuery is de serialisatie die gebruikt wordt voor RSS parsetree, cqlQuery = any.parseQuery(httpQuery, drilldownArguments) t0 = time() offset = int(arguments.get('offset', ['0'])[0]) ### De start en stop argumenten bepalen het begin en eind record welke worden teruggegeven. ### De +10 in de stop is dus de batchgrootte. total, recordIds = any.executeCQL(cqlAbstractSyntaxTree=parsetree, start=offset, stop=offset+10, sortBy=sortBy, sortDescending=sortDescending) bitMatrixRow = any.bitMatrixRow(cqlAbstractSyntaxTree=parsetree) duration = time() - t0 yield """
""" yield searchform.main(arguments=arguments, *args, **kwargs) rssLink = 'http://%s/rss?%s' % (any.configuration().get('host', ''), urlencode({'query': cqlQuery})) yield """
""" % rssLink yield 'rss' % rssLink yield """
""" yield resultlist.main(total=total, recordIds=recordIds, bitMatrixRow=bitMatrixRow, duration=duration, cqlQuery=cqlQuery, httpQuery=httpQuery, arguments=arguments, *args, **kwargs) yield """
"""