Search Problem

Hi All,

I have created a web-based application for the first time. This is a web-site just like Job-site. There are lot-of users register himself with their complete detail. These details contains:-

FName

LName

DBO

Location

Last three Company Name where he worked

Current Company

Designation

Job Location

Industry Area

Role

Qualification

Salary

etc.

What my client requires there should be a form which contains several option to search the candidates.

Like:-

Candidates Include from following companies: Oracle, Microsoft

Candidates Exclude from following companies : IBM

Qualification: MBA

Experience : 5-10 yrs.

Functional Area: Account/HR/Finance

Role:

Industry Type: Auto Components

Location: UK, USA

etc…

Just Like a search Engine.

now what I have done is i have created a from which contains Text box, List box, Radio button etc which is suitable for the

above parameters. There is a button named Search which is hot-spot button. At the click event of the button

I wrote a Javascript which gets the value from the field and create a selection formula of a view and passed it as a

query string which calling an agent. This agents sets the selection formula to the view and redirects the page which contains embedded view in which i sets this selection formula.

The JavaScript code is written here:

document.location=“/User.nsf/” + “agSearchadvance” + “?Openagent&qrString=”+qryString+“”;

where query String Contains:

qryString=

SELECT ((Form = “UserRegistration”)) & (@Contains(@LowerCase(presentCompany);@LowerCase(“Oracle, Microsoft”)))& !@Contains(@LowerCase(presentCompany);@LowerCase(“IBM”)) & @Contains(@LowerCase(currDesignation);@LowerCase(“Project Manager”))& (@ToNumber(ctc)>=@ToNumber(“700000”) & @ToNumber(ctc)<=@ToNumber(“700000”))& (@ToNumber(year)>=@ToNumber(“9”) & @ToNumber(year)<=@ToNumber(“20”))& (@Contains(@LowerCase(currentlocation);@LowerCase(“Beijing”: “Hongkong”: “Shanghai”)))& (@Contains(@LowerCase(FunctionalArea);@LowerCase(“Accounts / Finance / Tax / CS / Audit”: “Engineering Design / R&D”)))& (@Contains(@LowerCase(CurrRole);@LowerCase(“Auto Components”)))& (@LowerCase(qualificationmaster)=@LowerCase(“B.Com” ) | @LowerCase(qualificationbachelor)= @LowerCase(“B.Com”))

This is the workaround what I had done…


My anticipations and thought:

1.) As I think, while passing query string through agent this is not so good. It will work for small string but as you see this is very huge and it may also be increase.

2.) Run time settings selection formula to the view will also be not good because at the same moment multiple search will occur from different location of the world.

3.) As I read query string has some limitation in terms of length.

4.) This also doesn’t give me exact data what I want.

I know this is very bad programing or technique what i did, but this is due to lack of my knowledge and technique about web-based.

That’s why posted this query to the forum so that one can help me.

What should be alternative to this and what are the different ways to search the exact document based on the given parameters?

Please help me. This is the moment where i get stuck into it

So please you are requested to help me…

With Regards,

Vikas K Sinha

Subject: Search Problem

add a computed field called saveoptions to your form, use formula “0”

use the event webquerysave to call an agent,

created an agent,

use

set doc = s.documentcontext

to access your document

create your querystring in this agent and do whatever you want to process the search.

Regards, Natalie

Subject: RE: Search Problem

Thanks Natalie,

This idea is good enough, but i would like to knwo that I am useing selection formula and set this to the views. Is it good way or not? As I think in the case of multiple user while searching the result it will confilict. One more thing I used HTML Fileds to get the data. Is this available to the documentcontext. if yes how could it be.

Please help

With Regards,

Vikas K Sinha

Subject: RE: Search Problem

Hi,

I don’t think that this is a good idea, for each user you would need a specific view and if many docs have to be displayed the view indexing takes some time.

I would do it like this:

→ create a fulltextindex for your database

→ build your searchstring, e.g. searchstring=“FIELD test CONTAINS blabla” )

->Redirect your user to

“/database/viewtouse?searchview&query=” + searchstring

→ create a form $$SearchTemplateDefault to display the search results, add a field called $$ViewBody to display the search result.

you wouldn’t even need an agent for this, you might build your searchstring using javascript and use document.location.href=… to switch to the search result.

But there are many other approaches around…

Regards,

Natalie

Subject: RE: Search Problem

Thankyou Sir for your great response.As you know i am novice to this could you please explore me

more about this. I will be very thankful to you for that.

With Regards,

Vikas K Sinha