[GeoMoose-users] exact search

flavio rigolon flavio.rigolon at gmail.com
Wed Nov 30 01:26:36 PST 2022


Hi all,
 I' ve tried to edit the app.js file and setting the comparitor value
to 'eq-str' (my data fields in PostGIS are varchar type):

--------------------------------------------------------------------------
    app.registerService('search-particella', SearchService, {

        fields: [
            {type: 'text', label: 'Foglio', name: 'foglio_id'},
            {type: 'text', label: 'Mappale', name: 'mappale'}
        ],
prepareFields: function (fields) {
    // reformat the fields for the query engine,
    //  "*stuff*" will do a case-ignored "contains" query.
    var query = ['and'];
    for(var i = 0, ii = fields.length; i < ii; i++) {
        if(fields[i].value !== '' && fields[i].value !== undefined) {
            query.push({
                comparitor: 'eq-str',
                name: fields[i].name,
                value: fields[i].value
            });
        }
    }
    return [query];
},
searchLayers: ['particella-wfs/particella_patrimonio']
    });
--------------------------------------------------------------------------

but it doesn't work: in Geomoose the rounded arrows keep turning
without any resuts.
If I set compartor: 'eq' the system rightly says that my fields are not integer.
If I set compartor: 'ilike' all is working fine but I rightly obtain
all the features containing the terms I inserted in the search fields.

Am I using the right operator or am I missing something important?
Thanks in advance for any help

flavio

Il giorno lun 28 nov 2022 alle ore 14:20 flavio rigolon
<flavio.rigolon at gmail.com> ha scritto:
>
> Hi all,
>  I'm using Geomoose 3.6.2. I'd like to perform an "exact" search on a
> certain layer. For example: I have a parcel layer (italian cadastre)
> in which every feature is identified by two fields: "foglio" and
> "mappale". At this moment if I perform (i.e.) a search for "foglio"
> number 3 and "mappale" number 5, I obtain:
>
> - foglio 3 - mappale 5
> - foglio 3 - mappale 15
> - foglio 13 - mappale 5
> - foglio 23 - mappale 15
> - ......
> - foglio 23 - mappale 25
> - ...and so on
>
> identifying every feature containing number 3 in "foglio" and number 5
> in "mappale" fields (in many cases I obtain a long list which may
> create confusion).
> Is there a way to exactly identify the searched feature, in this case
> "foglio 23 - mappale 5" only?
> I hope it is clear.
>
> Thanks in advance for any suggestions!
> flavio
>
> --
> /"\  ASCII Ribbon Campaign
> \ /  Respect for low technology.
>  X  Keep e-mail messages readable by any computer system.
> / \  Keep it ASCII.



-- 
/"\  ASCII Ribbon Campaign
\ /  Respect for low technology.
 X  Keep e-mail messages readable by any computer system.
/ \  Keep it ASCII.


More information about the GeoMoose-users mailing list