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 Israel Ekpo <is...@gmail.com> on 2010/10/11 07:03:07 UTC

Solr PHP PECL Extension going to Stable Release - Wishing for Any New Features?

Hi All,

I am currently working on a couple of bug fixes for the Solr PECL extension
that will be available in the next release 0.9.12 sometime this month.

http://pecl.php.net/package/solr

Documentation of the current API and features for the PECL extension is
available here

http://www.php.net/solr

A couple of users in the community were asking when the PHP extension will
be moving from beta to stable.

The API looks stable so far with no serious issues and I am looking to
moving it from *Beta* to *Stable *on November 20 2010

If you are using Solr via PHP and would like to see any new features in the
extension please feel free to send me a note.

I would like to incorporate those changes in 0.9.12 so that user can try
them out and send me some feedback before the release of version 1.0

Thanks in advance for your response.

-- 
°O°
"Good Enough" is not good enough.
To give anything less than your best is to sacrifice the gift.
Quality First. Measure Twice. Cut Once.
http://www.israelekpo.com/

Re: Solr PHP PECL Extension going to Stable Release - Wishing for Any New Features?

Posted by Israel Ekpo <is...@gmail.com>.
On Tue, Oct 12, 2010 at 12:44 PM, Ken Stanley <do...@gmail.com> wrote:

> >
> > > > If you are using Solr via PHP and would like to see any new features
> in
> > > the
> > > > extension please feel free to send me a note.
> >
>
> I'm new to this list, but in seeing this thread - and using PHP SOLR - I
> wanted to make a suggestion that - while minor - I think would greatly
> improve the quality of the extension.
>
> (I'm basing this mostly off of SolrQuery since that's where I've
> encountered
> the issue, but this might be true elsewhere)
>
> Whenever a method is supposed to return an array (i.e.,
> SolrQuery::getFields(), SolrQuery::getFacets(), etc), if there is no data
> to
> return, a null is returned. I think that this should be normalized across
> the board to return an empty array. First, the documentation is
> contradictory (http://us.php.net/manual/en/solrquery.getfields.php) in
> that
> the method signature says that it returns an array (not mixed), while the
> Return Values section says that it returns either an array or null.
> Secondly, returning an array under any circumstance provides more
> consistency and less logic; for example, let's say that I am looking for
> the
> fields (as-is in its current state):
>
> <?php
> // .. assume a proper set up
> if ($solrquery->getFields() !== null) {
>    foreach ($solrquery->getFields() as $field) {
>        // Do something
>    }
> }
> ?>
>
> This is a minor request, I know. But, I feel that it would go a long way
> toward polishing the extension up for general consumption.
>
> Thank you,
>
> Ken Stanley
>
> PS. I apologize if this request has come through the pipes already; as I've
> stated, I am new to this list; I have yet to find any reference to my
> request. :)
>


Great recommendation Ken.

Thanks for catching that! That should be a quick one.

-- 
°O°
"Good Enough" is not good enough.
To give anything less than your best is to sacrifice the gift.
Quality First. Measure Twice. Cut Once.
http://www.israelekpo.com/

Re: Solr PHP PECL Extension going to Stable Release - Wishing for Any New Features?

Posted by Ken Stanley <do...@gmail.com>.
>
> > > If you are using Solr via PHP and would like to see any new features in
> > the
> > > extension please feel free to send me a note.
>

I'm new to this list, but in seeing this thread - and using PHP SOLR - I
wanted to make a suggestion that - while minor - I think would greatly
improve the quality of the extension.

(I'm basing this mostly off of SolrQuery since that's where I've encountered
the issue, but this might be true elsewhere)

Whenever a method is supposed to return an array (i.e.,
SolrQuery::getFields(), SolrQuery::getFacets(), etc), if there is no data to
return, a null is returned. I think that this should be normalized across
the board to return an empty array. First, the documentation is
contradictory (http://us.php.net/manual/en/solrquery.getfields.php) in that
the method signature says that it returns an array (not mixed), while the
Return Values section says that it returns either an array or null.
Secondly, returning an array under any circumstance provides more
consistency and less logic; for example, let's say that I am looking for the
fields (as-is in its current state):

<?php
// .. assume a proper set up
if ($solrquery->getFields() !== null) {
    foreach ($solrquery->getFields() as $field) {
        // Do something
    }
}
?>

This is a minor request, I know. But, I feel that it would go a long way
toward polishing the extension up for general consumption.

Thank you,

Ken Stanley

PS. I apologize if this request has come through the pipes already; as I've
stated, I am new to this list; I have yet to find any reference to my
request. :)

Re: Solr PHP PECL Extension going to Stable Release - Wishing for Any New Features?

Posted by Israel Ekpo <is...@gmail.com>.
On Tue, Oct 12, 2010 at 7:42 AM, Peter Blokland <pe...@desk.nl> wrote:

> hi,
>
> On Mon, Oct 11, 2010 at 01:03:07AM -0400, Israel Ekpo wrote:
>
> > If you are using Solr via PHP and would like to see any new features in
> the
> > extension please feel free to send me a note.
>
> I'm currently testing a setup with Solr via PHP, and was wondering if
> support for the ExtractingRequestHandler is planned ? It may be that I
> missed something in the documentation, but for now it looks like I need
> to build my own POST's to the /solr/update/extract handler.
>
> --
> CUL8R, Peter.
>
> www.desk.nl --- Sent from my NetBSD-powered Talkie Toaster™
>

Peter,

That is an excellent idea.

I will add that to the wishlist.

-- 
°O°
"Good Enough" is not good enough.
To give anything less than your best is to sacrifice the gift.
Quality First. Measure Twice. Cut Once.
http://www.israelekpo.com/

Re: Solr PHP PECL Extension going to Stable Release - Wishing for Any New Features?

Posted by Peter Blokland <pe...@desk.nl>.
hi,

On Mon, Oct 11, 2010 at 01:03:07AM -0400, Israel Ekpo wrote:
 
> If you are using Solr via PHP and would like to see any new features in the
> extension please feel free to send me a note.

I'm currently testing a setup with Solr via PHP, and was wondering if
support for the ExtractingRequestHandler is planned ? It may be that I 
missed something in the documentation, but for now it looks like I need
to build my own POST's to the /solr/update/extract handler.

-- 
CUL8R, Peter.

www.desk.nl --- Sent from my NetBSD-powered Talkie Toaster™

Re: Solr PHP PECL Extension going to Stable Release - Wishing for Any New Features?

Posted by Israel Ekpo <is...@gmail.com>.
On Mon, Oct 11, 2010 at 3:33 AM, Lukas Kahwe Smith <ml...@pooteeweet.org>wrote:

>
> On 11.10.2010, at 07:03, Israel Ekpo wrote:
>
> > I am currently working on a couple of bug fixes for the Solr PECL
> extension
> > that will be available in the next release 0.9.12 sometime this month.
> >
> > http://pecl.php.net/package/solr
> >
> > Documentation of the current API and features for the PECL extension is
> > available here
> >
> > http://www.php.net/solr
> >
> > A couple of users in the community were asking when the PHP extension
> will
> > be moving from beta to stable.
> >
> > The API looks stable so far with no serious issues and I am looking to
> > moving it from *Beta* to *Stable *on November 20 2010
> >
> > If you are using Solr via PHP and would like to see any new features in
> the
> > extension please feel free to send me a note.
> >
> > I would like to incorporate those changes in 0.9.12 so that user can try
> > them out and send me some feedback before the release of version 1.0
> >
> > Thanks in advance for your response.
>
>
> we already had some emails about this.
> imho there are too many methods for specialized tasks, that its easy to get
> lost in the API, especially since not all of them have written documentation
> yet beyond the method signatures.
>
> also i do think that there should be methods for escaping and also
> tokenizing lucene queries to enable "validation" of the syntax used etc.
>
> see here for a use case and a user land implementation:
> http://pooteeweet.org/blog/1796
>
> regards,
> Lukas Kahwe Smith
> mls@pooteeweet.org
>
>
>
>
Thanks Lukas for your feed back.

Could you clarify the part about too many methods for specialized task? From
feedback that I have received so far, most users like the specialization and
and a small fraction do not. So it might be a matter of preference. I
decided to add the specialized methods in the SolrQuery class because at the
time, that was what most of the users wanted to see in the API. They cannot
be removed now.

As per the documentation, all of the methods are documented with at least a
brief heading or summary of what it is supposed to do.

http://php.net/solr

The user needs to understand first which query parameters they need to send
to Solr and then they can use one of the SolrQuery methods for that purpose.
Additional information is available from Solr Tutorials and the wiki
itself.  If one choses not to use a specialized method there is always the
get(), set() and add() methods that allows you to pass the parameter values
directly instead of using a specialized method for that parameter.

For escaping queries, we already have the following method

SolrUtils::escapeQueryChars
http://www.php.net/manual/en/solrutils.escapequerychars.php
http://www.php.net/manual/en/class.solrutils.php

As per the tokenization, it is not clear exactly what you were referring to.
I think it is best for the analysis of any of the tokens to be handled at
the server layer. There are tools in the admin interface for analyzing and
breaking down the query components into tokens.

I also took a look at your blog but I could not immediately the use case you
were referring to. A little more detail on this will be helpful.

Thanks Lukas for your input.

-- 
°O°
"Good Enough" is not good enough.
To give anything less than your best is to sacrifice the gift.
Quality First. Measure Twice. Cut Once.
http://www.israelekpo.com/

Re: Solr PHP PECL Extension going to Stable Release - Wishing for Any New Features?

Posted by Lukas Kahwe Smith <ml...@pooteeweet.org>.
On 11.10.2010, at 07:03, Israel Ekpo wrote:

> I am currently working on a couple of bug fixes for the Solr PECL extension
> that will be available in the next release 0.9.12 sometime this month.
> 
> http://pecl.php.net/package/solr
> 
> Documentation of the current API and features for the PECL extension is
> available here
> 
> http://www.php.net/solr
> 
> A couple of users in the community were asking when the PHP extension will
> be moving from beta to stable.
> 
> The API looks stable so far with no serious issues and I am looking to
> moving it from *Beta* to *Stable *on November 20 2010
> 
> If you are using Solr via PHP and would like to see any new features in the
> extension please feel free to send me a note.
> 
> I would like to incorporate those changes in 0.9.12 so that user can try
> them out and send me some feedback before the release of version 1.0
> 
> Thanks in advance for your response.


we already had some emails about this.
imho there are too many methods for specialized tasks, that its easy to get lost in the API, especially since not all of them have written documentation yet beyond the method signatures.

also i do think that there should be methods for escaping and also tokenizing lucene queries to enable "validation" of the syntax used etc.

see here for a use case and a user land implementation:
http://pooteeweet.org/blog/1796

regards,
Lukas Kahwe Smith
mls@pooteeweet.org




Re: Solr PHP PECL Extension going to Stable Release - Wishing for Any New Features?

Posted by Israel Ekpo <is...@gmail.com>.
Hi All,

Just wanted to post an update on where we stand with all the requests for
new features


List of Features Requested In SOLR PECL Extension

1. Ability to Send Custom Requests to Custom URLS other than select, update,
terms etc.
2. Ability to add files (pdf, office documents etc)
3. Windows version of latest releases.
4. Ensuring that SolrQuery::getFields(), SolrQuery::getFacets() et al
returns an array consistently.
5. Lowering Libxml version to 2.6.16

If there is anything that you think I left out please let me know. This is a
summary.

On Wed, Oct 13, 2010 at 3:48 AM, Stefan Matheis <
matheis.stefan@googlemail.com> wrote:

> On Tue, Oct 12, 2010 at 6:29 PM, Israel Ekpo <is...@gmail.com> wrote:
>
> > I think this feature will take care of this.
> >
> > What do you think?
>
>
> sounds good!
>



-- 
°O°
"Good Enough" is not good enough.
To give anything less than your best is to sacrifice the gift.
Quality First. Measure Twice. Cut Once.
http://www.israelekpo.com/

Re: Solr PHP PECL Extension going to Stable Release - Wishing for Any New Features?

Posted by Stefan Matheis <ma...@googlemail.com>.
On Tue, Oct 12, 2010 at 6:29 PM, Israel Ekpo <is...@gmail.com> wrote:

> I think this feature will take care of this.
>
> What do you think?


sounds good!

Re: Solr PHP PECL Extension going to Stable Release - Wishing for Any New Features?

Posted by Israel Ekpo <is...@gmail.com>.
On Tue, Oct 12, 2010 at 8:43 AM, Stefan Matheis <
matheis.stefan@googlemail.com> wrote:

> Hi Isreal,
>
> On Mon, Oct 11, 2010 at 7:03 AM, Israel Ekpo <is...@gmail.com> wrote:
>
> > If you are using Solr via PHP and would like to see any new features in
> the
> > extension please feel free to send me a note.
>
>
> we actually tried to grab some informations from solr's dataimport-page,
> but
> therefore we had to generate the complete url manually. which means, we
> have
> to access the solr-object to get hostname, port, etc and construct the
> needed url ourself.
>
> perhaps it's an idea to implement something like $solr->executeHttpRequest(
> 'GET', 'dataimport', array( 'command' => 'status' ) which could easily
> reuse
> all given informations and also for example the existing proxy handling.
>
> Regards
> Stefan
>

Stefan,

I agree with you. Excellent idea.

I am currently working on a feature that will allow you to specify the
target path (url) and then able to send any parameters or xml request to the
server.

I think this feature will take care of this.

What do you think?

-- 
°O°
"Good Enough" is not good enough.
To give anything less than your best is to sacrifice the gift.
Quality First. Measure Twice. Cut Once.
http://www.israelekpo.com/

Re: Solr PHP PECL Extension going to Stable Release - Wishing for Any New Features?

Posted by Stefan Matheis <ma...@googlemail.com>.
Hi Isreal,

On Mon, Oct 11, 2010 at 7:03 AM, Israel Ekpo <is...@gmail.com> wrote:

> If you are using Solr via PHP and would like to see any new features in the
> extension please feel free to send me a note.


we actually tried to grab some informations from solr's dataimport-page, but
therefore we had to generate the complete url manually. which means, we have
to access the solr-object to get hostname, port, etc and construct the
needed url ourself.

perhaps it's an idea to implement something like $solr->executeHttpRequest(
'GET', 'dataimport', array( 'command' => 'status' ) which could easily reuse
all given informations and also for example the existing proxy handling.

Regards
Stefan