That is so obviously not going to work ... about six or seven lines past
the 'UdmGetToken()' call, there is an 'if' that sets query_words, which
has to be passed to the LoadTemplate when that while() loop is finished :(

Something I'd like to recommend is to take sql.c and split it off into
db_mysql.c, db_pgsql.c, db_oracle.c, etc ... so that each of us on our
different platforms can spend time to optimzie for that platform ... I'm
loath to do this right now cause if I do, I'm bound to screw up something
that another platform is dependant on ;(

On Mon, 13 Nov 2000, Alexander Barkov wrote:

> The Hermit Hacker wrote:
> > 
> > On Sat, 11 Nov 2000, Alexander Barkov wrote:
> > 
> > > The Hermit Hacker wrote:
> > > >
> > > > okay, can someone make the following changes to the source code, so that
> > > > the search avoids using the index ... this will at least give a temporary
> > > > fix until our LIKE optimizer is fixed:
> > > >
> > > > SELECT ndict.url_id,ndict.intag
> > > >   FROM ndict,url
> > > >  WHERE ndict.word_id=1971739852
> > > >    AND url.rec_id=ndict.url_id
> > > >    AND ( (url.url || ' ') LIKE 'http://www.postgresql.org/% ');
> > >
> > >
> > > I don't think that this is the best solution to fix search for buggy
> > > LIKE optimizer then to fix search back for fixed optimizer.
> > 
> > After sending this out, it looks like there might be a bug in udmsearch
> > itself, as I went through the code itself, in 3.1.7, and it is technically
> > coded to do this, but it isn't sql.c:1894:
> > 
> >         if(c->DBType==UDM_DB_PGSQL)
> >                 sprintf(UDM_STREND(c->urlstr),"(url.url || '') LIKE '%s')",URL);
> >         else
> >                 sprintf(UDM_STREND(c->urlstr),"url.url LIKE '%s')",URL);
> >         return(0);
> > 
> > Any idea why this isn't, in fact, working?
> 
> 
> I found  that the bug is in search.c
> 
> Template is loaded after QUERY_STRING parsing. So, when URL limit are
> added,
> DBType is not known yet. You may just  move this:
> 
>         if(LoadTemplate(Indexer,template,query_words,0)){  
>                 printf("<html><body>Can't open template file
> '%s'!</body></html>
>                
> return(0);                                                      
>         }
> 
> before these lines:
> 
>         /* Parse Query String */                                   
>        
> token=UdmGetToken(query_string,"&",&lasttok);                        
>         while(token){
> 
> 
> 
> 
> It should work OK, but I'm not sure. Maybe something in LoadTemplate()
> requires
> QUERY_STRING to be already parsed.
> 
> 

Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
Systems Administrator @ hub.org 
primary: [EMAIL PROTECTED]           secondary: scrappy@{freebsd|postgresql}.org 

______________
If you want to unsubscribe send "unsubscribe udmsearch"
to [EMAIL PROTECTED]

Reply via email to