Search code examples
searchgrailsautocompletelucenegoogle-custom-search

Site searching, auto completion


We are building a site that will have a "knowledge centre", that section will contain pdf documents, videos and links to other pages.

We want to add a search feature that will be able to give auto-suggestions/phrase-completion based on the documents, videos and page links.

My first though was to use Lucene, but having a tight deadline someone suggested Google Site Search.

We are using Grails.

How effective will Google site search be? Should Lucene rather be used?

Also, google-cse v2 doesn't allow for onSearchComplete callbacks (as opposed to v1). We have a requirement that if no results are found, it should redirect to a different page.

Thank you.


Solution

  • I've done a project using Google Search and another using Solr so I can help you to choose:

    Google Search

    • Your site need to be online somewhere so that google bot can index it.
    • Your SEO should be good enough.
    • The index is built automatically based on page rule (meta name "robot").
    • You can provide a sitemap with all pages you want to index.
    • Nice backend where you can manage the indexation.
    • You need to learn the API a bit if you want to customize search pages layout.
    • It's not a free service (starting at 100$ per year for 20 000 queries).

    Solr

    • You have to index your site yourself (but as you control your indexing you have a better control of the content indexed.)
    • Then you have to keep the index up-to-date.
    • Easy to customize (you can display search result as you want).
    • Nice feature included (suggestions, auto-completion,...)
    • It's free.

    To sum up if you are on a tight schedule Google site search can be faster to implement at first but Solr is much more customizable and free.