logo

January's Article On Its Way

After some intensive "what if?" thinking and the application of several well-known Domino hacks I think I've completely reinvented my "simple search field" solution.

The original approach relied too heavily on JavaScript. I never liked the fact that the primary form was, in effect, disabled by the code. As a wannabe purist I wanted the form to work like a real form. We can then cater for users without JS support.

Without JavaScript the whole thing fails and the site has no search functionality. The solution I've arrived at doesn't use any code other than some @Functions. You can see it in action here (notice the search box, top right of page). I'm writing an article about it, which should be published by tonight. Just thought I'd let the hackers amongst you work it out for yourselves in the mean time. If not, the demo database will be a there to download from the article.

It all goes to show what you can do with Domino if you know how to apply the right hacks in the right order. What's the craziest hack you've come up with to solve a Domino problem?

Comments

    • avatar
    • laurens
    • Mon 24 Jan 2005 03:40

    Two questions about the search:

    1. will you make the searchform submit on hitting enter?

    2. will you eliminate the necessity of putting "AND"-operators in between the search terms?

    {Link} This link uses javascript. If you would like to use @formula language, you could try the code below.

    REM {hyphen can be part of a word, or as NOT};

    trimmedquery:=@LowerCase(@Trim(text));

    t000:=@If(@Begins(trimmedquery;"-");" "+trimmedquery;trimmedquery);

    REM {hyphen can be part of a word, or as NOT};

    trimmedquery:=@LowerCase(@Trim(text));

    t000:=@If(@Begins(trimmedquery;"-");" "+trimmedquery;trimmedquery);

    REM {the hyphens that are not part of a word-combination are replaced by NOT and before and after quotation marks # (pound-keys) are placed};

    t00:=@ReplaceSubstring(t000;

    " - " :" -" : " not " : " \"" :"\" " ;

    "%20and%20not%20" : "%20and%20not%20" : "%20and%20not%20" : "#\"" :"\"#");

    t0:=@Explode(t00;"#");

    REM {the query is split into elements, where everything between quotation marks is a seperate element};

    xt:=@Transform(

    t0; "x";

    @If(

    @Contains(x;"\"");

    @ReplaceSubstring(@Trim(x);" ";"%20");

    @Trim(x)));

    REM {to avoid AND operator between words in between quotation marks, the spaces are filled with %20};

    xt1:=@Trim(@Implode(@Unique(xt);" "));

    @ReplaceSubstring(xt1; " & " :" or ": " contains " : " " : "\"" ;

    "%20%26%20" :"%20or%20": "%20contains%20" : "%20and%20" : "%22")

    • avatar
    • Jake
    • Mon 24 Jan 2005 05:54

    Laurens. It should submit on pressing enter already. Does yours not? Which browser?

    I'll bear the code in mind, although I wanted to keep is quite simple for now.

    • avatar
    • Caroline
    • Mon 24 Jan 2005 08:03

    I'm on IE6.0, and Enter does not invoke the search...

    • avatar
    • laurens
    • Mon 24 Jan 2005 08:14

    IE 6 on W2K doesn't work for me, FireFox works fine though.

    • avatar
    • Jake
    • Mon 24 Jan 2005 08:15

    Really? This is weird. What happens when you press enter? Nothing? It works for me in all browsers.

    • avatar
    • laurens
    • Mon 24 Jan 2005 08:37

    It is indeed very strange. Nothing happens on this PC, but I just tested it through IE on a collegues PC and it did submit the search! All PCs here have the same configuration.

    • avatar
    • Debbie
    • Mon 24 Jan 2005 09:53

    enter doesn't work for me on IE 6, XP Professional

    • avatar
    • Dan
    • Mon 24 Jan 2005 10:09

    Jake,

    Does your search function find attachments? Just last week, I had a look at your old Search article and have been testing it. It performs as it should looking for text in the article title/body but if the document has an attachment, it does not find the attachment title.

    I've indexed attached files (before you ask) :-) Any ideas?

    Thanks,

    Dan

    PS: I noticed you didn't have an upload control in the new Search demo page so I could not test to see if your current Search function an find an attachment name.

    • avatar
    • Jake
    • Mon 24 Jan 2005 10:22

    Daniel. The actual searching is just the standard Notes thing. It probably won't search on file name. Probably because the only place this is held is the field called $file. How about adding your own computed field called attachments that stores their names? Notes will probably find them then.

  1. Crazy hacks? How about this one.

    We decided that we didn't want anyone being present with a Notes/Domino logon prompt, mainly because users mistook it for their NT logon and just got frustrated with it reappearing.

    So we download our Exchange address book every night into a separate Notes NAB, match the users to the standard Exchange to Notes NAB provided by MS, and update the user names of all 65000 users with their NT logon names.

    We then use IIS as a front end to our Intranet without anonymous access, so IIS passes Notes the current users NT logon details. Notes finds the NT logon in the (cascaded) address book, converts it to the real (Exchange) name and the user is happy and we have a real name to use within the Notes environment.

    Sounds complicated but it works amazingly well. And not a logon prompt in sight!

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Mon 24 Jan 2005

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

Elsewhere

Here are the external links posted on the same day.

More links are available in the archive »

More Content