Problem with user equiv

Post Reply
carsten.harnisch1
Posts: 37
Joined: Fri Jul 13, 2001 12:27 pm

Problem with user equiv

Post by carsten.harnisch1 »

I builded a very simple userequiv-file with the following content (userequiv.lst) :
noword;u,inferno
with gets compiled to userequiv with backref.
We are using a api prog to equery the db. Before running the search I did :

APICP* cp;
int ret;
ret = n_setueqprefix(se, "");

char szUserEquivFileName[512];
strcpy (szUserEquivFileName, szDatabase);
strcat (szUserEquivFileName, "/userequiv");
ret = n_seteqprefix(se, szUserEquivFileName);

cp = openapicp();
// invert ~ -> so use equiv on all words
cp->keepeqvs = (byte)0;
cp->alequivs = (byte)1;
closeapicp(cp);

and the runs a search like :
select ... from html where Title\\Description\\Keywords\\Body likep XXX

Doing a search on 'inferno' returns the results. Search on '~noword' gets the matches, but 'noword' does not !
The documentation says cp->keepeqvs "Invert normal meaning of ~", so shouldn't that mean to expand all word and
the marked with ~ not ? Or have I to close the APICP after the search ?
But anything is going wrong here, do I miss something here ?
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

Problem with user equiv

Post by Kai »

Your keepeqv/alequivs settings only apply to the APICP you opened (and then closed), not to the SERVER handle doing the SQL query. You need to use n_setkeepeqvs() and n_setalequivs() on the SERVER handle, not set a new APICP's values.

There's no need to open a separate APICP with openapicp(), unless you're explicitly using that APICP with the Metamorph API, which I doubt.
carsten.harnisch1
Posts: 37
Joined: Fri Jul 13, 2001 12:27 pm

Problem with user equiv

Post by carsten.harnisch1 »

right, seems to be obvious. anyway does
n_setkeepeqvs(se, 0);
mean to expand all words and not these prefixed by a ~ ?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Problem with user equiv

Post by mark »

Post Reply