Collaborama About Help Contact Anonymous [login] Source: site.view [edit] Function name: cmdSearchByJob Arguments: title,jobDesc Description: Searches the resume db for people applicable to a specific Job Page type: webl Render function: searchResults Module: collabExt Page source: var res = []; var clean = fun(str) str= Wub_ReplaceAll(str, "+", ""); str= Wub_ReplaceAll(str, "-", ""); str= Wub_ReplaceAll(str, "&", ""); str= Wub_ReplaceAll(str, "|", ""); str= Wub_ReplaceAll(str, "(", ""); str= Wub_ReplaceAll(str, ")", ""); str= Wub_ReplaceAll(str, "{", ""); str= Wub_ReplaceAll(str, "}", ""); str= Wub_ReplaceAll(str, "^", ""); str= Wub_ReplaceAll(str, "%", ""); str= Wub_ReplaceAll(str, "\"", ""); str= Wub_ReplaceAll(str, "'", ""); str= Wub_ReplaceAll(str, "*", ""); str= Wub_ReplaceAll(str, "~", ""); str= Wub_ReplaceAll(str, ":", ""); str= Wub_ReplaceAll(str, "\\", ""); str= Wub_ReplaceAll(str, "?", ""); str= Wub_ReplaceAll(str, "!", ""); str= Wub_ReplaceAll(str, ".", ""); str= Wub_ReplaceAll(str, "??", ""); return str end; var reader2 = Wub_ReadLuceneIndex("resumes"); var jobSearch = clean(Str_Trim(title) + Str_Trim(jobDesc) ); var docs2 = Wub_LuceneSearch(reader2, "skills", jobSearch, 20, "standard"); Wub_CloseLuceneIndex(reader2); var i = 0; var sz = (docs2.size() ? 0); while (i < sz) do var d = [. .]; var doc = docs2.get(i).getDoc(); d["id"] := doc.getField("id").stringValue(); d["name"] := doc.getField("name").stringValue(); d["site-standard-profile-request"] := doc.getField("site-standard-profile-request").stringValue(); d["picture-url"] := doc.getField("picture-url").stringValue(); d["headline"] := doc.getField("headline").stringValue(); res = res + [d]; i = i + 1 end; [. title = "Relevant for Job", people = res .];