Multiple Field Search

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Tue Sep 6 17:51:19 EDT 2005


No I think you can do the following

$qstring = "[FIELD1] > 23 AND [FIELD2] =~ /^(bla)+/" ;

But give it a try. This is not documented well.

-Steve W.

Abe Gillespie wrote:
> Ok, that sounds like good news.  Now if I did go to regular
> expressions to gain case insensitivity, do I lose the ability to query
> on multiple fields?
> 
> Thanks.
> -Abe
> 
> On 9/6/05, Armin Burger <armin.burger at gmx.net> wrote:
> 
>>Abe,
>>
>>with Mapscript you can search for multiple fields. It's not very clear
>>in the documentation, but it works.
>>
>>You have to specify an existing field of the layer for 'qitem', for
>>'qstring' you can define a filter statement that includes more than one
>>field/item, like
>>
>>$qitem = 'FIELD1';
>>$qstring = "[FIELD1] > 23 AND '[FIELD2]' = 'blabla'" ;
>>$mylayer->queryByAttributes($qitem, $qstring, MS_MULTIPLE);
>>
>>I think case-insensitive queries just work using regular expresions.
>>
>>Armin
>>
>>Abe Gillespie wrote:
>>
>>>Just for clarification, querying on multiple fields is NOT supported,
>>>correct?  Unfortunately my current client requires compound queries of
>>>this nature, but I forgot MapServer didn't natively do this.  I
>>>noticed that Chameleon actually queries DBFs external to MapServer's
>>>API.  I certainly can piggy-back on this method and just test each
>>>case in the compound query by hand and keep records that past the
>>>entire set of tests.  Unfortunately I'm no genius in search technology
>>>and my methods will be done linearlly and obviously SLOWLY.
>>>
>>>Can anyone offer any guidance, resources, or any other help?
>>>
>>>Thanks.
>>>-Abe
>>>
>>>
>>
> 



More information about the mapserver-users mailing list