11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Examples<br />

Creating and Updating Common Properties<br />

This change sets the query.filterCache.autowarmCountto 1000 items and unsets the<br />

che.size.<br />

query.filterCa<br />

curl http://localhost:8983/solr/techproducts/config -H<br />

'Content-type:application/json' -d'{<br />

"set-property" : {"query.filterCache.autowarmCount":1000},<br />

"unset-property" :"query.filterCache.size"}'<br />

Using the /config/overlay endpoint, you can verify the changes with a request like this:<br />

curl http://localhost:8983/solr/gettingstarted/config/overlay?omitHeader=true<br />

And you should get a response like this:<br />

{<br />

"overlay":{<br />

"znodeVersion":1,<br />

"props":{"query":{"filterCache":{<br />

"autowarmCount":1000,<br />

"size":25}}}}}<br />

Creating and Updating Request Handlers<br />

To create a request handler, we can use the add-requesthandler<br />

command:<br />

curl http://localhost:8983/solr/techproducts/config -H<br />

'Content-type:application/json' -d '{<br />

"add-requesthandler" : {<br />

"name": "/mypath",<br />

"class":"solr.DumpRequestHandler",<br />

"defaults":{ "x":"y" ,"a":"b", "wt":"json", "indent":true },<br />

"useParams":"x"<br />

},<br />

}'<br />

Make a call to the new request handler to check if it is registered:<br />

curl http://localhost:8983/solr/techproducts/mypath?omitHeader=true<br />

And you should see the following as output:<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

487

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!