Re: how to use PHP AND PHPS?
Thks everybody who give me help. especial Dave, thk u. On Nov 8, 2007 11:21 AM, James liu <[EMAIL PROTECTED]> wrote: > hmm > > i find error,,,that is my error not about php and phps .. > > i use old config to testso config have a problem.. > > that is Title i use double as its type...it should use text. > > > > On Nov 8, 2007 10:29 AM, James liu <[EMAIL PROTECTED]> wrote: > > > php now is ok.. > > > > but phps failed > > > > mycode: > > > > > > > $url = > > > 'http://localhost:8080/solr1/select/?q=2&version=2.2&rows=2&fl=Title&start=0&rows=10&indent=on&wt=phps > > > '; > > > $a = file_get_contents($url); > > > //eval('$solrResults = ' .$serializedSolrResults . ';'); > > > echo 'before unserialize'; > > > var_dump($a); > > > echo ''; > > > $a = unserialize($a); > > > echo 'after unserialize...'; > > > var_dump($a); > > > ?> > > > > > > > and result: > > > > > *before unserialize * > > > string(434) > > > "a:2:{s:14:"responseHeader";a:3:{s:6:"status";i:0;s:5:"QTime";i:32;s:6:"params";a:7:{s:2:"fl";s:5:"Title";s:6:"indent";s:2:"on";s:5:"start";s:1:"0";s:1:"q";s:1:"2";s:2:"wt";s:4:"phps";s:4:"rows";a:2:{i:0;s:1:"2";i:1;s:2:"10";}s:7:"version";s:3:" > > > 2.2";}}s:8:"response";a:3:{s:8:"numFound";i:28;s:5:"start";i:0;s:4:"docs";a:2:{i:0;a:1:{s:5:"Title";d:诺基亚N-Gage基本数据;}i:1;a:1:{s:5:"Title";d:索尼爱立信P908基本数据;" > > > > > > *after unserialize...* > > > bool(false) > > > > > > > > > On Nov 7, 2007 9:30 PM, Dave Lewis < [EMAIL PROTECTED]> wrote: > > > > > > > > On Nov 7, 2007, at 2:04 AM, James liu wrote: > > > > > > > i just decrease answer information...and u will see my result(full, > > > > not > > > > part) > > > > > > > > *before unserialize* > > > >> string(433) > > > >> "a:2:{s:14:"responseHeader";a:3:{s:6:"status";i:0;s:5:"QTime";i: > > > >> 0;s:6:"params";a:7:{s:2:"fl";s:5:"Title";s:6:"indent";s:2:"on";s: > > > >> 5:"start";s:1:"0";s:1:"q";s:1:"2";s:2:"wt";s:4:"phps";s:4:"rows";a: > > > >> 2:{i:0;s:1:"2";i:1;s:2:"10";}s:7:"version";s:3:" > > > >> 2.2";}}s:8:"response";a:3:{s:8:"numFound";i:28;s:5:"start";i:0;s: > > > >> 4:"docs";a:2:{i:0;a:1:{s:5:"Title";d:诺基亚N-Gage基本数据;}i:1;a:1: > > > >> {s:5:"Title";d:索尼爱立信P908基本数据;" > > > >> > > > >> *after unserialize...* > > > >> bool(false) > > > >> > > > > > > > > and i write serialize test code.. > > > > > > > > > > >> $ar = array ( > > > >> array('id' => 123, 'Title'=> "中文测试"), > > > >> array('id' => 123, 'Title'=> "中国上海"), > > > >> ); > > > >> > > > >> echo serialize($ar); > > > >> > > > >> ?> > > > >> > > > > > > > > > > > > and result is : > > > > > > > >> > > > >> a:2:{i:0;a:2:{s:2:"id";i:123;s:5:"Title";s:12:"中文测试";}i:1;a:2: > > > >> {s:2:"id";i:123;s:5:"Title";s:12:"中国上海";}} > > > >> > > > > > > > > > > > > > > > > *php* result is: > > > > > > > > string(369) "array( 'responseHeader'=>array( 'status'=>0, > > > 'QTime'=>0, > > > > 'params'=>array( 'fl'=>'Title', 'indent'=>'on', 'start'=>'0', > > > > 'q'=>'2', > > > > 'wt'=>'php', 'rows'=>array('2', '10'), 'version'=>'2.2')), > > > > 'response'=>array('numFound'=>28,'start'=>0,'docs'=>array( array( > > > > 'Title'=>诺基亚N-Gage基本数据), array( 'Title'=>索尼爱立信P908基本数 > > > > 据)) ))" > > > > > > > > it is string, so i can't read it correctly by php. > > > > > > > > > > > > > > > > > This part (after string(369)) is exactly what it you should be seeing > > > if you use the php handler, and it's what you get after you > > > unserialize when using phps. > > > > > > You can access your search results as: > > > > > > $solrResults['response']['docs']; > > > > > > In your example above, that would be: > > > > > > array( array('Title'=>诺基亚N-Gage基本数据), array( 'Title'=>索尼爱立信 > > > P908基本数据)) > > > > > > When using the php handler, you must do something like this: > > > > > > eval('$solrResults = ' .$serializedSolrResults . ';'); > > > > > > Then, as above, you can access $solrResults['response']['docs']. > > > > > > To sum up, if you use phps, you must unserialize the results. If you > > > use php, you must eval the results (including some sugar to get a > > > variable set to that value). > > > > > > > > > dave > > > > > > > > > > > > > > > -- > > regards > > jl > > > > > -- > regards > jl -- regards jl
Re: how to use PHP AND PHPS?
hmm i find error,,,that is my error not about php and phps .. i use old config to testso config have a problem.. that is Title i use double as its type...it should use text. On Nov 8, 2007 10:29 AM, James liu <[EMAIL PROTECTED]> wrote: > php now is ok.. > > but phps failed > > mycode: > > > > $url = > > 'http://localhost:8080/solr1/select/?q=2&version=2.2&rows=2&fl=Title&start=0&rows=10&indent=on&wt=phps > > '; > > $a = file_get_contents($url); > > //eval('$solrResults = ' .$serializedSolrResults . ';'); > > echo 'before unserialize'; > > var_dump($a); > > echo ''; > > $a = unserialize($a); > > echo 'after unserialize...'; > > var_dump($a); > > ?> > > > > and result: > > > *before unserialize* > > string(434) > > "a:2:{s:14:"responseHeader";a:3:{s:6:"status";i:0;s:5:"QTime";i:32;s:6:"params";a:7:{s:2:"fl";s:5:"Title";s:6:"indent";s:2:"on";s:5:"start";s:1:"0";s:1:"q";s:1:"2";s:2:"wt";s:4:"phps";s:4:"rows";a:2:{i:0;s:1:"2";i:1;s:2:"10";}s:7:"version";s:3:" > > 2.2";}}s:8:"response";a:3:{s:8:"numFound";i:28;s:5:"start";i:0;s:4:"docs";a:2:{i:0;a:1:{s:5:"Title";d:诺基亚N-Gage基本数据;}i:1;a:1:{s:5:"Title";d:索尼爱立信P908基本数据;" > > > > *after unserialize...* > > bool(false) > > > > > On Nov 7, 2007 9:30 PM, Dave Lewis <[EMAIL PROTECTED]> wrote: > > > > > On Nov 7, 2007, at 2:04 AM, James liu wrote: > > > > > i just decrease answer information...and u will see my result(full, > > > not > > > part) > > > > > > *before unserialize* > > >> string(433) > > >> "a:2:{s:14:"responseHeader";a:3:{s:6:"status";i:0;s:5:"QTime";i: > > >> 0;s:6:"params";a:7:{s:2:"fl";s:5:"Title";s:6:"indent";s:2:"on";s: > > >> 5:"start";s:1:"0";s:1:"q";s:1:"2";s:2:"wt";s:4:"phps";s:4:"rows";a: > > >> 2:{i:0;s:1:"2";i:1;s:2:"10";}s:7:"version";s:3:" > > >> 2.2";}}s:8:"response";a:3:{s:8:"numFound";i:28;s:5:"start";i:0;s: > > >> 4:"docs";a:2:{i:0;a:1:{s:5:"Title";d:诺基亚N-Gage基本数据;}i:1;a:1: > > >> {s:5:"Title";d:索尼爱立信P908基本数据;" > > >> > > >> *after unserialize...* > > >> bool(false) > > >> > > > > > > and i write serialize test code.. > > > > > > > >> $ar = array ( > > >> array('id' => 123, 'Title'=> "中文测试"), > > >> array('id' => 123, 'Title'=> "中国上海"), > > >> ); > > >> > > >> echo serialize($ar); > > >> > > >> ?> > > >> > > > > > > > > > and result is : > > > > > >> > > >> a:2:{i:0;a:2:{s:2:"id";i:123;s:5:"Title";s:12:"中文测试";}i:1;a:2: > > >> {s:2:"id";i:123;s:5:"Title";s:12:"中国上海";}} > > >> > > > > > > > > > > > > *php* result is: > > > > > > string(369) "array( 'responseHeader'=>array( 'status'=>0, 'QTime'=>0, > > > 'params'=>array( 'fl'=>'Title', 'indent'=>'on', 'start'=>'0', > > > 'q'=>'2', > > > 'wt'=>'php', 'rows'=>array('2', '10'), 'version'=>'2.2')), > > > 'response'=>array('numFound'=>28,'start'=>0,'docs'=>array( array( > > > 'Title'=>诺基亚N-Gage基本数据), array( 'Title'=>索尼爱立信P908基本数 > > > 据)) ))" > > > > > > it is string, so i can't read it correctly by php. > > > > > > > > > > > > This part (after string(369)) is exactly what it you should be seeing > > if you use the php handler, and it's what you get after you > > unserialize when using phps. > > > > You can access your search results as: > > > > $solrResults['response']['docs']; > > > > In your example above, that would be: > > > > array( array('Title'=>诺基亚N-Gage基本数据), array( 'Title'=>索尼爱立信 > > P908基本数据)) > > > > When using the php handler, you must do something like this: > > > > eval('$solrResults = ' .$serializedSolrResults . ';'); > > > > Then, as above, you can access $solrResults['response']['docs']. > > > > To sum up, if you use phps, you must unserialize the results. If you > > use php, you must eval the results (including some sugar to get a > > variable set to that value). > > > > > > dave > > > > > > > > > -- > regards > jl -- regards jl
Re: how to use PHP AND PHPS?
php now is ok.. but phps failed mycode: > $url = ' > http://localhost:8080/solr1/select/?q=2&version=2.2&rows=2&fl=Title&start=0&rows=10&indent=on&wt=phps > '; > $a = file_get_contents($url); > //eval('$solrResults = ' .$serializedSolrResults . ';'); > echo 'before unserialize'; > var_dump($a); > echo ''; > $a = unserialize($a); > echo 'after unserialize...'; > var_dump($a); > ?> > and result: > *before unserialize* > string(434) > "a:2:{s:14:"responseHeader";a:3:{s:6:"status";i:0;s:5:"QTime";i:32;s:6:"params";a:7:{s:2:"fl";s:5:"Title";s:6:"indent";s:2:"on";s:5:"start";s:1:"0";s:1:"q";s:1:"2";s:2:"wt";s:4:"phps";s:4:"rows";a:2:{i:0;s:1:"2";i:1;s:2:"10";}s:7:"version";s:3:" > 2.2";}}s:8:"response";a:3:{s:8:"numFound";i:28;s:5:"start";i:0;s:4:"docs";a:2:{i:0;a:1:{s:5:"Title";d:诺基亚N-Gage基本数据;}i:1;a:1:{s:5:"Title";d:索尼爱立信P908基本数据;" > > *after unserialize...* > bool(false) > On Nov 7, 2007 9:30 PM, Dave Lewis <[EMAIL PROTECTED]> wrote: > > On Nov 7, 2007, at 2:04 AM, James liu wrote: > > > i just decrease answer information...and u will see my result(full, > > not > > part) > > > > *before unserialize* > >> string(433) > >> "a:2:{s:14:"responseHeader";a:3:{s:6:"status";i:0;s:5:"QTime";i: > >> 0;s:6:"params";a:7:{s:2:"fl";s:5:"Title";s:6:"indent";s:2:"on";s: > >> 5:"start";s:1:"0";s:1:"q";s:1:"2";s:2:"wt";s:4:"phps";s:4:"rows";a: > >> 2:{i:0;s:1:"2";i:1;s:2:"10";}s:7:"version";s:3:" > >> 2.2";}}s:8:"response";a:3:{s:8:"numFound";i:28;s:5:"start";i:0;s: > >> 4:"docs";a:2:{i:0;a:1:{s:5:"Title";d:诺基亚N-Gage基本数据;}i:1;a:1: > >> {s:5:"Title";d:索尼爱立信P908基本数据;" > >> > >> *after unserialize...* > >> bool(false) > >> > > > > and i write serialize test code.. > > > > >> $ar = array ( > >> array('id' => 123, 'Title'=> "中文测试"), > >> array('id' => 123, 'Title'=> "中国上海"), > >> ); > >> > >> echo serialize($ar); > >> > >> ?> > >> > > > > > > and result is : > > > >> > >> a:2:{i:0;a:2:{s:2:"id";i:123;s:5:"Title";s:12:"中文测试";}i:1;a:2: > >> {s:2:"id";i:123;s:5:"Title";s:12:"中国上海";}} > >> > > > > > > > > *php* result is: > > > > string(369) "array( 'responseHeader'=>array( 'status'=>0, 'QTime'=>0, > > 'params'=>array( 'fl'=>'Title', 'indent'=>'on', 'start'=>'0', > > 'q'=>'2', > > 'wt'=>'php', 'rows'=>array('2', '10'), 'version'=>'2.2')), > > 'response'=>array('numFound'=>28,'start'=>0,'docs'=>array( array( > > 'Title'=>诺基亚N-Gage基本数据), array( 'Title'=>索尼爱立信P908基本数 > > 据)) ))" > > > > it is string, so i can't read it correctly by php. > > > > > > > This part (after string(369)) is exactly what it you should be seeing > if you use the php handler, and it's what you get after you > unserialize when using phps. > > You can access your search results as: > > $solrResults['response']['docs']; > > In your example above, that would be: > > array( array('Title'=>诺基亚N-Gage基本数据), array( 'Title'=>索尼爱立信 > P908基本数据)) > > When using the php handler, you must do something like this: > > eval('$solrResults = ' .$serializedSolrResults . ';'); > > Then, as above, you can access $solrResults['response']['docs']. > > To sum up, if you use phps, you must unserialize the results. If you > use php, you must eval the results (including some sugar to get a > variable set to that value). > > > dave > > > -- regards jl
Re: how to use PHP AND PHPS?
On Nov 7, 2007, at 2:04 AM, James liu wrote: i just decrease answer information...and u will see my result(full, not part) *before unserialize* string(433) "a:2:{s:14:"responseHeader";a:3:{s:6:"status";i:0;s:5:"QTime";i: 0;s:6:"params";a:7:{s:2:"fl";s:5:"Title";s:6:"indent";s:2:"on";s: 5:"start";s:1:"0";s:1:"q";s:1:"2";s:2:"wt";s:4:"phps";s:4:"rows";a: 2:{i:0;s:1:"2";i:1;s:2:"10";}s:7:"version";s:3:" 2.2";}}s:8:"response";a:3:{s:8:"numFound";i:28;s:5:"start";i:0;s: 4:"docs";a:2:{i:0;a:1:{s:5:"Title";d:诺基亚N-Gage基本数据;}i:1;a:1: {s:5:"Title";d:索尼爱立信P908基本数据;" *after unserialize...* bool(false) and i write serialize test code.. $ar = array ( array('id' => 123, 'Title'=> "中文测试"), array('id' => 123, 'Title'=> "中国上海"), ); echo serialize($ar); ?> and result is : a:2:{i:0;a:2:{s:2:"id";i:123;s:5:"Title";s:12:"中文测试";}i:1;a:2: {s:2:"id";i:123;s:5:"Title";s:12:"中国上海";}} *php* result is: string(369) "array( 'responseHeader'=>array( 'status'=>0, 'QTime'=>0, 'params'=>array( 'fl'=>'Title', 'indent'=>'on', 'start'=>'0', 'q'=>'2', 'wt'=>'php', 'rows'=>array('2', '10'), 'version'=>'2.2')), 'response'=>array('numFound'=>28,'start'=>0,'docs'=>array( array( 'Title'=>诺基亚N-Gage基本数据), array( 'Title'=>索尼爱立信P908基本数 据)) ))" it is string, so i can't read it correctly by php. This part (after string(369)) is exactly what it you should be seeing if you use the php handler, and it's what you get after you unserialize when using phps. You can access your search results as: $solrResults['response']['docs']; In your example above, that would be: array( array('Title'=>诺基亚N-Gage基本数据), array( 'Title'=>索尼爱立信 P908基本数据)) When using the php handler, you must do something like this: eval('$solrResults = ' .$serializedSolrResults . ';'); Then, as above, you can access $solrResults['response']['docs']. To sum up, if you use phps, you must unserialize the results. If you use php, you must eval the results (including some sugar to get a variable set to that value). dave
Re: how to use PHP AND PHPS?
i just decrease answer information...and u will see my result(full, not part) *before unserialize* > string(433) > "a:2:{s:14:"responseHeader";a:3:{s:6:"status";i:0;s:5:"QTime";i:0;s:6:"params";a:7:{s:2:"fl";s:5:"Title";s:6:"indent";s:2:"on";s:5:"start";s:1:"0";s:1:"q";s:1:"2";s:2:"wt";s:4:"phps";s:4:"rows";a:2:{i:0;s:1:"2";i:1;s:2:"10";}s:7:"version";s:3:" > 2.2";}}s:8:"response";a:3:{s:8:"numFound";i:28;s:5:"start";i:0;s:4:"docs";a:2:{i:0;a:1:{s:5:"Title";d:诺基亚N-Gage基本数据;}i:1;a:1:{s:5:"Title";d:索尼爱立信P908基本数据;" > > *after unserialize...* > bool(false) > and i write serialize test code.. $ar = array ( > array('id' => 123, 'Title'=> "中文测试"), > array('id' => 123, 'Title'=> "中国上海"), > ); > > echo serialize($ar); > > ?> > and result is : > > a:2:{i:0;a:2:{s:2:"id";i:123;s:5:"Title";s:12:"中文测试";}i:1;a:2:{s:2:"id";i:123;s:5:"Title";s:12:"中国上海";}} > *php* result is: string(369) "array( 'responseHeader'=>array( 'status'=>0, 'QTime'=>0, 'params'=>array( 'fl'=>'Title', 'indent'=>'on', 'start'=>'0', 'q'=>'2', 'wt'=>'php', 'rows'=>array('2', '10'), 'version'=>'2.2')), 'response'=>array('numFound'=>28,'start'=>0,'docs'=>array( array( 'Title'=>诺基亚N-Gage基本数据), array( 'Title'=>索尼爱立信P908基本数据)) ))" it is string, so i can't read it correctly by php. -- regards jl
Re: how to use PHP AND PHPS?
same answer. On Nov 7, 2007 11:41 AM, James liu <[EMAIL PROTECTED]> wrote: > afternoon,,i will update svn...and try the newest... > > > > > On Nov 7, 2007 11:23 AM, Dave Lewis <[EMAIL PROTECTED]> wrote: > > > > > On Nov 6, 2007, at 8:10 PM, James liu wrote: > > > > > first var_dump result(part not all): > > > > > > string(50506) > > >> "a:2:{s:14:"responseHeader";a:3:{s:6:"status";i:0;s:5:"QTime";i: > > >> 2906;s:6:"params";a:6:{s:6:"indent";s:2:"on";s:5:"start";s:1:"0";s: > > >> 1:"q";s:1:"2";s:2:"wt";s:4:"phps";s:4:"rows";s:2:"10";s: > > >> 7:"version";s:3:" > > >> 2.2";}} > > >> > > > > > > > This is exactly correct. > > > > > two var_dump result: > > > bool(false) > > > > > > > So, unserializing is failing. Are you running from the trunk or from > > a nightly? There was a bug a couple of weeks ago that sent back > > faulty serialized data. It's fixed now. It's possible this is your > > issue. > > > > dave > > > > > > > > > > On Nov 6, 2007 10:36 PM, Dave Lewis <[EMAIL PROTECTED]> wrote: > > >> What are the results of the two var_dumps? > > >> > > >> dave > > >> > > >> > > >> On Nov 5, 2007, at 10:06 PM, James liu wrote: > > >> > > >>> first: i m sure i enable php and phps in my solrconfig.xml > > >>> two: i can't get answer. > > >>> > > >>> *phps: > > >>> * > >>> $url = ' > > >>> http://localhost:8080/solr1/select/? > > >>> q=2&version= 2.2&start=0&rows=10&indent=on&wt=phps > > >>> '; > > >>> $a = file_get_contents($url); > > >>> echo 'before unserialize'; > > >>> var_dump($a); > > >>> $a = unserialize($a); > > >>> echo 'after unserialize...'; > > >>> var_dump($a); > > >>> ?>* > > >>> > > >>> * > > >>> > > >>> > > >>> On 11/6/07, Stu Hood <[EMAIL PROTECTED]> wrote: > > >>>> > > >>>> Did you enable the PHP serialized response writer in your > > >>>> solrconfig.xml? > > >>>> It is not enabled by default. > > >>>> > > >>>> Thanks, > > >>>> Stu > > >>>> > > >>>> > > >>>> -Original Message- > > >>>> From: James liu <[EMAIL PROTECTED]> > > >>>> Sent: Monday, November 5, 2007 9:03am > > >>>> To: solr-user@lucene.apache.org > > >>>> Subject: Re: how to use PHP AND PHPS? > > >>>> > > >>>> i know it...but u try it,,u will find simlar question. > > >>>> > > >>>> On 11/5/07, Robert Young < [EMAIL PROTECTED]> wrote: > > >>>>> > > >>>>> I would imagine you have to unserialize > > >>>>> > > >>>>> On 11/5/07, James liu < [EMAIL PROTECTED]> wrote: > > >>>>>> i find they all return string > > >>>>>> > > >>>>>> > >>>>>> $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 > > >>>> > > >>>> > > >>>> > > >>> > > >>> > > >>> -- > > >>> regards > > >>> jl > > >> > > >> > > > > > > > > > > > > -- > > > regards > > > jl > > > > > > > -- > regards > jl -- regards jl
Re: how to use PHP AND PHPS?
afternoon,,i will update svn...and try the newest... On Nov 7, 2007 11:23 AM, Dave Lewis <[EMAIL PROTECTED]> wrote: > > On Nov 6, 2007, at 8:10 PM, James liu wrote: > > > first var_dump result(part not all): > > > > string(50506) > >> "a:2:{s:14:"responseHeader";a:3:{s:6:"status";i:0;s:5:"QTime";i: > >> 2906;s:6:"params";a:6:{s:6:"indent";s:2:"on";s:5:"start";s:1:"0";s: > >> 1:"q";s:1:"2";s:2:"wt";s:4:"phps";s:4:"rows";s:2:"10";s: > >> 7:"version";s:3:" > >> 2.2";}} > >> > > > > This is exactly correct. > > > two var_dump result: > > bool(false) > > > > So, unserializing is failing. Are you running from the trunk or from > a nightly? There was a bug a couple of weeks ago that sent back > faulty serialized data. It's fixed now. It's possible this is your > issue. > > dave > > > > > > On Nov 6, 2007 10:36 PM, Dave Lewis <[EMAIL PROTECTED]> wrote: > >> What are the results of the two var_dumps? > >> > >> dave > >> > >> > >> On Nov 5, 2007, at 10:06 PM, James liu wrote: > >> > >>> first: i m sure i enable php and phps in my solrconfig.xml > >>> two: i can't get answer. > >>> > >>> *phps: > >>> * >>> $url = ' > >>> http://localhost:8080/solr1/select/? > >>> q=2&version=2.2&start=0&rows=10&indent=on&wt=phps > >>> '; > >>> $a = file_get_contents($url); > >>> echo 'before unserialize....'; > >>> var_dump($a); > >>> $a = unserialize($a); > >>> echo 'after unserialize...'; > >>> var_dump($a); > >>> ?>* > >>> > >>> * > >>> > >>> > >>> On 11/6/07, Stu Hood <[EMAIL PROTECTED]> wrote: > >>>> > >>>> Did you enable the PHP serialized response writer in your > >>>> solrconfig.xml? > >>>> It is not enabled by default. > >>>> > >>>> Thanks, > >>>> Stu > >>>> > >>>> > >>>> -Original Message- > >>>> From: James liu <[EMAIL PROTECTED]> > >>>> Sent: Monday, November 5, 2007 9:03am > >>>> To: solr-user@lucene.apache.org > >>>> Subject: Re: how to use PHP AND PHPS? > >>>> > >>>> i know it...but u try it,,u will find simlar question. > >>>> > >>>> On 11/5/07, Robert Young <[EMAIL PROTECTED]> wrote: > >>>>> > >>>>> I would imagine you have to unserialize > >>>>> > >>>>> On 11/5/07, James liu <[EMAIL PROTECTED]> wrote: > >>>>>> i find they all return string > >>>>>> > >>>>>> >>>>>> $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 > >>>> > >>>> > >>>> > >>> > >>> > >>> -- > >>> regards > >>> jl > >> > >> > > > > > > > > -- > > regards > > jl > > -- regards jl
Re: how to use PHP AND PHPS?
On Nov 6, 2007, at 8:10 PM, James liu wrote: first var_dump result(part not all): string(50506) "a:2:{s:14:"responseHeader";a:3:{s:6:"status";i:0;s:5:"QTime";i: 2906;s:6:"params";a:6:{s:6:"indent";s:2:"on";s:5:"start";s:1:"0";s: 1:"q";s:1:"2";s:2:"wt";s:4:"phps";s:4:"rows";s:2:"10";s: 7:"version";s:3:" 2.2";}} This is exactly correct. two var_dump result: bool(false) So, unserializing is failing. Are you running from the trunk or from a nightly? There was a bug a couple of weeks ago that sent back faulty serialized data. It's fixed now. It's possible this is your issue. dave On Nov 6, 2007 10:36 PM, Dave Lewis <[EMAIL PROTECTED]> wrote: What are the results of the two var_dumps? dave On Nov 5, 2007, at 10:06 PM, James liu wrote: first: i m sure i enable php and phps in my solrconfig.xml two: i can't get answer. *phps: *http://localhost:8080/solr1/select/? q=2&version=2.2&start=0&rows=10&indent=on&wt=phps '; $a = file_get_contents($url); echo 'before unserialize'; var_dump($a); $a = unserialize($a); echo 'after unserialize...'; var_dump($a); ?>* * On 11/6/07, Stu Hood <[EMAIL PROTECTED]> wrote: Did you enable the PHP serialized response writer in your solrconfig.xml? It is not enabled by default. Thanks, Stu -Original Message- From: James liu <[EMAIL PROTECTED]> Sent: Monday, November 5, 2007 9:03am To: solr-user@lucene.apache.org Subject: Re: how to use PHP AND PHPS? i know it...but u try it,,u will find simlar question. On 11/5/07, Robert Young <[EMAIL PROTECTED]> wrote: I would imagine you have to unserialize On 11/5/07, James liu <[EMAIL PROTECTED]> wrote: i find they all return string 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 -- regards jl -- regards jl
Re: how to use PHP AND PHPS?
first var_dump result(part not all): string(50506) > "a:2:{s:14:"responseHeader";a:3:{s:6:"status";i:0;s:5:"QTime";i:2906;s:6:"params";a:6:{s:6:"indent";s:2:"on";s:5:"start";s:1:"0";s:1:"q";s:1:"2";s:2:"wt";s:4:"phps";s:4:"rows";s:2:"10";s:7:"version";s:3:" > 2.2";}} > two var_dump result: bool(false) On Nov 6, 2007 10:36 PM, Dave Lewis <[EMAIL PROTECTED]> wrote: > What are the results of the two var_dumps? > > dave > > > On Nov 5, 2007, at 10:06 PM, James liu wrote: > > > first: i m sure i enable php and phps in my solrconfig.xml > > two: i can't get answer. > > > > *phps: > > * > $url = ' > > http://localhost:8080/solr1/select/? > > q=2&version=2.2&start=0&rows=10&indent=on&wt=phps > > '; > > $a = file_get_contents($url); > > echo 'before unserialize'; > > var_dump($a); > > $a = unserialize($a); > > echo 'after unserialize...'; > > var_dump($a); > > ?>* > > > > * > > > > > > On 11/6/07, Stu Hood <[EMAIL PROTECTED]> wrote: > >> > >> Did you enable the PHP serialized response writer in your > >> solrconfig.xml? > >> It is not enabled by default. > >> > >> Thanks, > >> Stu > >> > >> > >> -Original Message- > >> From: James liu <[EMAIL PROTECTED]> > >> Sent: Monday, November 5, 2007 9:03am > >> To: solr-user@lucene.apache.org > >> Subject: Re: how to use PHP AND PHPS? > >> > >> i know it...but u try it,,u will find simlar question. > >> > >> On 11/5/07, Robert Young <[EMAIL PROTECTED]> wrote: > >>> > >>> I would imagine you have to unserialize > >>> > >>> On 11/5/07, James liu <[EMAIL PROTECTED]> wrote: > >>>> i find they all return string > >>>> > >>>> >>>> $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 > >> > >> > >> > > > > > > -- > > regards > > jl > > -- regards jl
Re: how to use PHP AND PHPS?
What are the results of the two var_dumps? dave On Nov 5, 2007, at 10:06 PM, James liu wrote: first: i m sure i enable php and phps in my solrconfig.xml two: i can't get answer. *phps: *http://localhost:8080/solr1/select/? q=2&version=2.2&start=0&rows=10&indent=on&wt=phps '; $a = file_get_contents($url); echo 'before unserialize'; var_dump($a); $a = unserialize($a); echo 'after unserialize...'; var_dump($a); ?>* * On 11/6/07, Stu Hood <[EMAIL PROTECTED]> wrote: Did you enable the PHP serialized response writer in your solrconfig.xml? It is not enabled by default. Thanks, Stu -Original Message- From: James liu <[EMAIL PROTECTED]> Sent: Monday, November 5, 2007 9:03am To: solr-user@lucene.apache.org Subject: Re: how to use PHP AND PHPS? i know it...but u try it,,u will find simlar question. On 11/5/07, Robert Young <[EMAIL PROTECTED]> wrote: I would imagine you have to unserialize On 11/5/07, James liu <[EMAIL PROTECTED]> wrote: i find they all return string 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 -- regards jl
Re: how to use PHP AND PHPS?
first: i m sure i enable php and phps in my solrconfig.xml two: i can't get answer. *phps: *http://localhost:8080/solr1/select/?q=2&version=2.2&start=0&rows=10&indent=on&wt=phps '; $a = file_get_contents($url); echo 'before unserialize'; var_dump($a); $a = unserialize($a); echo 'after unserialize...'; var_dump($a); ?>* * On 11/6/07, Stu Hood <[EMAIL PROTECTED]> wrote: > > Did you enable the PHP serialized response writer in your solrconfig.xml? > It is not enabled by default. > > Thanks, > Stu > > > -Original Message- > From: James liu <[EMAIL PROTECTED]> > Sent: Monday, November 5, 2007 9:03am > To: solr-user@lucene.apache.org > Subject: Re: how to use PHP AND PHPS? > > i know it...but u try it,,u will find simlar question. > > On 11/5/07, Robert Young <[EMAIL PROTECTED]> wrote: > > > > I would imagine you have to unserialize > > > > On 11/5/07, James liu <[EMAIL PROTECTED]> wrote: > > > i find they all return string > > > > > > > > $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 > > > -- regards jl
Re: how to use PHP AND PHPS?
Did you enable the PHP serialized response writer in your solrconfig.xml? It is not enabled by default. Thanks, Stu -Original Message- From: James liu <[EMAIL PROTECTED]> Sent: Monday, November 5, 2007 9:03am To: solr-user@lucene.apache.org Subject: Re: how to use PHP AND PHPS? i know it...but u try it,,u will find simlar question. On 11/5/07, Robert Young <[EMAIL PROTECTED]> wrote: > > I would imagine you have to unserialize > > On 11/5/07, James liu <[EMAIL PROTECTED]> wrote: > > i find they all return string > > > > > $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?
i know it...but u try it,,u will find simlar question. On 11/5/07, Robert Young <[EMAIL PROTECTED]> wrote: > > I would imagine you have to unserialize > > On 11/5/07, James liu <[EMAIL PROTECTED]> wrote: > > i find they all return string > > > > > $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?
On Nov 5, 2007, at 8:56 AM, Robert Young wrote: I would imagine you have to unserialize On 11/5/07, James liu <[EMAIL PROTECTED]> wrote: i find they all return string 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?
I would imagine you have to unserialize On 11/5/07, James liu <[EMAIL PROTECTED]> wrote: > i find they all return string > >$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 >
how to use PHP AND PHPS?
i find they all return string 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