Mercurial > hg > zopeSolr
view test/test.py @ 5:f695be8f4f34
Incomplete - # 77: Sources: Cloud
https://it-dev.mpiwg-berlin.mpg.de/tracs/webpage/ticket/77
added facetFields_limit to search parameters
author | dwinter |
---|---|
date | Tue, 28 May 2013 11:13:40 +0200 |
parents | 834706423ac1 |
children |
line wrap: on
line source
''' Created on 11.02.2013 @author: dwinter ''' import sunburnt import httplib class TestSolr: solr = None def __init__(self): self.solr=sunburnt.SolrInterface(url="http://127.0.0.1:8983/solr/mpiwgweb") if __name__ == '__main__': sl = TestSolr() #params={facet=true&facet.field=description&facet.field=main_content&start=0&q=main_content:knowledge+AND+renn+AND+description:*+AND+main_content:*&rows=10} hits=113 status=0 QTime=66 x= {"qt":"tvrh","tv":"on","fl":"main_content","tv.tf":True} fq = sl.solr.query(urlNorm="http://127.0.0.1:18080/www_neu/en/news/features/feature25",**x).facet_by("main_content") x = fq.execute() #http://localhost:8983/solr/mpiwgweb/select?q=*%3A*&wt=xml&tv=on&qt=tvrh&fl=main_content&tv.tf=true #http://localhost:8983/solr/mpiwgweb/select?q=*%3A*&wt=json&tv=on&qt=tvrh&fl=main_content&tv.tf=true print x.facet_counts.facet_fields['main_content']