系統安裝:
{ "id": 1200, "category": "Systems", "title": "IBM servers and storage drive cloud and big data initiatives.", "description": "Want to extract the value of big data and analytics\? Looking to remake your enterprise IT infrastructure for the era of cloud\? IBM offers servers and storage solutions to meet your strategic imperatives. From mainframes to Flash, our breakthrough systems help transform your business.", "features": "PureFlex System: Combine the flexibility of a general purpose system, elasticity of cloud and simplicity of an appliance in integrated systems with built-in expertise." }
運行注意事項:
Python 程式設計:
# -*- coding: utf-8 -*- import sys import solr # create a connection to a solr server solrInst = solr.SolrConnection('http://localhost:8983/solr') # add a document to the index solrInst.add( id="1600", category="Perspectives", title="Experts debate: Does IT infrastructure determine business success\?", description="The world has changed. It's far different from two years ago, let alone 10. Businesses must act faster than competitors, respond
quicker to customer needs, create and market products and services more nimbly, and be always-on to stay relevant in an always-on
global economy. In the most recent debate, experts discussed which aspects of IT infrastructure matter most, to which industries,
and in what scenarios infrastructure plays a key role." ) solrInst.commit() # do a search response = solrInst.query('title:infrastructure', facet='true', facet_field=['category', 'title']) for hit in response.results: print "%s\t%s" % (hit['category'], hit['title'])
常用指定:
清除所有資料:
http://localhost:8983/solr/update?stream.body=<delete><query>*:*</query></delete>
http://localhost:8983/solr/update?stream.body=<commit/>