Saturday, January 23, 2010

Site enhancements - Search Box

I've decided that it might be helpful to be able to search the DNA Project site so I've added a search box to the Home page.

Search tips
By default the search engine tries to locate pages which have exact matches for all of the words entered in your search query.    If that fails, it then tries to locate pages which contain any words in your search query.    If that happens a short message is displayed at the top of the search results indicating this has been done.

In addition, there are several ways to modify the default search behavior.

1. phrase search
    The search engine supports three types of phrase search.
    • To match an exact phrase, use quotes around the phrase
      Example: "free search engine"
    • To match a near (within a couple of words) phrase, use square brackets [around the words]
      Example: [free search engine]
    • To match a far (within several words) phrase, use braces { around the words }
      Example: {free search engine}

2. + and - qualifiers
    If you prepend a word with + that word is required to be on the page.
    If you prepend a word with - that word is required to not be on the page.
    Example: +always -never

3. * wildcard
    If a query word ends with a * all words on a page which start the same way as that query word will match.
    Example: gift*

4. ? wildcard
    If a query word contains a ? any character will match that position.
    Example: b?g

5. boolean search
    You can use the following boolean operators in your search: AND, OR, NOT.
    These operators MUST be in capital letters.
    Example: (contact AND us) OR (about AND us)

All of these techniques can be combined: +alway* -ne??r*

I've tried to fine tune it so that it does return all instances of what's asked for and doesn't return extraneaous stuff.    If you observe any strange results in your searches I'd appreciate hearing about them.


Anonymous Anonymous said...

Great idea, Jim!!


12:18 PM  

Post a Comment

<< Home