Reputation: 3636
I am having problems doing FTsearch for field values from a notesdocumentcollection
if I go to the view "people" in the notesclient and do a search for FIELD DEPARTMENT = "Finance" I get back several results.
..and when I print out the query in on the web it is exactly the same as when I enter it in the client: FIELD DEPARTMENT = "Finance" but still no result is retrieved.
var dc:NotesDocumentCollection = database.getView("people").getAllDocumentsByKey("people",true);
q = "\"" + r + "\""
query = "FIELD DEPARTMENT Contains " + q
dc.FTSearch(query);
also tried this
query = "[DEPARTMENT] Contains \"" + r + "\"";
dc.FTSearch(query);
if I return "dc" without the search i get several results
My queries seem to work for view.FTSearch and db.FTSearch but not dc.FTSearch.
any ideas?
Upvotes: 2
Views: 790
Reputation: 3636
I solved it, it works now. not sure it was because I added "return" or if it was that I added a new return line. the lines below works
var dc:NotesDocumentCollection = database.getView("people").getAllDocumentsByKey("people",true);
query = "[DEPARTMENT] Contains \"" + r + "\"";
dc.FTSearch(query);
return dc
Upvotes: 1
Reputation: 2359
I think I fell into the same trap: you MUST use the 2nd parameter of FTSearch, e.g.
dc.FTSearch(query, 0)
Upvotes: 1