Application of SOLR PHP output

Source: Internet
Author: User
Tags solr
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:

  1. $code ?=? file_get_contents (' http://localhost:8983/solr/select?q=iPod&wt=php ');??
  2. eval ( "$result? =?" ?.? $code ?.?
  3. Print_r ($result);? ?

SOLR ' s PHP serialized Output:

  1. $serializedResult ?=? file_get_contents ( "http://localhost:8983/solr/ Select?q=ipod&wt=phps '
  2. $result ? =?unserialize ($serializedResult); ??
  3. Print_r ($result);? ?

Tip: To use these two outputs, open them on the server, edit Solrconfig.xml, and annotate (or add these):

  1. <queryresponsewriter? name = "PHP" ? class = "Org.apache.solr.request.PHPResponseWriter" /> ??
  2. <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

?

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.