diff options
author | ache <ache@FreeBSD.org> | 2001-03-13 23:49:35 +0800 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2001-03-13 23:49:35 +0800 |
commit | b41bae5ed915a465f1f5c4deb0f32863e6c48960 (patch) | |
tree | 2c15078fce3057b4f59fa305a9cee2de5517bee8 | |
parent | ccb41dacb66724094359377abc74b367c4c75524 (diff) | |
download | freebsd-ports-gnome-b41bae5ed915a465f1f5c4deb0f32863e6c48960.tar.gz freebsd-ports-gnome-b41bae5ed915a465f1f5c4deb0f32863e6c48960.tar.zst freebsd-ports-gnome-b41bae5ed915a465f1f5c4deb0f32863e6c48960.zip |
Upgrade to 3.1.12
24 files changed, 9 insertions, 1143 deletions
diff --git a/www/mnoGoSearch-current/Makefile b/www/mnoGoSearch-current/Makefile index 23d2f769c822..7c1417c28010 100644 --- a/www/mnoGoSearch-current/Makefile +++ b/www/mnoGoSearch-current/Makefile @@ -6,8 +6,7 @@ # PORTNAME= mnogosearch -PORTVERSION= 3.1.11 -PORTREVISION= 2 +PORTVERSION= 3.1.12 CATEGORIES= www databases MASTER_SITES= http://search.mnogo.ru/Download/ @@ -58,9 +57,6 @@ pre-fetch: @${ECHO} .endif -post-patch: - cp ${FILESDIR}/cross*.txt ${WRKSRC}/create/msql - pre-install: @${MKDIR} ${PREFIX}/share/mnogosearch diff --git a/www/mnoGoSearch-current/distinfo b/www/mnoGoSearch-current/distinfo index 8cd87641a606..a0400a918450 100644 --- a/www/mnoGoSearch-current/distinfo +++ b/www/mnoGoSearch-current/distinfo @@ -1 +1 @@ -MD5 (mnogosearch-3.1.11.tar.gz) = ef4489ee3c9f8bcfce7a3ac4e9bd8a18 +MD5 (mnogosearch-3.1.12.tar.gz) = bd008c8f671924198e251146c8f31ab6 diff --git a/www/mnoGoSearch-current/files/cross-crc.txt b/www/mnoGoSearch-current/files/cross-crc.txt deleted file mode 100644 index b68750b0b1f9..000000000000 --- a/www/mnoGoSearch-current/files/cross-crc.txt +++ /dev/null @@ -1,12 +0,0 @@ -DROP TABLE ncrossdict\g - -CREATE TABLE ncrossdict ( - url_id int NOT NULL, - ref_id int NOT NULL, - word_id int NOT NULL, - intag int NOT NULL -)\g - -CREATE INDEX ncrossdict_url_id ON ncrossdict (url_id)\g -CREATE INDEX ncrossdict_ref_id ON ncrossdict (ref_id)\g -CREATE INDEX ncrossdict_word_id ON ncrossdict (word_id)\g diff --git a/www/mnoGoSearch-current/files/cross.txt b/www/mnoGoSearch-current/files/cross.txt deleted file mode 100644 index d8dd2048b2fe..000000000000 --- a/www/mnoGoSearch-current/files/cross.txt +++ /dev/null @@ -1,13 +0,0 @@ -DROP TABLE crossdict\g - -CREATE TABLE crossdict ( - url_id int NOT NULL, - ref_id int NOT NULL, - word char(32) NOT NULL, - intag int NOT NULL -)\g - - -CREATE INDEX crossdict_url_id ON crossdict (url_id)\g -CREATE INDEX crossdict_ref_id ON crossdict (ref_id)\g -CREATE INDEX crossdict_word ON crossdict (word)\g diff --git a/www/mnoGoSearch-current/files/patch-ac b/www/mnoGoSearch-current/files/patch-ac deleted file mode 100644 index d8ef2290a0b6..000000000000 --- a/www/mnoGoSearch-current/files/patch-ac +++ /dev/null @@ -1,11 +0,0 @@ ---- etc/search.htm-dist.bak Fri Feb 16 12:49:16 2001 -+++ etc/search.htm-dist Tue Feb 20 20:00:27 2001 -@@ -126,7 +126,7 @@ - <SELECT NAME="wm"> - <OPTION VALUE="wrd" SELECTED="$wm">Whole word - <OPTION VALUE="beg" SELECTED="$wm">Beginning --<OPTION VALUE="beg" SELECTED="$wm">Ending -+<OPTION VALUE="end" SELECTED="$wm">Ending - <OPTION VALUE="sub" SELECTED="$wm">Substring - </SELECT> - diff --git a/www/mnoGoSearch-current/files/patch-stopw b/www/mnoGoSearch-current/files/patch-stopw deleted file mode 100644 index 44469a7c24db..000000000000 --- a/www/mnoGoSearch-current/files/patch-stopw +++ /dev/null @@ -1,24 +0,0 @@ ---- src/searchtool.c.orig Fri Feb 16 19:12:22 2001 -+++ src/searchtool.c Thu Mar 1 16:22:54 2001 -@@ -251,11 +251,16 @@ - continue; - } - len=strlen(rw); -- if(UdmIsStopWord(query->Conf,rw)||(query->Conf->min_word_len>len)||(query->Conf->max_word_len<len)){ -- if(query->wordinfo[0])strcat(query->wordinfo,", "); -- sprintf(UDM_STREND(query->wordinfo)," %s :stopword",rw); -- lex=UdmGetLex(&w,&lasttok,query->charset); -- continue; -+ -+ if(query->word_match==UDM_MATCH_WORD){ -+ /* Check stopword only when full word */ -+ /* Substring searches should not exclude them */ -+ if(UdmIsStopWord(query->Conf,rw)||(query->Conf->min_word_len>len)||(query->Conf->max_word_len<len)){ -+ if(query->wordinfo[0])strcat(query->wordinfo,", "); -+ sprintf(UDM_STREND(query->wordinfo)," %s :stopword",rw); -+ lex=UdmGetLex(&w,&lasttok,query->charset); -+ continue; -+ } - } - if(query->words_in_query<UDM_MAXWORDPERQUERY-1){ - query->words[query->words_in_query]=strdup(rw); diff --git a/www/mnoGoSearch-current/files/patch-substr b/www/mnoGoSearch-current/files/patch-substr deleted file mode 100644 index b7b18781efb5..000000000000 --- a/www/mnoGoSearch-current/files/patch-substr +++ /dev/null @@ -1,315 +0,0 @@ -Index: src/sql.c -=================================================================== -RCS file: /usr/src/CVS/mnogosearch/src/sql.c,v -retrieving revision 1.25 -diff -u -r1.25 sql.c ---- src/sql.c 2001/02/26 15:58:17 1.25 -+++ src/sql.c 2001/02/27 13:51:54 -@@ -3723,6 +3723,9 @@ - char qbuf[UDMSTRSIZ]; - UDM_SEARCHWORD * wrd=NULL; - size_t wordnum; -+ int has_crosswrd=0; -+ int wcounts[UDM_MAXWORDPERQUERY]; -+ - #ifdef HAVE_MYSQL - MYSQL_ROW row; - #endif -@@ -3732,147 +3735,164 @@ - #endif - - UdmPrepare(query,text); -+ bzero(wcounts,sizeof(wcounts)); - - /* Now find each word */ - for(wordnum=0;wordnum<query->words_in_query;wordnum++){ -- int numrows,firstnum,curnum,len,i; -+ int numrows,firstnum,curnum,tnum,i,tmin,tmax,tlst=-1; - char tablename[32]="dict"; -+ -+ if((query->Conf->DBMode==UDM_DBMODE_MULTI)&&(query->word_match!=UDM_MATCH_WORD)){ -+ /* This is for substring search! */ -+ /* In Multi mode: we have to scan */ -+ /* almost all tables except those */ -+ /* with to short words */ -+ -+ tmin=DICTNUM(strlen(query->words[wordnum])); -+ tmax=MAXDICT; -+ }else{ -+ tmin=tmax=DICTNUM(strlen(query->words[wordnum])); -+ } -+ -+ for(tnum=tmin;tnum<=tmax;tnum++){ -+ -+ if(tlst!=DICTNUM(tnum)){ -+ tlst=DICTNUM(tnum); - #ifdef DEBUG_SEARCH -- ticks=UdmStartTimer(); -- fprintf(stderr,"Start search for '%s'\n",rw); -+ ticks=UdmStartTimer(); -+ fprintf(stderr,"Start search for '%s'\n",rw); - #endif -- switch(query->Conf->DBMode){ -- case UDM_DBMODE_MULTI: -- len=strlen(query->words[wordnum]);len=DICTNUM(len); -- sprintf(tablename,"dict%d",len); -- break; -- case UDM_DBMODE_MULTI_CRC: -- len=strlen(query->words[wordnum]);len=DICTNUM(len); -- sprintf(tablename,"ndict%d",len); -- break; -- case UDM_DBMODE_SINGLE_CRC: -- strcpy(tablename,"ndict"); -- break; -- default: -- break; -- } -- if((query->Conf->DBMode==UDM_DBMODE_SINGLE_CRC)|| -- (query->Conf->DBMode==UDM_DBMODE_MULTI_CRC)){ -- udmcrc32_t crc; -- crc=query->cwords[wordnum]; -- if(query->Conf->tagstr[0] || query->Conf->statusstr[0] || query->Conf->urlstr[0] || query->Conf->langstr[0] || query->Conf->timestr[0] || query->Conf->catstr[0]){ -- sprintf(qbuf,"\ --SELECT %s.url_id,%s.intag \ --FROM %s,url \ --WHERE %s.word_id=%d \ --AND url.rec_id=%s.url_id %s%s%s%s%s%s", -- tablename,tablename, -- tablename,tablename, -- crc,tablename, -- query->Conf->tagstr, -- query->Conf->statusstr, -- query->Conf->urlstr, -- query->Conf->langstr, -- query->Conf->timestr, -- query->Conf->catstr); -- }else{ -- sprintf(qbuf,"SELECT url_id,intag FROM %s WHERE word_id=%d",tablename,crc); -- } -- }else{ -- char cmparg[256]; -- switch(query->word_match){ -- case UDM_MATCH_BEGIN: -- sprintf(cmparg," LIKE '%s%%'",query->words[wordnum]); -+ switch(query->Conf->DBMode){ -+ case UDM_DBMODE_MULTI: -+ sprintf(tablename,"dict%d",DICTNUM(tnum)); - break; -- case UDM_MATCH_END: -- sprintf(cmparg," LIKE '%%%s'",query->words[wordnum]); -+ case UDM_DBMODE_MULTI_CRC: -+ sprintf(tablename,"ndict%d",DICTNUM(tnum)); - break; -- case UDM_MATCH_SUBSTR: -- sprintf(cmparg," LIKE '%%%s%%'",query->words[wordnum]); -+ case UDM_DBMODE_SINGLE_CRC: -+ strcpy(tablename,"ndict"); - break; -- case UDM_MATCH_WORD: - default: -- sprintf(cmparg,"='%s'",query->words[wordnum]); - break; -- } -- if(query->Conf->tagstr[0]||query->Conf->statusstr[0]||query->Conf->urlstr[0]||query->Conf->langstr[0]||query->Conf->catstr[0]||query->Conf->timestr[0]){ -- -- sprintf(qbuf,"\ -+ } -+ if((query->Conf->DBMode==UDM_DBMODE_SINGLE_CRC)||(query->Conf->DBMode==UDM_DBMODE_MULTI_CRC)){ -+ udmcrc32_t crc; -+ crc=query->cwords[wordnum]; -+ if(query->Conf->tagstr[0] || query->Conf->statusstr[0] || query->Conf->urlstr[0] || query->Conf->langstr[0] || query->Conf->timestr[0] || query->Conf->catstr[0]){ -+ sprintf(qbuf,"\ - SELECT %s.url_id,%s.intag \ - FROM %s,url \ -+WHERE %s.word_id=%d \ -+AND url.rec_id=%s.url_id %s%s%s%s%s%s", -+ tablename,tablename, -+ tablename,tablename, -+ crc,tablename, -+ query->Conf->tagstr, -+ query->Conf->statusstr, -+ query->Conf->urlstr, -+ query->Conf->langstr, -+ query->Conf->timestr, -+ query->Conf->catstr); -+ }else{ -+ sprintf(qbuf,"SELECT url_id,intag FROM %s WHERE word_id=%d",tablename,crc); -+ } -+ }else{ -+ char cmparg[256]; -+ switch(query->word_match){ -+ case UDM_MATCH_BEGIN: -+ sprintf(cmparg," LIKE '%s%%'",query->words[wordnum]); -+ break; -+ case UDM_MATCH_END: -+ sprintf(cmparg," LIKE '%%%s'",query->words[wordnum]); -+ break; -+ case UDM_MATCH_SUBSTR: -+ sprintf(cmparg," LIKE '%%%s%%'",query->words[wordnum]); -+ break; -+ case UDM_MATCH_WORD: -+ default: -+ sprintf(cmparg,"='%s'",query->words[wordnum]); -+ break; -+ } -+ if(query->Conf->tagstr[0]||query->Conf->statusstr[0]||query->Conf->urlstr[0]||query->Conf->langstr[0]||query->Conf->catstr[0]||query->Conf->timestr[0]){ -+ sprintf(qbuf,"\ -+SELECT %s.url_id,%s.intag \ -+FROM %s,url \ - WHERE %s.word%s \ - AND url.rec_id=%s.url_id %s%s%s%s%s%s", -- tablename,tablename, -- tablename,tablename, -- cmparg,tablename, -- query->Conf->tagstr, -- query->Conf->statusstr, -- query->Conf->urlstr, -- query->Conf->langstr, -- query->Conf->timestr, -- query->Conf->catstr); -- }else{ -- sprintf(qbuf,"SELECT url_id,intag FROM %s WHERE word%s",tablename,cmparg); -- } -- } -- ((DB*)(query->db))->res=sql_query(query,qbuf); -- if(UdmDBErrorCode(query->db))return(NULL); -- numrows=SQL_NUM_ROWS(((DB*)(query->db))->res); -+ tablename,tablename, -+ tablename,tablename, -+ cmparg,tablename, -+ query->Conf->tagstr, -+ query->Conf->statusstr, -+ query->Conf->urlstr, -+ query->Conf->langstr, -+ query->Conf->timestr, -+ query->Conf->catstr); -+ }else{ -+ sprintf(qbuf,"SELECT url_id,intag FROM %s WHERE word%s",tablename,cmparg); -+ } -+ } -+ ((DB*)(query->db))->res=sql_query(query,qbuf); -+ if(UdmDBErrorCode(query->db))return(NULL); -+ numrows=SQL_NUM_ROWS(((DB*)(query->db))->res); - - #ifdef DEBUG_SEARCH -- ticks=UdmStartTimer()-ticks; -- fprintf(stderr,"Stop search for '%s'\t%.2f %d found\n",rw,(float)ticks/1000,num); -+ ticks=UdmStartTimer()-ticks; -+ fprintf(stderr,"Stop search for '%s'\t%.2f %d found\n",rw,(float)ticks/1000,num); - #endif - -- /* Add new found word to the list */ -- if(!query->total_found){ -- wrd=(UDM_SEARCHWORD*)UdmXmalloc((query->total_found+numrows)*sizeof(UDM_SEARCHWORD)); -- }else{ -- wrd=(UDM_SEARCHWORD*)UdmXrealloc(wrd,(query->total_found+numrows)*sizeof(UDM_SEARCHWORD)); -- } -- -- firstnum=curnum=query->total_found; -- for(i=0;i<numrows;i++){ -- int url_id; -- int weight; -- int fweight=0; -+ /* Add new found word to the list */ -+ if(!query->total_found){ -+ wrd=(UDM_SEARCHWORD*)UdmXmalloc((query->total_found+numrows)*sizeof(UDM_SEARCHWORD)); -+ }else{ -+ wrd=(UDM_SEARCHWORD*)UdmXrealloc(wrd,(query->total_found+numrows)*sizeof(UDM_SEARCHWORD)); -+ } -+ -+ firstnum=curnum=query->total_found; -+ for(i=0;i<numrows;i++){ -+ int url_id; -+ int weight; -+ int fweight=0; - #ifdef HAVE_MYSQL -- /* mysql_data_seek is slow */ -- /* We will use sequential fetch instead*/ -- row=mysql_fetch_row(((DB*)(query->db))->res); -- url_id=atoi(row[0]); -- weight=atoi(row[1]); -+ /* mysql_data_seek is slow */ -+ /* We will use sequential fetch instead*/ -+ row=mysql_fetch_row(((DB*)(query->db))->res); -+ url_id=atoi(row[0]); -+ weight=atoi(row[1]); - #else -- url_id=atoi(sql_value(((DB*)(query->db))->res,i,0)); -- weight=atoi(sql_value(((DB*)(query->db))->res,i,1)); -+ url_id=atoi(sql_value(((DB*)(query->db))->res,i,0)); -+ weight=atoi(sql_value(((DB*)(query->db))->res,i,1)); - #endif - -- /* Check weight factors */ -- if(query->weight_factor){ -- int f; -- for(f=0;f<8;f++)fweight+=(((weight>>f)&0x01)*query->wf[f]); -- }else{ -- fweight=weight&0xFFFF; -- } -- if(fweight){ -- wrd[curnum].url_id=url_id; -- wrd[curnum].count=1<<query->wordorders[wordnum]; -- wrd[curnum].weight=fweight; -- wrd[curnum].pos=((unsigned int)weight)>>16;; -- curnum++; -+ /* Check weight factors */ -+ if(query->weight_factor){ -+ int f; -+ for(f=0;f<8;f++)fweight+=(((weight>>f)&0x01)*query->wf[f]); -+ }else{ -+ fweight=weight&0xFFFF; -+ } -+ if(fweight){ -+ wrd[curnum].url_id=url_id; -+ wrd[curnum].count=1<<query->wordorders[wordnum]; -+ wrd[curnum].weight=fweight; -+ wrd[curnum].pos=((unsigned int)weight)>>16;; -+ curnum++; -+ } -+ } -+ SQL_FREE(((DB*)(query->db))->res); -+ wcounts[wordnum]+=curnum-firstnum; -+ query->total_found=curnum; -+ wrd=(UDM_SEARCHWORD*)UdmXrealloc(wrd,query->total_found*sizeof(UDM_SEARCHWORD)); - } -- } -- SQL_FREE(((DB*)(query->db))->res); -- if(query->wordinfo[0])strcat(query->wordinfo,", "); -- sprintf(UDM_STREND(query->wordinfo)," %s : %d",query->words[wordnum],curnum-firstnum); -- query->total_found=curnum; -- wrd=(UDM_SEARCHWORD*)UdmXrealloc(wrd,query->total_found*sizeof(UDM_SEARCHWORD)); -+ } - } - - -+ -+ - /* Now find each word in crosstable */ -- if(query->Conf->use_crossword&&query->Conf->DBMode!=UDM_DBMODE_CACHE){ -- for(wordnum=0;wordnum<query->words_in_query;wordnum++){ -+ has_crosswrd=((query->Conf->use_crossword)&&(query->Conf->DBMode!=UDM_DBMODE_CACHE)); -+ for(wordnum=0;((has_crosswrd)&&(wordnum<query->words_in_query));wordnum++){ - int numrows,firstnum,curnum,i; - char tablename[32]=""; - #ifdef DEBUG_SEARCH -@@ -3997,13 +4017,15 @@ - } - } - SQL_FREE(((DB*)(query->db))->res); -- if(query->wordinfo[0])strcat(query->wordinfo,", "); -- sprintf(UDM_STREND(query->wordinfo)," %s : %d",query->words[wordnum],curnum-firstnum); - query->total_found=curnum; -+ wcounts[wordnum]+=curnum-firstnum; - wrd=(UDM_SEARCHWORD*)UdmXrealloc(wrd,query->total_found*sizeof(UDM_SEARCHWORD)); -- }} -- -+ } - -+ for(wordnum=0;wordnum<query->words_in_query;wordnum++){ -+ if(query->wordinfo[0])strcat(query->wordinfo,", "); -+ sprintf(UDM_STREND(query->wordinfo)," %s : %d",query->words[wordnum],wcounts[wordnum]); -+ } - - if(query->total_found){ - /* Sort in URL order */ diff --git a/www/mnoGoSearch-current/pkg-plist b/www/mnoGoSearch-current/pkg-plist index 55b0cbbd7179..253b3e4c564c 100644 --- a/www/mnoGoSearch-current/pkg-plist +++ b/www/mnoGoSearch-current/pkg-plist @@ -1,5 +1,6 @@ etc/mnogosearch/indexer.conf-dist etc/mnogosearch/search.htm-dist +etc/mnogosearch/spelld.conf-dist include/udm_agent.h include/udm_alias.h include/udm_boolean.h diff --git a/www/mnogosearch/Makefile b/www/mnogosearch/Makefile index 23d2f769c822..7c1417c28010 100644 --- a/www/mnogosearch/Makefile +++ b/www/mnogosearch/Makefile @@ -6,8 +6,7 @@ # PORTNAME= mnogosearch -PORTVERSION= 3.1.11 -PORTREVISION= 2 +PORTVERSION= 3.1.12 CATEGORIES= www databases MASTER_SITES= http://search.mnogo.ru/Download/ @@ -58,9 +57,6 @@ pre-fetch: @${ECHO} .endif -post-patch: - cp ${FILESDIR}/cross*.txt ${WRKSRC}/create/msql - pre-install: @${MKDIR} ${PREFIX}/share/mnogosearch diff --git a/www/mnogosearch/distinfo b/www/mnogosearch/distinfo index 8cd87641a606..a0400a918450 100644 --- a/www/mnogosearch/distinfo +++ b/www/mnogosearch/distinfo @@ -1 +1 @@ -MD5 (mnogosearch-3.1.11.tar.gz) = ef4489ee3c9f8bcfce7a3ac4e9bd8a18 +MD5 (mnogosearch-3.1.12.tar.gz) = bd008c8f671924198e251146c8f31ab6 diff --git a/www/mnogosearch/files/cross-crc.txt b/www/mnogosearch/files/cross-crc.txt deleted file mode 100644 index b68750b0b1f9..000000000000 --- a/www/mnogosearch/files/cross-crc.txt +++ /dev/null @@ -1,12 +0,0 @@ -DROP TABLE ncrossdict\g - -CREATE TABLE ncrossdict ( - url_id int NOT NULL, - ref_id int NOT NULL, - word_id int NOT NULL, - intag int NOT NULL -)\g - -CREATE INDEX ncrossdict_url_id ON ncrossdict (url_id)\g -CREATE INDEX ncrossdict_ref_id ON ncrossdict (ref_id)\g -CREATE INDEX ncrossdict_word_id ON ncrossdict (word_id)\g diff --git a/www/mnogosearch/files/cross.txt b/www/mnogosearch/files/cross.txt deleted file mode 100644 index d8dd2048b2fe..000000000000 --- a/www/mnogosearch/files/cross.txt +++ /dev/null @@ -1,13 +0,0 @@ -DROP TABLE crossdict\g - -CREATE TABLE crossdict ( - url_id int NOT NULL, - ref_id int NOT NULL, - word char(32) NOT NULL, - intag int NOT NULL -)\g - - -CREATE INDEX crossdict_url_id ON crossdict (url_id)\g -CREATE INDEX crossdict_ref_id ON crossdict (ref_id)\g -CREATE INDEX crossdict_word ON crossdict (word)\g diff --git a/www/mnogosearch/files/patch-ac b/www/mnogosearch/files/patch-ac deleted file mode 100644 index d8ef2290a0b6..000000000000 --- a/www/mnogosearch/files/patch-ac +++ /dev/null @@ -1,11 +0,0 @@ ---- etc/search.htm-dist.bak Fri Feb 16 12:49:16 2001 -+++ etc/search.htm-dist Tue Feb 20 20:00:27 2001 -@@ -126,7 +126,7 @@ - <SELECT NAME="wm"> - <OPTION VALUE="wrd" SELECTED="$wm">Whole word - <OPTION VALUE="beg" SELECTED="$wm">Beginning --<OPTION VALUE="beg" SELECTED="$wm">Ending -+<OPTION VALUE="end" SELECTED="$wm">Ending - <OPTION VALUE="sub" SELECTED="$wm">Substring - </SELECT> - diff --git a/www/mnogosearch/files/patch-stopw b/www/mnogosearch/files/patch-stopw deleted file mode 100644 index 44469a7c24db..000000000000 --- a/www/mnogosearch/files/patch-stopw +++ /dev/null @@ -1,24 +0,0 @@ ---- src/searchtool.c.orig Fri Feb 16 19:12:22 2001 -+++ src/searchtool.c Thu Mar 1 16:22:54 2001 -@@ -251,11 +251,16 @@ - continue; - } - len=strlen(rw); -- if(UdmIsStopWord(query->Conf,rw)||(query->Conf->min_word_len>len)||(query->Conf->max_word_len<len)){ -- if(query->wordinfo[0])strcat(query->wordinfo,", "); -- sprintf(UDM_STREND(query->wordinfo)," %s :stopword",rw); -- lex=UdmGetLex(&w,&lasttok,query->charset); -- continue; -+ -+ if(query->word_match==UDM_MATCH_WORD){ -+ /* Check stopword only when full word */ -+ /* Substring searches should not exclude them */ -+ if(UdmIsStopWord(query->Conf,rw)||(query->Conf->min_word_len>len)||(query->Conf->max_word_len<len)){ -+ if(query->wordinfo[0])strcat(query->wordinfo,", "); -+ sprintf(UDM_STREND(query->wordinfo)," %s :stopword",rw); -+ lex=UdmGetLex(&w,&lasttok,query->charset); -+ continue; -+ } - } - if(query->words_in_query<UDM_MAXWORDPERQUERY-1){ - query->words[query->words_in_query]=strdup(rw); diff --git a/www/mnogosearch/files/patch-substr b/www/mnogosearch/files/patch-substr deleted file mode 100644 index b7b18781efb5..000000000000 --- a/www/mnogosearch/files/patch-substr +++ /dev/null @@ -1,315 +0,0 @@ -Index: src/sql.c -=================================================================== -RCS file: /usr/src/CVS/mnogosearch/src/sql.c,v -retrieving revision 1.25 -diff -u -r1.25 sql.c ---- src/sql.c 2001/02/26 15:58:17 1.25 -+++ src/sql.c 2001/02/27 13:51:54 -@@ -3723,6 +3723,9 @@ - char qbuf[UDMSTRSIZ]; - UDM_SEARCHWORD * wrd=NULL; - size_t wordnum; -+ int has_crosswrd=0; -+ int wcounts[UDM_MAXWORDPERQUERY]; -+ - #ifdef HAVE_MYSQL - MYSQL_ROW row; - #endif -@@ -3732,147 +3735,164 @@ - #endif - - UdmPrepare(query,text); -+ bzero(wcounts,sizeof(wcounts)); - - /* Now find each word */ - for(wordnum=0;wordnum<query->words_in_query;wordnum++){ -- int numrows,firstnum,curnum,len,i; -+ int numrows,firstnum,curnum,tnum,i,tmin,tmax,tlst=-1; - char tablename[32]="dict"; -+ -+ if((query->Conf->DBMode==UDM_DBMODE_MULTI)&&(query->word_match!=UDM_MATCH_WORD)){ -+ /* This is for substring search! */ -+ /* In Multi mode: we have to scan */ -+ /* almost all tables except those */ -+ /* with to short words */ -+ -+ tmin=DICTNUM(strlen(query->words[wordnum])); -+ tmax=MAXDICT; -+ }else{ -+ tmin=tmax=DICTNUM(strlen(query->words[wordnum])); -+ } -+ -+ for(tnum=tmin;tnum<=tmax;tnum++){ -+ -+ if(tlst!=DICTNUM(tnum)){ -+ tlst=DICTNUM(tnum); - #ifdef DEBUG_SEARCH -- ticks=UdmStartTimer(); -- fprintf(stderr,"Start search for '%s'\n",rw); -+ ticks=UdmStartTimer(); -+ fprintf(stderr,"Start search for '%s'\n",rw); - #endif -- switch(query->Conf->DBMode){ -- case UDM_DBMODE_MULTI: -- len=strlen(query->words[wordnum]);len=DICTNUM(len); -- sprintf(tablename,"dict%d",len); -- break; -- case UDM_DBMODE_MULTI_CRC: -- len=strlen(query->words[wordnum]);len=DICTNUM(len); -- sprintf(tablename,"ndict%d",len); -- break; -- case UDM_DBMODE_SINGLE_CRC: -- strcpy(tablename,"ndict"); -- break; -- default: -- break; -- } -- if((query->Conf->DBMode==UDM_DBMODE_SINGLE_CRC)|| -- (query->Conf->DBMode==UDM_DBMODE_MULTI_CRC)){ -- udmcrc32_t crc; -- crc=query->cwords[wordnum]; -- if(query->Conf->tagstr[0] || query->Conf->statusstr[0] || query->Conf->urlstr[0] || query->Conf->langstr[0] || query->Conf->timestr[0] || query->Conf->catstr[0]){ -- sprintf(qbuf,"\ --SELECT %s.url_id,%s.intag \ --FROM %s,url \ --WHERE %s.word_id=%d \ --AND url.rec_id=%s.url_id %s%s%s%s%s%s", -- tablename,tablename, -- tablename,tablename, -- crc,tablename, -- query->Conf->tagstr, -- query->Conf->statusstr, -- query->Conf->urlstr, -- query->Conf->langstr, -- query->Conf->timestr, -- query->Conf->catstr); -- }else{ -- sprintf(qbuf,"SELECT url_id,intag FROM %s WHERE word_id=%d",tablename,crc); -- } -- }else{ -- char cmparg[256]; -- switch(query->word_match){ -- case UDM_MATCH_BEGIN: -- sprintf(cmparg," LIKE '%s%%'",query->words[wordnum]); -+ switch(query->Conf->DBMode){ -+ case UDM_DBMODE_MULTI: -+ sprintf(tablename,"dict%d",DICTNUM(tnum)); - break; -- case UDM_MATCH_END: -- sprintf(cmparg," LIKE '%%%s'",query->words[wordnum]); -+ case UDM_DBMODE_MULTI_CRC: -+ sprintf(tablename,"ndict%d",DICTNUM(tnum)); - break; -- case UDM_MATCH_SUBSTR: -- sprintf(cmparg," LIKE '%%%s%%'",query->words[wordnum]); -+ case UDM_DBMODE_SINGLE_CRC: -+ strcpy(tablename,"ndict"); - break; -- case UDM_MATCH_WORD: - default: -- sprintf(cmparg,"='%s'",query->words[wordnum]); - break; -- } -- if(query->Conf->tagstr[0]||query->Conf->statusstr[0]||query->Conf->urlstr[0]||query->Conf->langstr[0]||query->Conf->catstr[0]||query->Conf->timestr[0]){ -- -- sprintf(qbuf,"\ -+ } -+ if((query->Conf->DBMode==UDM_DBMODE_SINGLE_CRC)||(query->Conf->DBMode==UDM_DBMODE_MULTI_CRC)){ -+ udmcrc32_t crc; -+ crc=query->cwords[wordnum]; -+ if(query->Conf->tagstr[0] || query->Conf->statusstr[0] || query->Conf->urlstr[0] || query->Conf->langstr[0] || query->Conf->timestr[0] || query->Conf->catstr[0]){ -+ sprintf(qbuf,"\ - SELECT %s.url_id,%s.intag \ - FROM %s,url \ -+WHERE %s.word_id=%d \ -+AND url.rec_id=%s.url_id %s%s%s%s%s%s", -+ tablename,tablename, -+ tablename,tablename, -+ crc,tablename, -+ query->Conf->tagstr, -+ query->Conf->statusstr, -+ query->Conf->urlstr, -+ query->Conf->langstr, -+ query->Conf->timestr, -+ query->Conf->catstr); -+ }else{ -+ sprintf(qbuf,"SELECT url_id,intag FROM %s WHERE word_id=%d",tablename,crc); -+ } -+ }else{ -+ char cmparg[256]; -+ switch(query->word_match){ -+ case UDM_MATCH_BEGIN: -+ sprintf(cmparg," LIKE '%s%%'",query->words[wordnum]); -+ break; -+ case UDM_MATCH_END: -+ sprintf(cmparg," LIKE '%%%s'",query->words[wordnum]); -+ break; -+ case UDM_MATCH_SUBSTR: -+ sprintf(cmparg," LIKE '%%%s%%'",query->words[wordnum]); -+ break; -+ case UDM_MATCH_WORD: -+ default: -+ sprintf(cmparg,"='%s'",query->words[wordnum]); -+ break; -+ } -+ if(query->Conf->tagstr[0]||query->Conf->statusstr[0]||query->Conf->urlstr[0]||query->Conf->langstr[0]||query->Conf->catstr[0]||query->Conf->timestr[0]){ -+ sprintf(qbuf,"\ -+SELECT %s.url_id,%s.intag \ -+FROM %s,url \ - WHERE %s.word%s \ - AND url.rec_id=%s.url_id %s%s%s%s%s%s", -- tablename,tablename, -- tablename,tablename, -- cmparg,tablename, -- query->Conf->tagstr, -- query->Conf->statusstr, -- query->Conf->urlstr, -- query->Conf->langstr, -- query->Conf->timestr, -- query->Conf->catstr); -- }else{ -- sprintf(qbuf,"SELECT url_id,intag FROM %s WHERE word%s",tablename,cmparg); -- } -- } -- ((DB*)(query->db))->res=sql_query(query,qbuf); -- if(UdmDBErrorCode(query->db))return(NULL); -- numrows=SQL_NUM_ROWS(((DB*)(query->db))->res); -+ tablename,tablename, -+ tablename,tablename, -+ cmparg,tablename, -+ query->Conf->tagstr, -+ query->Conf->statusstr, -+ query->Conf->urlstr, -+ query->Conf->langstr, -+ query->Conf->timestr, -+ query->Conf->catstr); -+ }else{ -+ sprintf(qbuf,"SELECT url_id,intag FROM %s WHERE word%s",tablename,cmparg); -+ } -+ } -+ ((DB*)(query->db))->res=sql_query(query,qbuf); -+ if(UdmDBErrorCode(query->db))return(NULL); -+ numrows=SQL_NUM_ROWS(((DB*)(query->db))->res); - - #ifdef DEBUG_SEARCH -- ticks=UdmStartTimer()-ticks; -- fprintf(stderr,"Stop search for '%s'\t%.2f %d found\n",rw,(float)ticks/1000,num); -+ ticks=UdmStartTimer()-ticks; -+ fprintf(stderr,"Stop search for '%s'\t%.2f %d found\n",rw,(float)ticks/1000,num); - #endif - -- /* Add new found word to the list */ -- if(!query->total_found){ -- wrd=(UDM_SEARCHWORD*)UdmXmalloc((query->total_found+numrows)*sizeof(UDM_SEARCHWORD)); -- }else{ -- wrd=(UDM_SEARCHWORD*)UdmXrealloc(wrd,(query->total_found+numrows)*sizeof(UDM_SEARCHWORD)); -- } -- -- firstnum=curnum=query->total_found; -- for(i=0;i<numrows;i++){ -- int url_id; -- int weight; -- int fweight=0; -+ /* Add new found word to the list */ -+ if(!query->total_found){ -+ wrd=(UDM_SEARCHWORD*)UdmXmalloc((query->total_found+numrows)*sizeof(UDM_SEARCHWORD)); -+ }else{ -+ wrd=(UDM_SEARCHWORD*)UdmXrealloc(wrd,(query->total_found+numrows)*sizeof(UDM_SEARCHWORD)); -+ } -+ -+ firstnum=curnum=query->total_found; -+ for(i=0;i<numrows;i++){ -+ int url_id; -+ int weight; -+ int fweight=0; - #ifdef HAVE_MYSQL -- /* mysql_data_seek is slow */ -- /* We will use sequential fetch instead*/ -- row=mysql_fetch_row(((DB*)(query->db))->res); -- url_id=atoi(row[0]); -- weight=atoi(row[1]); -+ /* mysql_data_seek is slow */ -+ /* We will use sequential fetch instead*/ -+ row=mysql_fetch_row(((DB*)(query->db))->res); -+ url_id=atoi(row[0]); -+ weight=atoi(row[1]); - #else -- url_id=atoi(sql_value(((DB*)(query->db))->res,i,0)); -- weight=atoi(sql_value(((DB*)(query->db))->res,i,1)); -+ url_id=atoi(sql_value(((DB*)(query->db))->res,i,0)); -+ weight=atoi(sql_value(((DB*)(query->db))->res,i,1)); - #endif - -- /* Check weight factors */ -- if(query->weight_factor){ -- int f; -- for(f=0;f<8;f++)fweight+=(((weight>>f)&0x01)*query->wf[f]); -- }else{ -- fweight=weight&0xFFFF; -- } -- if(fweight){ -- wrd[curnum].url_id=url_id; -- wrd[curnum].count=1<<query->wordorders[wordnum]; -- wrd[curnum].weight=fweight; -- wrd[curnum].pos=((unsigned int)weight)>>16;; -- curnum++; -+ /* Check weight factors */ -+ if(query->weight_factor){ -+ int f; -+ for(f=0;f<8;f++)fweight+=(((weight>>f)&0x01)*query->wf[f]); -+ }else{ -+ fweight=weight&0xFFFF; -+ } -+ if(fweight){ -+ wrd[curnum].url_id=url_id; -+ wrd[curnum].count=1<<query->wordorders[wordnum]; -+ wrd[curnum].weight=fweight; -+ wrd[curnum].pos=((unsigned int)weight)>>16;; -+ curnum++; -+ } -+ } -+ SQL_FREE(((DB*)(query->db))->res); -+ wcounts[wordnum]+=curnum-firstnum; -+ query->total_found=curnum; -+ wrd=(UDM_SEARCHWORD*)UdmXrealloc(wrd,query->total_found*sizeof(UDM_SEARCHWORD)); - } -- } -- SQL_FREE(((DB*)(query->db))->res); -- if(query->wordinfo[0])strcat(query->wordinfo,", "); -- sprintf(UDM_STREND(query->wordinfo)," %s : %d",query->words[wordnum],curnum-firstnum); -- query->total_found=curnum; -- wrd=(UDM_SEARCHWORD*)UdmXrealloc(wrd,query->total_found*sizeof(UDM_SEARCHWORD)); -+ } - } - - -+ -+ - /* Now find each word in crosstable */ -- if(query->Conf->use_crossword&&query->Conf->DBMode!=UDM_DBMODE_CACHE){ -- for(wordnum=0;wordnum<query->words_in_query;wordnum++){ -+ has_crosswrd=((query->Conf->use_crossword)&&(query->Conf->DBMode!=UDM_DBMODE_CACHE)); -+ for(wordnum=0;((has_crosswrd)&&(wordnum<query->words_in_query));wordnum++){ - int numrows,firstnum,curnum,i; - char tablename[32]=""; - #ifdef DEBUG_SEARCH -@@ -3997,13 +4017,15 @@ - } - } - SQL_FREE(((DB*)(query->db))->res); -- if(query->wordinfo[0])strcat(query->wordinfo,", "); -- sprintf(UDM_STREND(query->wordinfo)," %s : %d",query->words[wordnum],curnum-firstnum); - query->total_found=curnum; -+ wcounts[wordnum]+=curnum-firstnum; - wrd=(UDM_SEARCHWORD*)UdmXrealloc(wrd,query->total_found*sizeof(UDM_SEARCHWORD)); -- }} -- -+ } - -+ for(wordnum=0;wordnum<query->words_in_query;wordnum++){ -+ if(query->wordinfo[0])strcat(query->wordinfo,", "); -+ sprintf(UDM_STREND(query->wordinfo)," %s : %d",query->words[wordnum],wcounts[wordnum]); -+ } - - if(query->total_found){ - /* Sort in URL order */ diff --git a/www/mnogosearch/pkg-plist b/www/mnogosearch/pkg-plist index 55b0cbbd7179..253b3e4c564c 100644 --- a/www/mnogosearch/pkg-plist +++ b/www/mnogosearch/pkg-plist @@ -1,5 +1,6 @@ etc/mnogosearch/indexer.conf-dist etc/mnogosearch/search.htm-dist +etc/mnogosearch/spelld.conf-dist include/udm_agent.h include/udm_alias.h include/udm_boolean.h diff --git a/www/mnogosearch31/Makefile b/www/mnogosearch31/Makefile index 23d2f769c822..7c1417c28010 100644 --- a/www/mnogosearch31/Makefile +++ b/www/mnogosearch31/Makefile @@ -6,8 +6,7 @@ # PORTNAME= mnogosearch -PORTVERSION= 3.1.11 -PORTREVISION= 2 +PORTVERSION= 3.1.12 CATEGORIES= www databases MASTER_SITES= http://search.mnogo.ru/Download/ @@ -58,9 +57,6 @@ pre-fetch: @${ECHO} .endif -post-patch: - cp ${FILESDIR}/cross*.txt ${WRKSRC}/create/msql - pre-install: @${MKDIR} ${PREFIX}/share/mnogosearch diff --git a/www/mnogosearch31/distinfo b/www/mnogosearch31/distinfo index 8cd87641a606..a0400a918450 100644 --- a/www/mnogosearch31/distinfo +++ b/www/mnogosearch31/distinfo @@ -1 +1 @@ -MD5 (mnogosearch-3.1.11.tar.gz) = ef4489ee3c9f8bcfce7a3ac4e9bd8a18 +MD5 (mnogosearch-3.1.12.tar.gz) = bd008c8f671924198e251146c8f31ab6 diff --git a/www/mnogosearch31/files/cross-crc.txt b/www/mnogosearch31/files/cross-crc.txt deleted file mode 100644 index b68750b0b1f9..000000000000 --- a/www/mnogosearch31/files/cross-crc.txt +++ /dev/null @@ -1,12 +0,0 @@ -DROP TABLE ncrossdict\g - -CREATE TABLE ncrossdict ( - url_id int NOT NULL, - ref_id int NOT NULL, - word_id int NOT NULL, - intag int NOT NULL -)\g - -CREATE INDEX ncrossdict_url_id ON ncrossdict (url_id)\g -CREATE INDEX ncrossdict_ref_id ON ncrossdict (ref_id)\g -CREATE INDEX ncrossdict_word_id ON ncrossdict (word_id)\g diff --git a/www/mnogosearch31/files/cross.txt b/www/mnogosearch31/files/cross.txt deleted file mode 100644 index d8dd2048b2fe..000000000000 --- a/www/mnogosearch31/files/cross.txt +++ /dev/null @@ -1,13 +0,0 @@ -DROP TABLE crossdict\g - -CREATE TABLE crossdict ( - url_id int NOT NULL, - ref_id int NOT NULL, - word char(32) NOT NULL, - intag int NOT NULL -)\g - - -CREATE INDEX crossdict_url_id ON crossdict (url_id)\g -CREATE INDEX crossdict_ref_id ON crossdict (ref_id)\g -CREATE INDEX crossdict_word ON crossdict (word)\g diff --git a/www/mnogosearch31/files/patch-ac b/www/mnogosearch31/files/patch-ac deleted file mode 100644 index d8ef2290a0b6..000000000000 --- a/www/mnogosearch31/files/patch-ac +++ /dev/null @@ -1,11 +0,0 @@ ---- etc/search.htm-dist.bak Fri Feb 16 12:49:16 2001 -+++ etc/search.htm-dist Tue Feb 20 20:00:27 2001 -@@ -126,7 +126,7 @@ - <SELECT NAME="wm"> - <OPTION VALUE="wrd" SELECTED="$wm">Whole word - <OPTION VALUE="beg" SELECTED="$wm">Beginning --<OPTION VALUE="beg" SELECTED="$wm">Ending -+<OPTION VALUE="end" SELECTED="$wm">Ending - <OPTION VALUE="sub" SELECTED="$wm">Substring - </SELECT> - diff --git a/www/mnogosearch31/files/patch-stopw b/www/mnogosearch31/files/patch-stopw deleted file mode 100644 index 44469a7c24db..000000000000 --- a/www/mnogosearch31/files/patch-stopw +++ /dev/null @@ -1,24 +0,0 @@ ---- src/searchtool.c.orig Fri Feb 16 19:12:22 2001 -+++ src/searchtool.c Thu Mar 1 16:22:54 2001 -@@ -251,11 +251,16 @@ - continue; - } - len=strlen(rw); -- if(UdmIsStopWord(query->Conf,rw)||(query->Conf->min_word_len>len)||(query->Conf->max_word_len<len)){ -- if(query->wordinfo[0])strcat(query->wordinfo,", "); -- sprintf(UDM_STREND(query->wordinfo)," %s :stopword",rw); -- lex=UdmGetLex(&w,&lasttok,query->charset); -- continue; -+ -+ if(query->word_match==UDM_MATCH_WORD){ -+ /* Check stopword only when full word */ -+ /* Substring searches should not exclude them */ -+ if(UdmIsStopWord(query->Conf,rw)||(query->Conf->min_word_len>len)||(query->Conf->max_word_len<len)){ -+ if(query->wordinfo[0])strcat(query->wordinfo,", "); -+ sprintf(UDM_STREND(query->wordinfo)," %s :stopword",rw); -+ lex=UdmGetLex(&w,&lasttok,query->charset); -+ continue; -+ } - } - if(query->words_in_query<UDM_MAXWORDPERQUERY-1){ - query->words[query->words_in_query]=strdup(rw); diff --git a/www/mnogosearch31/files/patch-substr b/www/mnogosearch31/files/patch-substr deleted file mode 100644 index b7b18781efb5..000000000000 --- a/www/mnogosearch31/files/patch-substr +++ /dev/null @@ -1,315 +0,0 @@ -Index: src/sql.c -=================================================================== -RCS file: /usr/src/CVS/mnogosearch/src/sql.c,v -retrieving revision 1.25 -diff -u -r1.25 sql.c ---- src/sql.c 2001/02/26 15:58:17 1.25 -+++ src/sql.c 2001/02/27 13:51:54 -@@ -3723,6 +3723,9 @@ - char qbuf[UDMSTRSIZ]; - UDM_SEARCHWORD * wrd=NULL; - size_t wordnum; -+ int has_crosswrd=0; -+ int wcounts[UDM_MAXWORDPERQUERY]; -+ - #ifdef HAVE_MYSQL - MYSQL_ROW row; - #endif -@@ -3732,147 +3735,164 @@ - #endif - - UdmPrepare(query,text); -+ bzero(wcounts,sizeof(wcounts)); - - /* Now find each word */ - for(wordnum=0;wordnum<query->words_in_query;wordnum++){ -- int numrows,firstnum,curnum,len,i; -+ int numrows,firstnum,curnum,tnum,i,tmin,tmax,tlst=-1; - char tablename[32]="dict"; -+ -+ if((query->Conf->DBMode==UDM_DBMODE_MULTI)&&(query->word_match!=UDM_MATCH_WORD)){ -+ /* This is for substring search! */ -+ /* In Multi mode: we have to scan */ -+ /* almost all tables except those */ -+ /* with to short words */ -+ -+ tmin=DICTNUM(strlen(query->words[wordnum])); -+ tmax=MAXDICT; -+ }else{ -+ tmin=tmax=DICTNUM(strlen(query->words[wordnum])); -+ } -+ -+ for(tnum=tmin;tnum<=tmax;tnum++){ -+ -+ if(tlst!=DICTNUM(tnum)){ -+ tlst=DICTNUM(tnum); - #ifdef DEBUG_SEARCH -- ticks=UdmStartTimer(); -- fprintf(stderr,"Start search for '%s'\n",rw); -+ ticks=UdmStartTimer(); -+ fprintf(stderr,"Start search for '%s'\n",rw); - #endif -- switch(query->Conf->DBMode){ -- case UDM_DBMODE_MULTI: -- len=strlen(query->words[wordnum]);len=DICTNUM(len); -- sprintf(tablename,"dict%d",len); -- break; -- case UDM_DBMODE_MULTI_CRC: -- len=strlen(query->words[wordnum]);len=DICTNUM(len); -- sprintf(tablename,"ndict%d",len); -- break; -- case UDM_DBMODE_SINGLE_CRC: -- strcpy(tablename,"ndict"); -- break; -- default: -- break; -- } -- if((query->Conf->DBMode==UDM_DBMODE_SINGLE_CRC)|| -- (query->Conf->DBMode==UDM_DBMODE_MULTI_CRC)){ -- udmcrc32_t crc; -- crc=query->cwords[wordnum]; -- if(query->Conf->tagstr[0] || query->Conf->statusstr[0] || query->Conf->urlstr[0] || query->Conf->langstr[0] || query->Conf->timestr[0] || query->Conf->catstr[0]){ -- sprintf(qbuf,"\ --SELECT %s.url_id,%s.intag \ --FROM %s,url \ --WHERE %s.word_id=%d \ --AND url.rec_id=%s.url_id %s%s%s%s%s%s", -- tablename,tablename, -- tablename,tablename, -- crc,tablename, -- query->Conf->tagstr, -- query->Conf->statusstr, -- query->Conf->urlstr, -- query->Conf->langstr, -- query->Conf->timestr, -- query->Conf->catstr); -- }else{ -- sprintf(qbuf,"SELECT url_id,intag FROM %s WHERE word_id=%d",tablename,crc); -- } -- }else{ -- char cmparg[256]; -- switch(query->word_match){ -- case UDM_MATCH_BEGIN: -- sprintf(cmparg," LIKE '%s%%'",query->words[wordnum]); -+ switch(query->Conf->DBMode){ -+ case UDM_DBMODE_MULTI: -+ sprintf(tablename,"dict%d",DICTNUM(tnum)); - break; -- case UDM_MATCH_END: -- sprintf(cmparg," LIKE '%%%s'",query->words[wordnum]); -+ case UDM_DBMODE_MULTI_CRC: -+ sprintf(tablename,"ndict%d",DICTNUM(tnum)); - break; -- case UDM_MATCH_SUBSTR: -- sprintf(cmparg," LIKE '%%%s%%'",query->words[wordnum]); -+ case UDM_DBMODE_SINGLE_CRC: -+ strcpy(tablename,"ndict"); - break; -- case UDM_MATCH_WORD: - default: -- sprintf(cmparg,"='%s'",query->words[wordnum]); - break; -- } -- if(query->Conf->tagstr[0]||query->Conf->statusstr[0]||query->Conf->urlstr[0]||query->Conf->langstr[0]||query->Conf->catstr[0]||query->Conf->timestr[0]){ -- -- sprintf(qbuf,"\ -+ } -+ if((query->Conf->DBMode==UDM_DBMODE_SINGLE_CRC)||(query->Conf->DBMode==UDM_DBMODE_MULTI_CRC)){ -+ udmcrc32_t crc; -+ crc=query->cwords[wordnum]; -+ if(query->Conf->tagstr[0] || query->Conf->statusstr[0] || query->Conf->urlstr[0] || query->Conf->langstr[0] || query->Conf->timestr[0] || query->Conf->catstr[0]){ -+ sprintf(qbuf,"\ - SELECT %s.url_id,%s.intag \ - FROM %s,url \ -+WHERE %s.word_id=%d \ -+AND url.rec_id=%s.url_id %s%s%s%s%s%s", -+ tablename,tablename, -+ tablename,tablename, -+ crc,tablename, -+ query->Conf->tagstr, -+ query->Conf->statusstr, -+ query->Conf->urlstr, -+ query->Conf->langstr, -+ query->Conf->timestr, -+ query->Conf->catstr); -+ }else{ -+ sprintf(qbuf,"SELECT url_id,intag FROM %s WHERE word_id=%d",tablename,crc); -+ } -+ }else{ -+ char cmparg[256]; -+ switch(query->word_match){ -+ case UDM_MATCH_BEGIN: -+ sprintf(cmparg," LIKE '%s%%'",query->words[wordnum]); -+ break; -+ case UDM_MATCH_END: -+ sprintf(cmparg," LIKE '%%%s'",query->words[wordnum]); -+ break; -+ case UDM_MATCH_SUBSTR: -+ sprintf(cmparg," LIKE '%%%s%%'",query->words[wordnum]); -+ break; -+ case UDM_MATCH_WORD: -+ default: -+ sprintf(cmparg,"='%s'",query->words[wordnum]); -+ break; -+ } -+ if(query->Conf->tagstr[0]||query->Conf->statusstr[0]||query->Conf->urlstr[0]||query->Conf->langstr[0]||query->Conf->catstr[0]||query->Conf->timestr[0]){ -+ sprintf(qbuf,"\ -+SELECT %s.url_id,%s.intag \ -+FROM %s,url \ - WHERE %s.word%s \ - AND url.rec_id=%s.url_id %s%s%s%s%s%s", -- tablename,tablename, -- tablename,tablename, -- cmparg,tablename, -- query->Conf->tagstr, -- query->Conf->statusstr, -- query->Conf->urlstr, -- query->Conf->langstr, -- query->Conf->timestr, -- query->Conf->catstr); -- }else{ -- sprintf(qbuf,"SELECT url_id,intag FROM %s WHERE word%s",tablename,cmparg); -- } -- } -- ((DB*)(query->db))->res=sql_query(query,qbuf); -- if(UdmDBErrorCode(query->db))return(NULL); -- numrows=SQL_NUM_ROWS(((DB*)(query->db))->res); -+ tablename,tablename, -+ tablename,tablename, -+ cmparg,tablename, -+ query->Conf->tagstr, -+ query->Conf->statusstr, -+ query->Conf->urlstr, -+ query->Conf->langstr, -+ query->Conf->timestr, -+ query->Conf->catstr); -+ }else{ -+ sprintf(qbuf,"SELECT url_id,intag FROM %s WHERE word%s",tablename,cmparg); -+ } -+ } -+ ((DB*)(query->db))->res=sql_query(query,qbuf); -+ if(UdmDBErrorCode(query->db))return(NULL); -+ numrows=SQL_NUM_ROWS(((DB*)(query->db))->res); - - #ifdef DEBUG_SEARCH -- ticks=UdmStartTimer()-ticks; -- fprintf(stderr,"Stop search for '%s'\t%.2f %d found\n",rw,(float)ticks/1000,num); -+ ticks=UdmStartTimer()-ticks; -+ fprintf(stderr,"Stop search for '%s'\t%.2f %d found\n",rw,(float)ticks/1000,num); - #endif - -- /* Add new found word to the list */ -- if(!query->total_found){ -- wrd=(UDM_SEARCHWORD*)UdmXmalloc((query->total_found+numrows)*sizeof(UDM_SEARCHWORD)); -- }else{ -- wrd=(UDM_SEARCHWORD*)UdmXrealloc(wrd,(query->total_found+numrows)*sizeof(UDM_SEARCHWORD)); -- } -- -- firstnum=curnum=query->total_found; -- for(i=0;i<numrows;i++){ -- int url_id; -- int weight; -- int fweight=0; -+ /* Add new found word to the list */ -+ if(!query->total_found){ -+ wrd=(UDM_SEARCHWORD*)UdmXmalloc((query->total_found+numrows)*sizeof(UDM_SEARCHWORD)); -+ }else{ -+ wrd=(UDM_SEARCHWORD*)UdmXrealloc(wrd,(query->total_found+numrows)*sizeof(UDM_SEARCHWORD)); -+ } -+ -+ firstnum=curnum=query->total_found; -+ for(i=0;i<numrows;i++){ -+ int url_id; -+ int weight; -+ int fweight=0; - #ifdef HAVE_MYSQL -- /* mysql_data_seek is slow */ -- /* We will use sequential fetch instead*/ -- row=mysql_fetch_row(((DB*)(query->db))->res); -- url_id=atoi(row[0]); -- weight=atoi(row[1]); -+ /* mysql_data_seek is slow */ -+ /* We will use sequential fetch instead*/ -+ row=mysql_fetch_row(((DB*)(query->db))->res); -+ url_id=atoi(row[0]); -+ weight=atoi(row[1]); - #else -- url_id=atoi(sql_value(((DB*)(query->db))->res,i,0)); -- weight=atoi(sql_value(((DB*)(query->db))->res,i,1)); -+ url_id=atoi(sql_value(((DB*)(query->db))->res,i,0)); -+ weight=atoi(sql_value(((DB*)(query->db))->res,i,1)); - #endif - -- /* Check weight factors */ -- if(query->weight_factor){ -- int f; -- for(f=0;f<8;f++)fweight+=(((weight>>f)&0x01)*query->wf[f]); -- }else{ -- fweight=weight&0xFFFF; -- } -- if(fweight){ -- wrd[curnum].url_id=url_id; -- wrd[curnum].count=1<<query->wordorders[wordnum]; -- wrd[curnum].weight=fweight; -- wrd[curnum].pos=((unsigned int)weight)>>16;; -- curnum++; -+ /* Check weight factors */ -+ if(query->weight_factor){ -+ int f; -+ for(f=0;f<8;f++)fweight+=(((weight>>f)&0x01)*query->wf[f]); -+ }else{ -+ fweight=weight&0xFFFF; -+ } -+ if(fweight){ -+ wrd[curnum].url_id=url_id; -+ wrd[curnum].count=1<<query->wordorders[wordnum]; -+ wrd[curnum].weight=fweight; -+ wrd[curnum].pos=((unsigned int)weight)>>16;; -+ curnum++; -+ } -+ } -+ SQL_FREE(((DB*)(query->db))->res); -+ wcounts[wordnum]+=curnum-firstnum; -+ query->total_found=curnum; -+ wrd=(UDM_SEARCHWORD*)UdmXrealloc(wrd,query->total_found*sizeof(UDM_SEARCHWORD)); - } -- } -- SQL_FREE(((DB*)(query->db))->res); -- if(query->wordinfo[0])strcat(query->wordinfo,", "); -- sprintf(UDM_STREND(query->wordinfo)," %s : %d",query->words[wordnum],curnum-firstnum); -- query->total_found=curnum; -- wrd=(UDM_SEARCHWORD*)UdmXrealloc(wrd,query->total_found*sizeof(UDM_SEARCHWORD)); -+ } - } - - -+ -+ - /* Now find each word in crosstable */ -- if(query->Conf->use_crossword&&query->Conf->DBMode!=UDM_DBMODE_CACHE){ -- for(wordnum=0;wordnum<query->words_in_query;wordnum++){ -+ has_crosswrd=((query->Conf->use_crossword)&&(query->Conf->DBMode!=UDM_DBMODE_CACHE)); -+ for(wordnum=0;((has_crosswrd)&&(wordnum<query->words_in_query));wordnum++){ - int numrows,firstnum,curnum,i; - char tablename[32]=""; - #ifdef DEBUG_SEARCH -@@ -3997,13 +4017,15 @@ - } - } - SQL_FREE(((DB*)(query->db))->res); -- if(query->wordinfo[0])strcat(query->wordinfo,", "); -- sprintf(UDM_STREND(query->wordinfo)," %s : %d",query->words[wordnum],curnum-firstnum); - query->total_found=curnum; -+ wcounts[wordnum]+=curnum-firstnum; - wrd=(UDM_SEARCHWORD*)UdmXrealloc(wrd,query->total_found*sizeof(UDM_SEARCHWORD)); -- }} -- -+ } - -+ for(wordnum=0;wordnum<query->words_in_query;wordnum++){ -+ if(query->wordinfo[0])strcat(query->wordinfo,", "); -+ sprintf(UDM_STREND(query->wordinfo)," %s : %d",query->words[wordnum],wcounts[wordnum]); -+ } - - if(query->total_found){ - /* Sort in URL order */ diff --git a/www/mnogosearch31/pkg-plist b/www/mnogosearch31/pkg-plist index 55b0cbbd7179..253b3e4c564c 100644 --- a/www/mnogosearch31/pkg-plist +++ b/www/mnogosearch31/pkg-plist @@ -1,5 +1,6 @@ etc/mnogosearch/indexer.conf-dist etc/mnogosearch/search.htm-dist +etc/mnogosearch/spelld.conf-dist include/udm_agent.h include/udm_alias.h include/udm_boolean.h |