Quantcast

[pmapper-users] QueryEditor - query replace not working

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[pmapper-users] QueryEditor - query replace not working

Pedro Venâncio
Hi,

I found something strange in QueryEditor plugin. By doing a search like this

[nome_1] ILIKE '%pedro%'
OR
[nome_2] ILIKE '%campos%'

it does not give the expected result of the second clause. It seems to me that there may be a bug.

The query POST is (firebug):

&operation=query&layername=tipo&layerType=shape&query=[nome_1] ILIKE '%25pedro%' OR [nome_2] ILIKE '%campos%'

and the pm_debug.log:

[09-Jul-2014 23:17:25] P.MAPPER debug info
Parameters for REQUEST array
file: query.php->q_execAttributeQuery

 Array
(
    [operation] => query
    [layername] => tipo
    [layerType] => postgis
    [query] => [nome_1] ILIKE '%pedro%'
OR
[nome_2] ILIKE 'Êmpos%'
    [externalSearchDefinition] => 1
    [mode] => search
    [layerName] => tipo
    [firstFld] => nome_1
    [qStr] =>  nome_1 ~* 'pedro' OR  nome_2 ~* '^Êmpos'
)

[09-Jul-2014 23:17:25] P.MAPPER debug info
P.MAPPER-DEBUG: squery.php/dumpPGQueryResults() - SQL Cmd:
 SELECT id,
                         ST_xmin(box3d(the_geom)),
                         ST_ymin(box3d(the_geom)),
                         ST_xmax(box3d(the_geom)),
                         ST_ymax(box3d(the_geom)),
                         id,tipo,nome_1,nome_2,nome_3,comprada,observ
                    FROM edificios.casas
                   WHERE  nome_1 ~* 'pedro' OR  nome_2 ~* '^Êmpos'
                   LIMIT 301


That is, it replaces "%campos%" by "Êmpos%". In fact, it replaces the "%ca" by "Ê" and "%ce" by "Î". And this is because this line on queryeditor.js

query = query.replace('%','%25');

apparently only works for the first "%" of the first clause of WHERE. In the second clause, it does not replace the "%" by "%25", which will not prevent "%ca" to be replaced by "Ê".


Anyone confirms?


Thank you very much.


Best regards,
Pedro

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pmapper-users] QueryEditor - query replace not working

Thomas
hi,

Try with this line please: query = query.replace(/%/g,'%25');

If it is OK for you I will correct it in pmapper.

Thomas

Le 10/07/2014 01:11, Pedro Venâncio a écrit :

> Hi,
>
> I found something strange in QueryEditor plugin. By doing a search like this
>
> [nome_1] ILIKE '%pedro%'
> OR
> [nome_2] ILIKE '%campos%'
>
> it does not give the expected result of the second clause. It seems to me that there may be a bug.
>
> The query POST is (firebug):
>
> &operation=query&layername=tipo&layerType=shape&query=[nome_1] ILIKE '%25pedro%' OR [nome_2] ILIKE '%campos%'
>
> and the pm_debug.log:
>
> [09-Jul-2014 23:17:25] P.MAPPER debug info
> Parameters for REQUEST array
> file: query.php->q_execAttributeQuery
>
>   Array
> (
>      [operation] => query
>      [layername] => tipo
>      [layerType] => postgis
>      [query] => [nome_1] ILIKE '%pedro%'
> OR
> [nome_2] ILIKE 'Êmpos%'
>      [externalSearchDefinition] => 1
>      [mode] => search
>      [layerName] => tipo
>      [firstFld] => nome_1
>      [qStr] =>  nome_1 ~* 'pedro' OR  nome_2 ~* '^Êmpos'
> )
>
> [09-Jul-2014 23:17:25] P.MAPPER debug info
> P.MAPPER-DEBUG: squery.php/dumpPGQueryResults() - SQL Cmd:
>   SELECT id,
>                           ST_xmin(box3d(the_geom)),
>                           ST_ymin(box3d(the_geom)),
>                           ST_xmax(box3d(the_geom)),
>                           ST_ymax(box3d(the_geom)),
>                           id,tipo,nome_1,nome_2,nome_3,comprada,observ
>                      FROM edificios.casas
>                     WHERE  nome_1 ~* 'pedro' OR  nome_2 ~* '^Êmpos'
>                     LIMIT 301
>
>
> That is, it replaces "%campos%" by "Êmpos%". In fact, it replaces the "%ca" by "Ê" and "%ce" by "Î". And this is because this line on queryeditor.js
>
> query = query.replace('%','%25');
>
> apparently only works for the first "%" of the first clause of WHERE. In the second clause, it does not replace the "%" by "%25", which will not prevent "%ca" to be replaced by "Ê".
>
>
> Anyone confirms?
>
>
> Thank you very much.
>
>
> Best regards,
> Pedro
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________
> pmapper-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>
>

--


Thomas RAFFIN
Chef de Projet Internet
[hidden email] <mailto:[hidden email]> Sirap <http://sirap.fr> Tel
: 04 75 72 84 10
Fax : 04 75 70 07 98
Rue Paul Louis Héroult - BP 253
26106 Romans cedex

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pmapper-users] QueryEditor - query replace not working

Pedro Venâncio
Hi Thomas,

Yes, it solves the problem!


I think you can correct it in the code.

Just one more question, do you see any way to become a search "accent insensitive"? Something like "ilike" for case insensitive?


Thank you very much!

Best regards,
Pedro





----- Mensagem original -----
> DE: Thomas RAFFIN
>
> hi,
>
> Try with this line please: query = query.replace(/%/g,'%25');
>
> If it is OK for you I will correct it in pmapper.
>
> Thomas


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pmapper-users] QueryEditor - query replace not working

Thomas
I will commit the insensitive search too (I thought it was already done)...

Le 10/07/2014 12:12, Pedro Venâncio a écrit :

> Hi Thomas,
>
> Yes, it solves the problem!
>
>
> I think you can correct it in the code.
>
> Just one more question, do you see any way to become a search "accent insensitive"? Something like "ilike" for case insensitive?
>
>
> Thank you very much!
>
> Best regards,
> Pedro
>
>
>
>
>
> ----- Mensagem original -----
>> DE: Thomas RAFFIN
>>
>> hi,
>>
>> Try with this line please: query = query.replace(/%/g,'%25');
>>
>> If it is OK for you I will correct it in pmapper.
>>
>> Thomas
>
>

--


Thomas RAFFIN
Chef de Projet Internet
[hidden email] <mailto:[hidden email]> Sirap <http://sirap.fr> Tel
: 04 75 72 84 10
Fax : 04 75 70 07 98
Rue Paul Louis Héroult - BP 253
26106 Romans cedex

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pmapper-users] QueryEditor - query replace not working

Pedro Venâncio
Hi Thomas,

The "case insensitive" is already implemented, but not the "accent insensitive". That is, a search with "abílio" is different of "abilio", and it would be great if they could be considered equals.


Thanks Thomas!

Best regards,
Pedro






----- Mensagem original -----

> DE: Thomas RAFFIN
>
> I will commit the insensitive search too (I thought it was already done)...
>
> Le 10/07/2014 12:12, Pedro Venâncio a écrit :
>>  Hi Thomas,
>>
>>  Yes, it solves the problem!
>>
>>
>>  I think you can correct it in the code.
>>
>>  Just one more question, do you see any way to become a search "accent
> insensitive"? Something like "ilike" for case insensitive?
>>
>>
>>  Thank you very much!
>>
>>  Best regards,
>>  Pedro
>>
>>
>>
>>
>>
>>  ----- Mensagem original -----
>>>  DE: Thomas RAFFIN
>>>
>>>  hi,
>>>
>>>  Try with this line please: query = query.replace(/%/g,'%25');
>>>
>>>  If it is OK for you I will correct it in pmapper.
>
>>>
>>>  Thomas

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pmapper-users] QueryEditor - query replace not working

Thomas
Concerning "accent insensitive search", I don't know how to do this.

I've just commited the correction, and added the date type. It requires
the new directory: plugins/common/jquery.ui

bye

Thomas

Le 10/07/2014 12:39, Pedro Venâncio a écrit :

> Hi Thomas,
>
> The "case insensitive" is already implemented, but not the "accent insensitive". That is, a search with "abílio" is different of "abilio", and it would be great if they could be considered equals.
>
>
> Thanks Thomas!
>
> Best regards,
> Pedro
>
>
>
>
>
>
> ----- Mensagem original -----
>> DE: Thomas RAFFIN
>>
>> I will commit the insensitive search too (I thought it was already done)...
>>
>> Le 10/07/2014 12:12, Pedro Venâncio a écrit :
>>>   Hi Thomas,
>>>
>>>   Yes, it solves the problem!
>>>
>>>
>>>   I think you can correct it in the code.
>>>
>>>   Just one more question, do you see any way to become a search "accent
>> insensitive"? Something like "ilike" for case insensitive?
>>>
>>>   Thank you very much!
>>>
>>>   Best regards,
>>>   Pedro
>>>
>>>
>>>
>>>
>>>
>>>   ----- Mensagem original -----
>>>>   DE: Thomas RAFFIN
>>>>
>>>>   hi,
>>>>
>>>>   Try with this line please: query = query.replace(/%/g,'%25');
>>>>
>>>>   If it is OK for you I will correct it in pmapper.
>>>>   Thomas
>

--


Thomas RAFFIN
Chef de Projet Internet
[hidden email] <mailto:[hidden email]> Sirap <http://sirap.fr> Tel
: 04 75 72 84 10
Fax : 04 75 70 07 98
Rue Paul Louis Héroult - BP 253
26106 Romans cedex

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pmapper-users] QueryEditor - query replace not working

Pedro Venâncio
Thank you very much Thomas!



Best regards,
Pedro




> DE: Thomas RAFFIN
>
>Concerning "accent insensitive search", I don't know how to do this.
>
>I've just commited the correction, and added the date type. It
    requires the new directory: plugins/common/jquery.ui
>
>bye
>
>Thomas


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pmapper-users] QueryEditor - query replace not working

Thomas
And there was a bug with parenthesis and "AND", "OR" buttons.

Le 11/07/2014 00:33, Pedro Venâncio a écrit :

> Thank you very much Thomas!
>
>
>
> Best regards,
> Pedro
>
>
>
>
>> DE: Thomas RAFFIN
>>
>> Concerning "accent insensitive search", I don't know how to do this.
>>
>> I've just commited the correction, and added the date type. It
>      requires the new directory: plugins/common/jquery.ui
>> bye
>>
>> Thomas
>
>

--


Thomas RAFFIN
Chef de Projet Internet
[hidden email] <mailto:[hidden email]> Sirap <http://sirap.fr> Tel
: 04 75 72 84 10
Fax : 04 75 70 07 98
Rue Paul Louis Héroult - BP 253
26106 Romans cedex

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Loading...