Link to home
Start Free TrialLog in
Avatar of jaggernat
jaggernat

asked on

searching data

hi experts,

I have  a search engine built on "$$Viewtemplate for jobposting" and "$$Searchtemplate for jobposting" forms
which users can use to search for jobs posted in the "jobposting" view ( through the jobposting form). Users can then click on the search result and apply for the job.

There is a "create profile" form which users can use to fill their profile
information like firstname, lastname, etc.
 
Is there any way i could build a search engine to search for usernames (in the create profile form) who have applied for jobs posted in the "job posting" view.
For example, if i type
IBM, it should display all the "firstnames"( from the create profile form) who have applied for IBM.


I would greatly appreciate any help.

Thanks,
J
Avatar of Bozzie4
Bozzie4
Flag of Belgium image

Why don't you just create a view sorted by username ?

Anyway, you can search on fields if you have the fulltext index enabled (I suppose you already have that).  2 options, really : use url syntax or put the logic in an agent.

This is an example :

Put this somewhere on your form
full text search
<input type=text name=Query value=""><a href="javascript:doSearch(document.forms[0].Root.value,document.forms[0].Query.value);">Search</a>

And add the Query2, Query3 etc. fields in the same way.

Put this in the JS Header

function doSearch(theRoot,theQuery){
//alert( theRoot +" " +theQuery );
if (theQuery == "" ) {
      alert( 'Please enter at least 1 criterium for the search');
}else{
document.location.href="/"+theRoot+"?Searchview&query="+theQuery+"*";
return true;
}
}
function buildFieldSearch(aRoot) {
var aQuery = "";

if (document.forms[0].Query3.value == "") {
 // nothing
}else{
      if (aQuery == "" ) {
      aQuery = '[LastName]=' + document.forms[0].Query3.value;
      }else{
      aQuery = aQuery+'* AND [LastName]=' + document.forms[0].Query3.value;
      }
}

if (document.forms[0].Query4.value == "") {
 // nothing
}else{
      if (aQuery == "" ) {
      aQuery = '[FirstName]=' + document.forms[0].Query4.value;
      }else{
      aQuery = aQuery+'* AND [FirstName]=' + document.forms[0].Query4.value;
      }
}
if (document.forms[0].Query5.value == "") {
 // nothing
}else{
      if (aQuery == "" ) {
      aQuery = '[EmployeeID]=*' + document.forms[0].Query5.value;
      }else{
      aQuery = aQuery+'* AND [EmployeeID]=*' + document.forms[0].Query5.value;
      }
}

return doSearch(aRoot,aQuery);
}

And this in the onsubmit:

doSearch(document.forms[0].Root.value,document.forms[0].Query.value);
return false;

cheers,

Tom
Avatar of qwaletee
qwaletee

Hi jaggernat,

When the user applies, I assume a new "application" document is created, which includes the user name and the job information.  You shoudl be searching those documents.  It really has nothing to do with the profile or job listing forms, since theprofile does not contain job info (unless you make that happen), and the job listing contains no applicant data (which probably would not make sense to make happen).

So, just make sure the application document has fields for name and job # and job title and job description, etc., and you can easily search against those fields.  Search syntax is [FieldName]=Value.

Cheers!
Avatar of jaggernat

ASKER

hi,

thanks for the responces. Qwaletee, the problem is that the application document created does not have the username information. It just has the job information, job title , etc. The user information is stored in a different form.

How do i bring the username information in the application document?

thanks,
J
hi,

thanks for the responces. Qwaletee, the problem is that the application document created does not have the username information. It just has the job information, job title , etc. The user information is stored in a different form.

How do i bring the username information in the application document?

thanks,
J
IN the create profile form, have a hidden field which will store for what 'Jobs' the user applied. After that you can create a view with this form ,and sort it with the username /job

Hope this helps

Partha
That doesn't make any sense to me.  If the user applies, but no user info is contained in the application, HOW DOES THE RECRUITER KNOW WHO APPLIED?

There's something missing here.

Now, if you included only a user ID or key of some sort, then I can understand it.  That will, however, make it harder to do the searches.  I suggest denormalizing the application, so it actually does copy in the user info.  If not, write an agent that searches the applications for the specific job, retrieves all the user keys, and then displays a list of profile links, with the associated profile name.
Magic not allowed, you need to put somewhere the relationship between the applicant name and the job posting.

Then a "search engine" is just a matter of having a button linked to the following javascript function:

<code>
function execSearch() {
  var f = document.forms[0];
  var query = buildQuery(); // shape you query here, and return "" if someting goes wrong
  if( query != "" ) {
    var queryHref = f.BaseURL.value + f.SearchDefaults.value + "&Query=" + escape( query );
    location.href = queryHref;
  }
}
</code>
In the application document there is a submit button (before the user applies for the job). Once the user clicks on the submit button, it shoots an email to the recruiter. Thats how the recruiter knows who has applied.. Okay,
In the application document I can include a field and store the username in that application document. But the problem is how do i create a search that retrieves the username and job info.

thanks,
J
Your problem follows the "user takes item" design pattern. So you need a document to store and retrieve User data (User form), a document to store and retrieve Item data (JobPosting Form), and a document to store and retrieve "who took what" data, i.e. the Relationship data (Application form).

You need to show to the user a view on the current JobPosting documents with their descriptions and expiration date and whatever else. When a user clicks on a job posting link, she will see the correspondent job posting document showing more data about the offering. Noe, if she decides to apply for that job, you need to collect her data to create a User document and an Application document (1). In the latter you should put at least the UserName (if never two users share the same username), the JobTitle (if never two jobs share the same title), and the time at which the relationship was created. It happens that Notes likes redundant data, so I think you'll put something else inside the application document, for example just to show nicely in a view.

Finally you'll create a view Applications where you <<SELECT Form="Application">>, with the first column "Job Title" sorted ascending and showing the field "JobTitle", the second column "User Name" unsorted and showing the field "UserName", and the third column sorted descending and showing the field "Date" (2), and all the other columns you want.

Now, put a textbox labeled "JobQuery" to get the job title to search and a button labeled "Search" and linked to the following javascript function and start testing.

function execSearch() {
  var f = document.forms[0];
  var query = f.JobQuery.value;
  if( query != "" ) {
    var queryHref = "http://www.yourdomain.com"
    + "/path/to/database.nsf/"
    + "Aplications?SearchView&Query=" + escape( query ); // (3)
    location.href = queryHref;
  }
}


---
(1) - alternatively, you can put application data along with user data in the user document, but it's is not a flexible approach
(2) - alternatively, choose a different sorting for the 2nd and 3rd columns
(3) - remember to put your database URL properly formatted
ASKER CERTIFIED SOLUTION
Avatar of Andrea Ercolino
Andrea Ercolino

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial