[ka-Map-users] search problem with postgis

Lorenzo Becchi lorenzo at ominiverdi.com
Tue Nov 28 12:25:09 EST 2006


thank you Lucian

I've applied the patch you suggest here below on the CVS.
can somebody with an active postgis connection try it please?

ciao
Lorenzo



On 28/nov/06, at 17:07, Lucian Bancescu wrote:

> I stepped into this problem too, and it appears that it's a problem  
> with mapserver processing escape chars. Although it's a known bug  
> and although the guys from mapserver are claiming that they  
> committed the changes into the cvs it seems that
> somewhere in queryByAttributes, $searchstring gets screwed. So the  
> hack is to double escape the searchstring (this in case you really  
> want to recompile mapserver... and you don't ;)
> Insert this code after line 142
>
>     //PRINTING STUFF
>
>     if($oLayer->connectiontype == MS_POSTGIS){
>
>         $searchstring = "\"".$szSearchfield."~* '". 
> $searchstring."'\"";
>
>     }else{
>
>         $searchstring = "/" . $searchstring . "/i";//case insensitive
>
>     }
>
> Hope it helps
>
>
> Lorenzo Becchi wrote:
>> Hi Parwaiz,
>>
>>>
>>>  How search system in ka-map works with PostGIS? I tried but  
>>> failed to get
>>> any result. With shapefile it is working fine.
>>
>> Only shapefile part has been properly developed. The PG connection  
>> should be adjusted.
>> At the moment I've never needed a search system to PG passing from  
>> Mapserver. But it could be useful.
>>
>> on
>> tools/search/kaSearch.php
>> there's no implementation to catch the PostgreSQL connection.
>> On old code of Paul (xsearch,php) you can find:
>> -------------------------------------------------------------------
>> if($oLayer->connectiontype == MS_POSTGIS){
>>
>>      $searchstring = $szSearchfield . ' ~* \'' .  
>> $searchstring .'\'  ';
>>
>> } else {  // Shapefile
>> ...
>> }
>> -------------------------------------------------------------------
>>
>> If you have time to test and debug your contribution will be  
>> appreciated.
>>
>> thanks
>> Lorenzo
>>
>>
>>
>>
>>
>>>
>>> can anybody send advice or help me on this subject
>>>
>>>
>>> parwaiz
>>>
>>> Do you Yahoo!?
>>> Get on board. You're invited to try the new Yahoo! Mail.
>>> _______________________________________________
>>> ka-Map-users mailing list
>>> ka-Map-users at lists.maptools.org
>>> http://lists.maptools.org/mailman/listinfo/ka-map-users
>>
>>
>> _______________________________________________
>> ka-Map-users mailing list
>> ka-Map-users at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/ka-map-users
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ka-map-users/attachments/20061128/8e5c8beb/attachment.html


More information about the ka-Map-users mailing list