Hello Armin,

Thank you very much, that was it, I was missing the [search] parameter. Now it 
is working properly!

I enabled the error_log in php.ini, and now I have access to pm_debug.log, but 
can not find the file config.ini to set the debuglevel to 3. Where can I find 
it?

While on the subject, I have a doubt to create a dropdown search (type = 
"options"), to display only distinct results. The case is the following, I have 
a postgis table with an ID column ("gid"), a column "Name", and a set of other 
columns. The column Name has repeated entries and the dropdown shows all these 
entries. This is the searchitem I'm using

    <searchitem name="plantas_emitidas" description="Plantas Emitidas">
        <layer type="postgis" name="plantas_emitidas">
            <field type="s" name="gid" description="Local" wildcard="2">
                <definition type="options" connectiontype="db" sort="asc">
                    <dsn 
encoding="UTF-8">pgsql://postgres:password@localhost/pmapper_postgis</dsn>
                    <sql>SELECT DISTINCT gid, name FROM plantas_emitidas WHERE 
name IS NOT NULL ORDER BY name</sql>
                </definition>
            </field>
        </layer>
    </searchitem>


It shows all Names from the table, but I'd like that just showed up one of 
each. I tried to enter the parameter GROUP BY, 

<sql>SELECT DISTINCT gid, name FROM plantas_emitidas WHERE name IS NOT NULL 
GROUP BY name ORDER BY name</sql>
<sql>SELECT gid, name FROM plantas_emitidas WHERE name IS NOT NULL GROUP BY 
name ORDER BY name</sql>

but the query stopped working.

This is somehow possible?

Once again, thank you very much for your support!

Best regards,
Pedro Venâncio






----- Original Message -----
From: Armin Burger 

Pedro

could you check the debug output (see FAQ for where to find it) and try 
to run the SQL statements logged there in a database client and see what 
results you get with them? This helps to narrow down the potential problem.

In general the <sql> tag should be something like

<sql>SELECT DISTINCT name FROM countries WHERE name ~* '^[search]' ORDER 
BY name</sql>

so I guess you miss the [search] part.

Armin



On 21/07/2011 10:30, Pedro Venâncio wrote:
> Hello all,
>
> I found some problems in the suggest search function of PostGIS layers. In 
> shapefile layers, everything works as expected, however, in the case of 
> PostGIS layers, when I put the first letter, it shows all the entries present 
> in the table, regardless of start or contain this letter [1]. By entering the 
> second letter, then the filter works correctly, and only appears the words 
> that begin or contain both letters. The same applies to the following letters 
> [2]. The problem is when you put another letter, forming a sequence of 
> letters that do not exist in the table. Instead of the list of options 
> disappear (as happens when searching shapefiles), appears again all the words 
> present in the table [3]. This is contrary to what is intended with suggest 
> search function.
>
> The configuration of the search I am using is as follows:
>
>          <searchitem name="plantas_emitidas_suggest" description="Plantas por 
>Freguesia">
>              <layer type="postgis" name="plantas_emitidas">
>                  <field type="s" name="freguesia" description="Freguesia" 
>wildcard="2">
>                      <definition type="suggest" connectiontype="db" 
>minlength="1" startleft="1" sort="asc">
>                      <dsn 
>encoding="UTF-8">pgsql://postgres:password@localhost/pmapper_postgis</dsn>
>                      <sql>SELECT DISTINCT freguesia FROM plantas_emitidas 
>ORDER BY freguesia</sql>
>                      </definition>
>                  </field>
>              </layer>
>          </searchitem>
>
>
>
> I have already tested pmapper 4.0 (w/ Mapserver 5.6) and 4.2 (w/ Mapserver 6) 
> on Ubuntu/Debian, with the same results. I'm using PostgreSQL 8.4 and PostGIS 
> 1.5.
>
>
> Can anyone confirm this behavior? Or am I failing at some point?
>
> Thank you very much!
>
>
> Best regards,
> Pedro Venâncio
>
>
> [1] http://dl.dropbox.com/u/5772257/pmapper/pmapper_search_1.jpg
> [2] http://dl.dropbox.com/u/5772257/pmapper/pmapper_search_2.jpg
> [3] http://dl.dropbox.com/u/5772257/pmapper/pmapper_search_3.jpg
>
> ------------------------------------------------------------------------------
> 5 Ways to Improve&  Secure Unified Communications
> Unified Communications promises greater efficiencies for business. UC can
> improve internal communications as well as offer faster, more efficient ways
> to interact with customers and streamline customer service. Learn more!
> http://www.accelacomm.com/jaw/sfnl/114/51426253/
> _______________________________________________
> pmapper-users mailing list
> pmapper-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>


------------------------------------------------------------------------------
5 Ways to Improve & Secure Unified Communications
Unified Communications promises greater efficiencies for business. UC can 
improve internal communications as well as offer faster, more efficient ways
to interact with customers and streamline customer service. Learn more!
http://www.accelacomm.com/jaw/sfnl/114/51426253/
_______________________________________________
pmapper-users mailing list
pmapper-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pmapper-users


------------------------------------------------------------------------------
5 Ways to Improve & Secure Unified Communications
Unified Communications promises greater efficiencies for business. UC can 
improve internal communications as well as offer faster, more efficient ways
to interact with customers and streamline customer service. Learn more!
http://www.accelacomm.com/jaw/sfnl/114/51426253/
_______________________________________________
pmapper-users mailing list
pmapper-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to