Re: Recommended api/lib to search Solr using PHP
ay of document object. Use 'foreach' to iterate it. 8. document object is essentially array of field. Say its variable name is $doc. You can access field by 3 ways: a> Use 'foreach' to iterate it. b> Use $doc['fieldname'] to get specific field, e.g. $doc['ID']. c> Use $doc->fieldname to get specfic field, e.g. $doc->ID. How to paginate in PHP === 1. Basically, just use $qurey->setStart(...)->setRows(...) in loop by setting appropriate start row offset and pagination row size for your pagination. 2. More advanced, you can try write reuse object codes as shown in official document and do pagination to save memory and prevent more GC in php engine. That's all for now. Rest will be your own homework. Scott Chu,scott@udngroup.com 2016/6/2 (週四) ----- Original Message ----- From: Shawn Heisey To: solr-user CC: Date: 2016/5/31 (週二) 02:57 Subject: Re: Recommended api/lib to search Solr using PHP On 5/30/2016 12:32 PM, GW wrote: > I would say look at the urls for searches you build in the query tool > > In my case > > http://172.16.0.1:8983/solr/#/products/query > > When you build queries with the Query tool, for example an edismax query, > the URL is there for you to copy. > Use the url structure with curl in your programming/scripting. The results > come back as REST data. > > This is what I do with PHP and it's pretty tight. Be careful with URLs in the admin UI. URLs with "#" in them will *only* work in a browser. They are not the REST endpoints. When you run a query in the admin UI, it will give you a URL to make the same query, but it will NOT be the URL in the address bar of the browser. There is a link right above the query results. Thanks, Shawn - 未在此訊息中找到病毒。 已透過 AVG 檢查 - www.avg.com 版本: 2015.0.6201 / 病毒庫: 4591/12328 - 發佈日期: 05/30/16
Re: Recommended api/lib to search Solr using PHP
For those who might have same need to use Solarium, this is the best tutorial I can find by googling, it's actually a chapter in the book "Apache Solr PHP Integration" https://www.packtpub.com/packtlib/book/Big-Data-and-Business-Intelligence/9781782164920/1/ch01lvl1sec13/Installing%20Solarium I follow it and install and use Solarium correctly. scott.chu,scott@udngroup.com 2016/5/31 (週二) - Original Message - From: Shawn Heisey To: solr-user CC: Date: 2016/5/31 (週二) 02:57 Subject: Re: Recommended api/lib to search Solr using PHP On 5/30/2016 12:32 PM, GW wrote: > I would say look at the urls for searches you build in the query tool > > In my case > > http://172.16.0.1:8983/solr/#/products/query > > When you build queries with the Query tool, for example an edismax query, > the URL is there for you to copy. > Use the url structure with curl in your programming/scripting. The results > come back as REST data. > > This is what I do with PHP and it's pretty tight. Be careful with URLs in the admin UI. URLs with "#" in them will *only* work in a browser. They are not the REST endpoints. When you run a query in the admin UI, it will give you a URL to make the same query, but it will NOT be the URL in the address bar of the browser. There is a link right above the query results. Thanks, Shawn - 未在此訊息中找到病毒。 已透過 AVG 檢查 - www.avg.com 版本: 2015.0.6201 / 病毒庫: 4591/12331 - 發佈日期: 05/30/16
Re: Recommended api/lib to search Solr using PHP
On 5/30/2016 12:32 PM, GW wrote: > I would say look at the urls for searches you build in the query tool > > In my case > > http://172.16.0.1:8983/solr/#/products/query > > When you build queries with the Query tool, for example an edismax query, > the URL is there for you to copy. > Use the url structure with curl in your programming/scripting. The results > come back as REST data. > > This is what I do with PHP and it's pretty tight. Be careful with URLs in the admin UI. URLs with "#" in them will *only* work in a browser. They are not the REST endpoints. When you run a query in the admin UI, it will give you a URL to make the same query, but it will NOT be the URL in the address bar of the browser. There is a link right above the query results. Thanks, Shawn
Re: Recommended api/lib to search Solr using PHP
I would say look at the urls for searches you build in the query tool In my case http://172.16.0.1:8983/solr/#/products/query When you build queries with the Query tool, for example an edismax query, the URL is there for you to copy. Use the url structure with curl in your programming/scripting. The results come back as REST data. This is what I do with PHP and it's pretty tight. On 30 May 2016 at 02:29, scott.chuwrote: > > We have two legacy in-house applications written in PHP 5.2.6 and 5.5.3. > Our engineers currently just use fopen with url to search Solr but it's > kinda unenough when we want to do more advanced, complex queries. We've > tried to use something called 'Solarium' but its installtion steps has > something to do with symphony, which is kinda complicated. We can't get the > installation done ok. I'd like to know if there are some other > better-structured PHP libraries or APIs? > > Note: Solr is 5.4.1. > > scott.chu,scott@udngroup.com > 2016/5/30 (週一) >
Re: Recommended api/lib to search Solr using PHP
we also use Solarium. the documentation is pretty spotty in some cases (tho they've recently updated it, or at least the formatting, which seems to be a move in the right direction), but overall pretty simple to use. some good plugins at hand to help extend the base power, too. i'd say give it a whirl -- *John Blythe* Product Manager & Lead Developer 251.605.3071 | j...@curvolabs.com www.curvolabs.com 58 Adams Ave Evansville, IN 47713 On Mon, May 30, 2016 at 4:27 AM, Georg Sorstwrote: > We've had good experiences with Solarium, so it's probably worth spending > some time in getting it to run. > > scott.chu schrieb am Mo., 30. Mai 2016 um > 09:30 Uhr: > > > > > We have two legacy in-house applications written in PHP 5.2.6 and 5.5.3. > > Our engineers currently just use fopen with url to search Solr but it's > > kinda unenough when we want to do more advanced, complex queries. We've > > tried to use something called 'Solarium' but its installtion steps has > > something to do with symphony, which is kinda complicated. We can't get > the > > installation done ok. I'd like to know if there are some other > > better-structured PHP libraries or APIs? > > > > Note: Solr is 5.4.1. > > > > scott.chu,scott@udngroup.com > > 2016/5/30 (週一) > > >
Re: Recommended api/lib to search Solr using PHP
On 5/30/2016 1:29 AM, scott.chu wrote: > We have two legacy in-house applications written in PHP 5.2.6 and 5.5.3. Our > engineers currently just use fopen with url to search Solr but it's kinda > unenough when we want to do more advanced, complex queries. We've tried to > use something called 'Solarium' but its installtion steps has something to do > with symphony, which is kinda complicated. We can't get the installation done > ok. I'd like to know if there are some other better-structured PHP libraries > or APIs? There are a *lot* of PHP clients out there. Note that none of them can be supported here, because they are all third-party software. https://wiki.apache.org/solr/IntegratingSolr#PHP Thanks, Shawn
Re: Recommended api/lib to search Solr using PHP
We've had good experiences with Solarium, so it's probably worth spending some time in getting it to run. scott.chuschrieb am Mo., 30. Mai 2016 um 09:30 Uhr: > > We have two legacy in-house applications written in PHP 5.2.6 and 5.5.3. > Our engineers currently just use fopen with url to search Solr but it's > kinda unenough when we want to do more advanced, complex queries. We've > tried to use something called 'Solarium' but its installtion steps has > something to do with symphony, which is kinda complicated. We can't get the > installation done ok. I'd like to know if there are some other > better-structured PHP libraries or APIs? > > Note: Solr is 5.4.1. > > scott.chu,scott@udngroup.com > 2016/5/30 (週一) >