Search Engine Internals Reference

 

Profile Search Engine


1. Introductory
2. Search form configuration
3. Search Results configuration
4. Search FAQ

Introductory

Pm Premium lets you design your own database. Since these data fields can be variable, the search engine also needs to be flexible. In this article you will explore Profile Manager Premium's search capabilities. It will help you to implement your own profile search engine without requiring any kind of programming knowledge.

Let's see an example of simplest search form:

1: <form action=search.cgi method=get>
2:   <input type=hidden name=infield value=hobbies>
3:   <input type=text name=words size=15 value="">
4:   <input type=submit name=search value=search>
5: </form>

This is a simple search form that performs search on all database fields. The form will show up on the page like this:

1: <form action=search.cgi method=get>
The first line defines the HTML form. The request will be sent to "search.cgi" script using an HTTP GET method. This line will always be same like this.

2: <input type=hidden name=infield value=hobbies>
This is a hidden form field. Hidden form fields are used to send information to the script. Name of this field is "infield" and the value is "hobbies". "hobbies" is a database field which already defined on the @base array in "pmpre.cfg" configuration file. Basically this line tells the script to perform a search on "hobbies" field in the database.

3: <input type=text name=words size=15 value="">
This is the visible part of the form. It will show up an input box that fits 15 characters inside.

4: <input type=submit name=search value=search>
This is the button to perform the search. You can change value part as you wish to. It does not have an importance on the search. It is just what the people see written on the button.

5: </form>
Closure to the form. If you have multiple forms in a page, make sure to close all your forms correctly.

Let's say someone placed "diving" on the form and clicked on "search" button. They will be directed to the page where they can see the results. You will explore how to change the design/data of the search results in the next sections of this article, so don't worry about it now. But, I would like to point out the URL of the next page. The URL is very important to see if the form is really working. Here is what you will see in the URL of the result page:

search.cgi?infield=hobbies&words=diving&search=search

Basically it says "search for diving word(s) in the hobbies field". It is easier to check out the URL of the searches to ensure your own search form is correct. You can actually go backwards and prepare your searches from URL like this and then create your forms that makes the same URL. Here is a method to create your forms:
1. Think the question in english
2. Turn your question into a search URL like the example above with PM Premium search keywords
3. Make sure it works by actually checking out the URL
4. Turn your URL into a form and place it in your web site

You will see this technique can make the job much easier when you design more complex searches. Since you can test different things by simply modifying the url.

Next: Search form configuration

 
  © Copyright 2008 Interlogy LLC. Home | Products | Services | Support | Blog | Contact