Search code examples
phpzend-frameworksolrlucene

Implementing a search feature for multiple websites, is Apache Solr a good choice?


I am currently managing a website where those without any web experience can create their own basic multipage website. The site also offers additional 'widgets' that can be placed onto a site to provide interactive features such as comments etc.

We are looking into adding a search widget where the customer can place a search onto their website and it will search all content within their own website including the other 'widgets' that have been used (The individual page content is basic html and the widgets data for all users is stored in a single database). For this we have looked into a number of options on how to do the indexing and searching and have came down to the following options: PHP Zend Lucene or Apache Solr.

We feel Zend Lucene will not be able to achieve what we need, mostly because some of these websites are hosted remotely but use widgets loaded through the main website. Also if we used a single index this could potentially have over 300,000 documents indexed and as I hear Zend Lucene is not good for performance.

Apache Solr seems like the preferred choice. However I have some questions regarding the setup of this and 'multiple' sites.

  • Would it be better to have just a single index and have some unique identifier for each document indexed by a site, then when searching we can use this identifier to restrict to documents from that site.
  • Or would it be better to have multiple indexes?
  • Or is there a better option that we have overlooked?

I am still open to suggestions at this point of how we can implement this if you think you know of a better approach.


Solution

  • Regarding performance, Solr has many of Lucene caching and other optimized parameters. Most people think Zend Lucene is slower than Java Lucene, so your choice might be to use SOLR, but this really depends on the specific application and server resources.

    Check this good previous post : Zend_Search_Lucene vs SOLR