----- Original Message -----
From: "Andrej Filipcic" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 15, 2001 9:10 PM
Subject: [aseek-users] OnLineGeo
>
> Hi,
>
> I was browsing through aspseek's cvs and I am wondering about
> "OnlineGeo on" option. If I understand correctly, countries from text file
are
> inserted into countries table, geo then checks periodicaly for ip ranges
> and country name of existing columns in the table. Is it possible to make
> automatic check and insert for ip not found in countries table when
> running index? This could be done only if there is no Allow match up to
> AllowCountries.
Yes, OnlineGeo is intended for online update and insert of country
information by IP addresses.
But, we strongly recommend to populate country information manually or using
some other sources.
For example, to obtain country information for Asia, we used
http://www.apnic.net.
To switch from offline to online mode:
1. Run index once. Data from files specified by "Countries" commands will be
copied to "countries" table.
2. Remove "Countries" directives from "aspseek.conf".
3. Add directive "OnlineGeo on" to "aspseek.conf".
If "AllowCountries" directive is used in "aspseek.conf", then "index" will
periodically check existing country information and update it on the fly and
insert missing info.
However, this feature is not thoroughly tested on real site.
>
>
> There is a bug in
> void CRanks::LoadRanks(FILE* f)
> In statement
> *r++ = (WORD)(log(buf[i] * 10) * 2000);
> buf[i] is sometimes zero, which crashes on alpha. Maybe you should replace
> it with
> if(buf[i]==0)
> *r++=(WORD)0;
> else
> *r++ = (WORD)(log(buf[i] * 10) * 2000);
>
>
Thanks for report.
>
> I have added function AddAsciiForms to search also for from converted to
> 7bit, and I call after "FindForms(elem, forms);" in qparser.cpp. For the
> moment it is a bit stupid and it work only for part of latin2. For general
> use, there should be a character translation table, for example in
> charsets conf subdir.
>
> Here is the source:
> --------------
> void AddAsciiForms(hash_set<CSWord>& forms) {
>
> // Done only for part of latin2
>
> const int flen=10;
> const unsigned char from[flen] =
> {0xC8,0xE8,0xA9,0xB9,0xAE,0xBE,0xD0,0xF0,0xC6,0xE6};
> const unsigned char to[flen] =
> {'C','c','S','s','Z','z','D','d','C','c'};
>
> for(hash_set<CSWord>::iterator it=forms.begin();it!=forms.end();it++) {
>
> char str[MAX_WORD_LEN+1];
> strncpy(str,it->c_str(),MAX_WORD_LEN+1);
> unsigned char *pos=(unsigned char*)str;
>
> while(*pos) {
> for(int i=0;i<flen;i++) {
> if(*pos==from[i]) {
> *pos=to[i];
> }
> }
> pos++;
> }
> if(strcmp(str,it->c_str()))
> forms.insert(str); // this call extends hash_set -> duplicate
> // checking
> }
>
> }
> ------------
>
Thanks
>
> Best regards,
>
> Andrej Filipcic
>