PHP and Lucene integration

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

PHP and Lucene integration

Alexander MASHTAKOV
Hi Folks,

I'm working on project that is going to have free-text
search mechanism. The project is completely based on
open source technologies, such as MySQL and PHP.
I'm reading about Lucene and think that this is
probably the first candidate.

BTW, the (obvious) question is: "How to integrate PHP
and Lucene ?". What are possible ways to solve this
task ?

Sure, this question was asked a lot of times ... btw
need your opinion. Any information, advices (cons and
pros of a given approach), links are welcome.

Thank you a lot,
/Alexander

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: PHP and Lucene integration

OneWhoMikes
I am also working on interfacing Lucene with PHP.  Here are a couple
options that I have found useful:

Call Java directly from PHP:
http://php-java-bridge.sourceforge.net/

Solr - Interacts w/ Lucene via XML requests
http://incubator.apache.org/solr/index.html
There is mention of a PHP interface (SolPHP) here:
http://wiki.apache.org/solr/SolPHP

Hope this helps.


--Mike



On 6/6/06, Alexander MASHTAKOV <[hidden email]> wrote:

> Hi Folks,
>
> I'm working on project that is going to have free-text
> search mechanism. The project is completely based on
> open source technologies, such as MySQL and PHP.
> I'm reading about Lucene and think that this is
> probably the first candidate.
>
> BTW, the (obvious) question is: "How to integrate PHP
> and Lucene ?". What are possible ways to solve this
> task ?
>
> Sure, this question was asked a lot of times ... btw
> need your opinion. Any information, advices (cons and
> pros of a given approach), links are welcome.
>
> Thank you a lot,
> /Alexander
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: PHP and Lucene integration

Rob Staveley (Tom)
In reply to this post by Alexander MASHTAKOV
For querying, we have PHP talking to our Java application through sockets
and XML. Queries are set up in PHP, creating an XML document which
corresponds to a subset of the subclasses of
http://lucene.apache.org/java/docs/api/org/apache/lucene/search/Query.html.
If we'd had the PHP skill set at the time, we'd probably have implemented
Lucene as a web service, but this works nicely enough and is portable. We
don't interface with the application that writes to the index in PHP -
that's left to a C++ client - but once again there is a simply protocol it
uses to talk through a socket.

-----Original Message-----
From: Alexander MASHTAKOV [mailto:[hidden email]]
Sent: 06 June 2006 14:26
To: [hidden email]
Subject: PHP and Lucene integration

Hi Folks,

I'm working on project that is going to have free-text search mechanism. The
project is completely based on open source technologies, such as MySQL and
PHP.
I'm reading about Lucene and think that this is probably the first
candidate.

BTW, the (obvious) question is: "How to integrate PHP and Lucene ?". What
are possible ways to solve this task ?

Sure, this question was asked a lot of times ... btw need your opinion. Any
information, advices (cons and pros of a given approach), links are welcome.

Thank you a lot,
/Alexander

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: PHP and Lucene integration

Peter A. Daly
In reply to this post by Alexander MASHTAKOV
Other replies mention SOLR.  I'm fairly new to SOLR, but have used
Lucene quite a bit.  Based on your situation, it certainly sounds like
SOLR is worth looking into.  I was able to convert a portion of one of
my sites from being SQL powered to SOLR powered in about a days work,
which includes learning SOLR.

FWIW, my first impressions are here:
http://www.budget-ha.com/lucene/solr/

-Pete

On 6/6/06, Alexander MASHTAKOV <[hidden email]> wrote:

> Hi Folks,
>
> I'm working on project that is going to have free-text
> search mechanism. The project is completely based on
> open source technologies, such as MySQL and PHP.
> I'm reading about Lucene and think that this is
> probably the first candidate.
>
> BTW, the (obvious) question is: "How to integrate PHP
> and Lucene ?". What are possible ways to solve this
> task ?
>
> Sure, this question was asked a lot of times ... btw
> need your opinion. Any information, advices (cons and
> pros of a given approach), links are welcome.
>
> Thank you a lot,
> /Alexander
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: PHP and Lucene integration

Vinay Yadav
In reply to this post by Alexander MASHTAKOV
Hi,

Zend Search Framework can help you. Take a look at
http://framework.zend.com/manual/en/zend.search.html

-------------------------------------------------------------
  Zend_Search_Lucene is a general purpose text search engine written
entirely in PHP 5. Since it stores its index on the filesystem and does
not require a database server, it can add search capabilities to almost
any PHP-driven website. Zend_Search_Lucene supports the following features:

     * Ranked searching - best results returned first
     * Many powerful query types: phrase queries, wildcard queries,
proximity queries, range queries and more [5]
     * Search by specific field (e.g., title, author, contents)

Zend_Search_Lucene was derived from the Apache Lucene project. For more
information on Lucene, visit http://lucene.apache.org/java/docs/.
-------------------------------------------------------------

I have implemented it at http://www.edoctors.in/search/. It works fine -
  though we are still working on optimizing the index.

Hope this helps.

Regards
Vinay



Alexander MASHTAKOV wrote:

> Hi Folks,
>
> I'm working on project that is going to have free-text
> search mechanism. The project is completely based on
> open source technologies, such as MySQL and PHP.
> I'm reading about Lucene and think that this is
> probably the first candidate.
>
> BTW, the (obvious) question is: "How to integrate PHP
> and Lucene ?". What are possible ways to solve this
> task ?
>
> Sure, this question was asked a lot of times ... btw
> need your opinion. Any information, advices (cons and
> pros of a given approach), links are welcome.
>
> Thank you a lot,
> /Alexander
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com 
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]


Mob: +91 9422113939

------------------------------------------------
Vinay Yadav vinayRas Infotech
www.vinayras.com Nagpur, India
------------------------------------------------
    Linux Consultant & PHP/MySQL Developer
------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: PHP and Lucene integration

Alexander MASHTAKOV
Hi,

Thank you for reply.
I've also had a look at Zend framework. But, at
this moment they do not support unicode,
which is a mandatory requirement in my case.

The other thing - performance. In order
to run faster - it's necessary to have opened
index, rather then open and close it for each request.
Index updates have to be serialized somehow and after
the update, it has to be re-opened again.

IMO, for this purpose it's better to have Lucene
in "separate process" and implement some kind of
communication protocol between PHP and Java sides
(sockets, etc)

Regards,
/Alexander

--- Vinay Yadav <[hidden email]> wrote:

> Hi,
>
> Zend Search Framework can help you. Take a look at
> http://framework.zend.com/manual/en/zend.search.html
>
>
-------------------------------------------------------------

>   Zend_Search_Lucene is a general purpose text
> search engine written
> entirely in PHP 5. Since it stores its index on the
> filesystem and does
> not require a database server, it can add search
> capabilities to almost
> any PHP-driven website. Zend_Search_Lucene supports
> the following features:
>
>      * Ranked searching - best results returned
> first
>      * Many powerful query types: phrase queries,
> wildcard queries,
> proximity queries, range queries and more [5]
>      * Search by specific field (e.g., title,
> author, contents)
>
> Zend_Search_Lucene was derived from the Apache
> Lucene project. For more
> information on Lucene, visit
> http://lucene.apache.org/java/docs/.
>
-------------------------------------------------------------

>
> I have implemented it at
> http://www.edoctors.in/search/. It works fine -
>   though we are still working on optimizing the
> index.
>
> Hope this helps.
>
> Regards
> Vinay
>
>
>
> Alexander MASHTAKOV wrote:
> > Hi Folks,
> >
> > I'm working on project that is going to have
> free-text
> > search mechanism. The project is completely based
> on
> > open source technologies, such as MySQL and PHP.
> > I'm reading about Lucene and think that this is
> > probably the first candidate.
> >
> > BTW, the (obvious) question is: "How to integrate
> PHP
> > and Lucene ?". What are possible ways to solve
> this
> > task ?
> >
> > Sure, this question was asked a lot of times ...
> btw
> > need your opinion. Any information, advices (cons
> and
> > pros of a given approach), links are welcome.
> >
> > Thank you a lot,
> > /Alexander
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com 
> >
> >
>
---------------------------------------------------------------------

> > To unsubscribe, e-mail:
> [hidden email]
> > For additional commands, e-mail:
> [hidden email]
>
>
> Mob: +91 9422113939
>
> ------------------------------------------------
> Vinay Yadav vinayRas Infotech
> www.vinayras.com Nagpur, India
> ------------------------------------------------
>     Linux Consultant & PHP/MySQL Developer
> ------------------------------------------------
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [hidden email]
> For additional commands, e-mail:
> [hidden email]
>
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: PHP and Lucene integration

Alexander MASHTAKOV
Has anyone tried to solve this task ?

--- Alexander MASHTAKOV <[hidden email]> wrote:

> Hi,
>
> Thank you for reply.
> I've also had a look at Zend framework. But, at
> this moment they do not support unicode,
> which is a mandatory requirement in my case.
>
> The other thing - performance. In order
> to run faster - it's necessary to have opened
> index, rather then open and close it for each
> request.
> Index updates have to be serialized somehow and
> after
> the update, it has to be re-opened again.
>
> IMO, for this purpose it's better to have Lucene
> in "separate process" and implement some kind of
> communication protocol between PHP and Java sides
> (sockets, etc)
>
> Regards,
> /Alexander
>
> --- Vinay Yadav <[hidden email]> wrote:
>
> > Hi,
> >
> > Zend Search Framework can help you. Take a look at
> >
> http://framework.zend.com/manual/en/zend.search.html
> >
> >
>
-------------------------------------------------------------

> >   Zend_Search_Lucene is a general purpose text
> > search engine written
> > entirely in PHP 5. Since it stores its index on
> the
> > filesystem and does
> > not require a database server, it can add search
> > capabilities to almost
> > any PHP-driven website. Zend_Search_Lucene
> supports
> > the following features:
> >
> >      * Ranked searching - best results returned
> > first
> >      * Many powerful query types: phrase queries,
> > wildcard queries,
> > proximity queries, range queries and more [5]
> >      * Search by specific field (e.g., title,
> > author, contents)
> >
> > Zend_Search_Lucene was derived from the Apache
> > Lucene project. For more
> > information on Lucene, visit
> > http://lucene.apache.org/java/docs/.
> >
>
-------------------------------------------------------------

> >
> > I have implemented it at
> > http://www.edoctors.in/search/. It works fine -
> >   though we are still working on optimizing the
> > index.
> >
> > Hope this helps.
> >
> > Regards
> > Vinay
> >
> >
> >
> > Alexander MASHTAKOV wrote:
> > > Hi Folks,
> > >
> > > I'm working on project that is going to have
> > free-text
> > > search mechanism. The project is completely
> based
> > on
> > > open source technologies, such as MySQL and PHP.
> > > I'm reading about Lucene and think that this is
> > > probably the first candidate.
> > >
> > > BTW, the (obvious) question is: "How to
> integrate
> > PHP
> > > and Lucene ?". What are possible ways to solve
> > this
> > > task ?
> > >
> > > Sure, this question was asked a lot of times ...
> > btw
> > > need your opinion. Any information, advices
> (cons
> > and
> > > pros of a given approach), links are welcome.
> > >
> > > Thank you a lot,
> > > /Alexander
> > >
> > >
> __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > protection around
> > > http://mail.yahoo.com 
> > >
> > >
> >
>
---------------------------------------------------------------------

> > > To unsubscribe, e-mail:
> > [hidden email]
> > > For additional commands, e-mail:
> > [hidden email]
> >
> >
> > Mob: +91 9422113939
> >
> > ------------------------------------------------
> > Vinay Yadav vinayRas Infotech
> > www.vinayras.com Nagpur, India
> > ------------------------------------------------
> >     Linux Consultant & PHP/MySQL Developer
> > ------------------------------------------------
> >
> >
> >
>
---------------------------------------------------------------------

> > To unsubscribe, e-mail:
> > [hidden email]
> > For additional commands, e-mail:
> > [hidden email]
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com 
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [hidden email]
> For additional commands, e-mail:
> [hidden email]
>
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: PHP and Lucene integration

Peter A. Daly
In reply to this post by Alexander MASHTAKOV
On 6/6/06, Alexander MASHTAKOV <[hidden email]> wrote:
> The other thing - performance. In order
> to run faster - it's necessary to have opened
> index, rather then open and close it for each request.
> Index updates have to be serialized somehow and after
> the update, it has to be re-opened again.

SOLR does a very nice job of handling all that.  It even "warms" new
IndexSearchers up by performing automated queries to prepopulate the
cache before a new IndexSearcher is used to respond to queries.

Unless there is an issue with it, SOLR sounds like a good solution for
what you need to do.

-Pete

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: PHP and Lucene integration

Paul Borgermans
In reply to this post by Alexander MASHTAKOV
Hi

I'm currently doing just that: using the php-java bridge. Here the
goal is to integrate Java-Lucene with a php4 based CMS (eZ publish),
so the Zend framework is not an answer (and premature imho). The code
we've written is a bit CMS specific, but you should be able to to do
the same quite fast.

About having an indexreader open all the time, it should be feasible
(the php-jave bridge can be installed in a number of ways) but have
not tacled that yet.

Good luck

paul

On 6/6/06, Alexander MASHTAKOV <[hidden email]> wrote:

> Hi,
>
> Thank you for reply.
> I've also had a look at Zend framework. But, at
> this moment they do not support unicode,
> which is a mandatory requirement in my case.
>
> The other thing - performance. In order
> to run faster - it's necessary to have opened
> index, rather then open and close it for each request.
> Index updates have to be serialized somehow and after
> the update, it has to be re-opened again.
>
> IMO, for this purpose it's better to have Lucene
> in "separate process" and implement some kind of
> communication protocol between PHP and Java sides
> (sockets, etc)
>
> Regards,
> /Alexander
>
> --- Vinay Yadav <[hidden email]> wrote:
>
> > Hi,
> >
> > Zend Search Framework can help you. Take a look at
> > http://framework.zend.com/manual/en/zend.search.html
> >
> >
> -------------------------------------------------------------
> >   Zend_Search_Lucene is a general purpose text
> > search engine written
> > entirely in PHP 5. Since it stores its index on the
> > filesystem and does
> > not require a database server, it can add search
> > capabilities to almost
> > any PHP-driven website. Zend_Search_Lucene supports
> > the following features:
> >
> >      * Ranked searching - best results returned
> > first
> >      * Many powerful query types: phrase queries,
> > wildcard queries,
> > proximity queries, range queries and more [5]
> >      * Search by specific field (e.g., title,
> > author, contents)
> >
> > Zend_Search_Lucene was derived from the Apache
> > Lucene project. For more
> > information on Lucene, visit
> > http://lucene.apache.org/java/docs/.
> >
> -------------------------------------------------------------
> >
> > I have implemented it at
> > http://www.edoctors.in/search/. It works fine -
> >   though we are still working on optimizing the
> > index.
> >
> > Hope this helps.
> >
> > Regards
> > Vinay
> >
> >
> >
> > Alexander MASHTAKOV wrote:
> > > Hi Folks,
> > >
> > > I'm working on project that is going to have
> > free-text
> > > search mechanism. The project is completely based
> > on
> > > open source technologies, such as MySQL and PHP.
> > > I'm reading about Lucene and think that this is
> > > probably the first candidate.
> > >
> > > BTW, the (obvious) question is: "How to integrate
> > PHP
> > > and Lucene ?". What are possible ways to solve
> > this
> > > task ?
> > >
> > > Sure, this question was asked a lot of times ...
> > btw
> > > need your opinion. Any information, advices (cons
> > and
> > > pros of a given approach), links are welcome.
> > >
> > > Thank you a lot,
> > > /Alexander
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > protection around
> > > http://mail.yahoo.com
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > [hidden email]
> > > For additional commands, e-mail:
> > [hidden email]
> >
> >
> > Mob: +91 9422113939
> >
> > ------------------------------------------------
> > Vinay Yadav                   vinayRas Infotech
> > www.vinayras.com              Nagpur, India
> > ------------------------------------------------
> >     Linux Consultant & PHP/MySQL Developer
> > ------------------------------------------------
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > [hidden email]
> > For additional commands, e-mail:
> > [hidden email]
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
http://walhalla.wordpress.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]