]> granicus.if.org Git - php/commitdiff
- Udm_Make_Excerpt has been fixed to be compatible with mnogosearch-3.2.10+
authorSergey Kartashoff <gluke@php.net>
Sun, 13 Apr 2003 17:52:25 +0000 (17:52 +0000)
committerSergey Kartashoff <gluke@php.net>
Sun, 13 Apr 2003 17:52:25 +0000 (17:52 +0000)
ext/mnogosearch/php_mnogo.c

index a508b4a4bebd35efcdca3cc79f0c09654e568d3a..1080d40594580615cfe93b10312753935d19da8c 100644 (file)
@@ -1655,11 +1655,13 @@ DLEXPORT PHP_FUNCTION(udm_make_excerpt)
                
                Excerpt = UdmExcerptDoc(Agent, Res, &(Res->Doc[row]), 256);
                
-               if (Excerpt != NULL) {
+               if ((Excerpt != NULL) && (strlen(Excerpt) > 6)) {
                        char *HlExcerpt = UdmHlConvert(&Res->WWList, Excerpt, Agent->Conf->lcs, Agent->Conf->bcs);
-                       UdmVarListReplaceInt(&(Res->Doc[row].Sections),"ST",1);
                        UdmVarListReplaceStr(&(Res->Doc[row].Sections),"Body",HlExcerpt);
                        UDM_FREE(HlExcerpt);
+               }
+               if (Excerpt != NULL && (UdmVarListFindStr(&(Res->Doc[row].Sections), "Z", NULL) == NULL)) {
+                       UdmVarListReplaceInt(&(Res->Doc[row].Sections),"ST",1);
                        UDM_FREE(Excerpt);
                } else {
                        UdmVarListReplaceInt(&(Res->Doc[row].Sections),"ST",0);
@@ -2034,7 +2036,6 @@ DLEXPORT PHP_FUNCTION(udm_get_res_param)
                            {   
                                size_t wsize=(1+len*15)*sizeof(char);
                                char *wordinfo = (char*) malloc(wsize);
-                               int corder = -1, ccount = 0;
          
                                *wordinfo = '\0';