Mercurial > hg > zopeSolr
view test/test.py @ 0:834706423ac1
initial
author | dwinter |
---|---|
date | Tue, 26 Feb 2013 15:22:07 +0100 |
parents | |
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']