Search int values

76 views
Skip to first unread message
Assigned to lorenzo...@geosolutionsgroup.com by me

Bruno Neves

unread,
Oct 29, 2020, 3:44:39 PM10/29/20
to mapstore-users
Hello everyone, I am looking to do a search for interos numbers from a table published on the Geoserver via WMS, configured in the search service. But when I search for a small number it doesn't appear in the results, as I believe the comparison is being made by the LIKE operator. Could someone help me?  

Lorenzo Natali

unread,
Jan 7, 2021, 4:26:55 AM1/7/21
to mapstor...@googlegroups.com
Hi,
Yes you are right, the current WFS search services support only text fields for search, because it is intended to emulate a geocoding service via WFS. 

Il giorno gio 29 ott 2020 alle ore 20:44 Bruno Neves <brunoberna...@gmail.com> ha scritto:
Hello everyone, I am looking to do a search for interos numbers from a table published on the Geoserver via WMS, configured in the search service. But when I search for a small number it doesn't appear in the results, as I believe the comparison is being made by the LIKE operator. Could someone help me?  

--
You received this message because you are subscribed to the Google Groups "mapstore-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstore-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapstore-users/a641ae07-3951-49c2-8984-74d44a9e3613n%40googlegroups.com.


--

Regards,

Lorenzo Natali

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information.
==

Dott. Ing. Lorenzo Natali
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:      +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------


Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Simon Nitz

unread,
Jan 7, 2021, 8:29:28 PM1/7/21
to mapstore-users
I use a string to lower case function on my integer fields like so...

strToLowerCase("prop_no")

That seems to do the trick as the resulting cql_filter ends up being...

strToLowerCase("prop_no") ILIKE '%33772%'


Hope that helps

Simon

Bruno Neves

unread,
Aug 17, 2021, 2:56:07 PM8/17/21
to mapstore-users
Hi guys, on this subject of "integer" type field searches, is there any way to apply this type of search in the mapstore search service?

Lorenzo Natali

unread,
Aug 30, 2021, 9:16:26 AM8/30/21
to mapstore-users
I can suggest to create a dedicated layer on the server (maybe implemented with an sql view, or similar) that provides the number also as text. 
This can allow you to search on the integer value. In fact, typically typing 123 you may want to find 1234 or 123, and this can is a typical operation to do on text, not on numbers. So text may be useful in several use cases.

Instead if you want to create a more specific search service, you need to implement your own. 

Bruno Neves

unread,
Aug 30, 2021, 11:12:42 AM8/30/21
to mapstore-users
hello lorenzo,
Many thanks for the reply!
I can implement the search for integer values ​​correctly, the problem is that I have a lot of records in this layer, so in the case of a search for "123", it returns 123456, 1234567, 12345, 1234 and ends up not returning the value "123" that I searched , would have a way to sort by ascending or descending the results preview?

Lorenzo Natali

unread,
Sep 1, 2021, 9:06:08 AM9/1/21
to mapstor...@googlegroups.com
Hi,
you can decide what attribute(s) to use to sort by the results, not if ascending or descending.
image.png

You received this message because you are subscribed to a topic in the Google Groups "mapstore-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mapstore-users/MVrfEjA7Xgo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mapstore-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapstore-users/3c3cd9ca-c3dd-43dd-a17c-2d6600450e0dn%40googlegroups.com.

Bruno Neves

unread,
Dec 20, 2022, 7:18:03 AM12/20/22
to mapstore-users
Hello guys,

I'm still having problems related to this search for integers. Has anything changed since then?
Reply all
Reply to author
Forward
0 new messages