Elvish Wanderer (aelana) wrote in s2component,
Elvish Wanderer

HOW TO: searching in component using freefind

Ok more component override fun... I used to have a "search style" in S1 that fed to freefind then they changed some things in S1 surrounding & and & that made it impossible... now with S2, I can do it without even creating a style, just by overriding some things in component...

What this allows you to do is sign up with freefind.com for free search which spiders your journal and comments and allows you and others to search through your prior entries and comments without seriously impacting LJ's servers.

How to do it:
use the following override in a theme layer (per another howto posted in this community)
function MonthPage::print() {
  if ($.args{"searchseed"} != "true") {
  } else {
    var MonthEntryInfo index;
    var MonthDay dayindex;
    """<html><head><title>FreeFind Search Seed</title></head><body>""";
    foreach $index ($.months) {
      print "<a href=\"$index.url?.searchseed=true\">$index.url?.searchseed=true</a><br>";
    foreach $dayindex ($.days) {
      var Entry entryindex;
      foreach $entryindex ($dayindex.entries) {
        print "<a href=\"$entryindex.permalink_url\">$entryindex.permalink_url</a><br>";

Then sign up for freefind.com using the url: http://www.livejournal.com/users/username/2003/10/?.searchseed=true (note: replace username with your username and you can use any year and month, it doesnt matter you don't even need to have any entries for that month or even have had a LJ in that month).

Then go into the freefind control panel under "exclude pages" and put the following rules in:
http://www.livejournal.com/users/username/*.html index=yes follow=yes
http://www.livejournal.com/users/username/*?.searchseed=true index=no follow=yes
http://www.livejournal.com/users/username/*.html?mode=reply index=no follow=no
http://www.livejournal.com/users/username/*.html?thread=*#* index=yes follow=yes

Again replacing username with your username.

[edit: thanks to liabunny for the following addition: "a starting point [needs to be added] (under the "build index" tab on the FreeFind Control Center) to http://www.livejournal.com to get it to work" Thanks]

You will need to will want to customize your search result page in freefind, secudeule the spidering for weekly and get the html from the html tab and put it in a post, custom component and/or your user info... But that is all either documented already (see this journal for how to create custom components) or on freefind's control panel which should be easy enough to figure out.

Hope people like and enjoy it.

The benifit of doing it this way instead of a new whole style is that the pages they get to from the search will be in your component style :) plus IMO its slicker, esp if you customize your search page to look like the rest of your journal... then it all looks the same... try mine out at aelana if your interested on how it looks when all is said and done.
  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.