lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Klaas <mike.kl...@gmail.com>
Subject Re: Deleting from index via web
Date Thu, 12 Jul 2007 19:09:23 GMT
On 12-Jul-07, at 6:33 AM, vanderkerkoff wrote:

>
> I/my boss and me worked it out.
>
> The delete funtion in solr.py looks like this
> def delete(self, id):
>     xstr = '<delete><id>'+self.escapeVal(`id`)+'</id></delete>'
>     return self.doUpdateXML(xstr)
>
> As we're not passing an integer it get's all c*nty booby, technical  
> term.
>
> So if I rewrite the delete to be like this
>
>   def delete(self, id):
>     xstr = '<delete><id>'+ id + '</id></delete>'
>     print xstr
>     return self.doUpdateXML(xstr)
>
> It works fine.
>
> There's no need for escapeVal, as I know the words I'll be sending  
> prior to
> the ID, in fact, I'm not sure why escapeVal is in there at all if  
> you can't
> send it non integer values.
>
> Maybe someone can enlighten us.

I would suggest replacing it with

self.escapeVal(unicode(id))

backticks are equivalent to repr(), which does the wrong thing for  
strings.

-Mike

Mime
View raw message