Page 1 of 1

Problem with user equiv

Posted: Wed Nov 07, 2001 12:11 pm
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 ?

Problem with user equiv

Posted: Wed Nov 07, 2001 12:44 pm
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.

Problem with user equiv

Posted: Wed Nov 07, 2001 2:08 pm
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 ~ ?

Problem with user equiv

Posted: Wed Nov 07, 2001 3:14 pm
by mark
0 means off which means no expansion without ~.

http://www.thunderstone.com/site/texisman/node199.html