SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Evangelist Barnum's Avatar
    Join Date
    Oct 2008
    Posts
    418
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Good Search Program

    Want to add a "search" feature to my website, and wondered if someone can recommend a good code or program.
    I experimented with the Goodle code, and while it's good, it's doesn't always take the visitor to the correct place
    (i.e. it will sometimes just take to you the top of the page, not the article or item in question). Then again, maybe I am wrong in how these things work.....?

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,109
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    You would probably need to be using a content management system to have a search function for your site. I have used the native CMS search functionality a few times, but to be honest, I find the Google search function to be much better anyway. Google sees much more on your site that your CMS ever will, so it gives better results. It's not ideal that the user gets taen to the Google site to see the results, but you can't have everything.

  3. #3
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    The advantage of using Google is that most user will be familiar with the interface. Furthermore, advanced users might prefer not to use local search engines, as most are quite poor. Building a proper search engine isn't exactly trivial, especially if you want to be able to do fuzzy searches. I would suggest experimenting a bit more with Google, before you give up on it, and ask here if you have any specific problems (I'm not sure what you mean about being taken to the top of the page).
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  4. #4
    SitePoint Evangelist Barnum's Avatar
    Join Date
    Oct 2008
    Posts
    418
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    For instance, when I typed in a specific word, it would simply take you to the top of that page, not to the article or comments that included the word. A few of my pages are quite long...

  5. #5
    Sploghm bronze trophy Victorinox's Avatar
    Join Date
    Nov 2008
    Posts
    749
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    This why it's a good idea not to have too much content, or diverse topics in depth, on a single page.

    If you cannot reduce the amount of content by sorting it into separate pages, adding a list of in-page links at the top of the page may help visitors find what they're looking for, once landed. This would require adding ids to elements that identify sections, such as headings, and making the id the href target of the link anchor. e.g.

    In-page links list
    Code HTML:
    <ul>
    <li><a href="#elephant">Elephant</a></li>
    <li><a href="#zebra">Zebra</a></li>
    <li><a href="#marmoset">Marmoset</a></li>
    </ul>
    Linked heading
    Code HTML:
    <h2 id="elephant">Elephant</h2>
    <p>Elephants are well known for their large size, grey colour...</p>

  6. #6
    SitePoint Member
    Join Date
    Nov 2011
    Location
    Down underer
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Barnum View Post
    (i.e. it will sometimes just take to you the top of the page, not the article or item in question). Then again, maybe I am wrong in how these things work.....?
    A good search function is not quite trivial. You would have to alter the content when printing it out and add <a name="#pos1">first match</a> or something like that around all your matches (while avoiding collisions with existing anchors, and without breaking any existing html), then the browser can scroll to the first match.
    However there is much more to it; you would have to do some stemming on your search input and all your content and then decide which of your pages is the closes to the search input, while mostly ignoring all the stopwords you may encounter.

    Find a plugin for your cms that, or use google site search. There probably wont be any "a good code or program" that works out of the box for any site, since it has to hook in to your existing cms and create it's own db tables so it can pre-index and score your content etc.

  7. #7
    Non-Member
    Join Date
    Sep 2007
    Posts
    148
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Personally I've always liked Sphinx: http://sphinxsearch.com/about/sphinx/

  8. #8
    SitePoint Mentor silver trophybronze trophy
    Mikl's Avatar
    Join Date
    Dec 2011
    Location
    Edinburgh, Scotland
    Posts
    1,541
    Mentioned
    63 Post(s)
    Tagged
    0 Thread(s)
    You might want to consider Freefind. I used it on one of early sites, and it seems to have provided a good service. They have a free option, which has advertisements on the search results, and a paid-for option which is ad-free.

    That said, I tend to use Google now, mainly because it's a leading brand name.

    Mike

  9. #9
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you need free internal site search without ads for a small website then you may want to check Findberry. It is a hosted commercial service, but it is free for sites with 200 pages or less (no ads and you can specify your own design by means of HTML/CSS).

    You should know - my suggestion is biased, because I'm one of the designers at Findberry.
    Karlis Blumentals
    Blumentals Software - my apps for web developers
    Findberry - add search to your website
    Rapid SEO Tool - my app for easier SEOing


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •