You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by James liu <li...@gmail.com> on 2007/11/05 14:17:04 UTC

how to use PHP AND PHPS?

i find they all return string....

<?php
  $url = '
http://localhost:8080/solr/select/?q=solr&version=2.2&start=0&rows=10&indent=on&wt=php
';
  var_dump(file_get_contents($url);
?>


-- 
regards
jl

Re: how to use PHP AND PHPS?

Posted by Dave Lewis <da...@tikva.com>.
On Nov 5, 2007, at 8:56 AM, Robert Young wrote:

> I would imagine you have to unserialize
>
> On 11/5/07, James liu <li...@gmail.com> wrote:
>> i find they all return string....
>>
>> <?php
>>   $url = '
>> http://localhost:8080/solr/select/? 
>> q=solr&version=2.2&start=0&rows=10&indent=on&wt=php
>> ';
>>   var_dump(file_get_contents($url);
>> ?>
>>
>>
>> --
>> regards
>> jl
>>

Robert is correct.  We do:

		$serializedSolrResults = SearchHelper::fetchResults($queryString);
		$solrResults = unserialize($serializedSolrResults);

Where fetchResults handles all the curl setup and just returns the  
results of the request.

$solrResults then has nice arrays for accessing the results, facets,  
etc.

It is a string you're getting back -- but it's just the serialized  
representation.

dave


Re: how to use PHP AND PHPS?

Posted by James liu <li...@gmail.com>.
i know it...but u try it,,u will find simlar question.

On 11/5/07, Robert Young <bu...@gmail.com> wrote:
>
> I would imagine you have to unserialize
>
> On 11/5/07, James liu <li...@gmail.com> wrote:
> > i find they all return string....
> >
> > <?php
> >   $url = '
> >
> http://localhost:8080/solr/select/?q=solr&version=2.2&start=0&rows=10&indent=on&wt=php
> > ';
> >   var_dump(file_get_contents($url);
> > ?>
> >
> >
> > --
> > regards
> > jl
> >
>



-- 
regards
jl

Re: how to use PHP AND PHPS?

Posted by Robert Young <bu...@gmail.com>.
I would imagine you have to unserialize

On 11/5/07, James liu <li...@gmail.com> wrote:
> i find they all return string....
>
> <?php
>   $url = '
> http://localhost:8080/solr/select/?q=solr&version=2.2&start=0&rows=10&indent=on&wt=php
> ';
>   var_dump(file_get_contents($url);
> ?>
>
>
> --
> regards
> jl
>