Using the output of SOLR PHP
Reprint: Using SOLR PHP's output
Posted in: February 18, 2009?| Category: solr?| Tags:? php,?solr?|? Views (1,054)
Copyright information: Can be reproduced arbitrarily, please be sure to use hyperlinks in the form of the original source of the article, that is, the following statement.
?
Original source: http://blog.chenlb.com/2009/02/use-solr-php-writer.html
SOLR 1.3 Adds PHP's output type, which can be resolved faster when the PHP call to SOLR searches. PHP has two kinds: PHP structure (syntax, like JSON), and the other is, PHP serialization, can be used in the deserialization of PHP to parse. How to use the following example
SOLR ' s PHP Output:
- $code ?=? file_get_contents (' http://localhost:8983/solr/select?q=iPod&wt=php ');??
- eval ( "$result? =?" ?.? $code ?.?
- Print_r ($result);? ?
SOLR ' s PHP serialized Output:
- $serializedResult ?=? file_get_contents ( "http://localhost:8983/solr/ Select?q=ipod&wt=phps '
- $result ? =?unserialize ($serializedResult); ??
- Print_r ($result);? ?
Tip: To use these two outputs, open them on the server, edit Solrconfig.xml, and annotate (or add these):
- <queryresponsewriter? name = "PHP" ? class = "Org.apache.solr.request.PHPResponseWriter" /> ??
- <queryresponsewriter? name = "Phps" ? class = "Org.apache.solr.request.PHPSerializedResponseWriter" /> ??
Other:
The enthusiastic developer also wrote the PHP client: solrphpclient, Source: https://issues.apache.org/jira/browse/SOLR-341
?