Select to view content in your preferred language

Enhanced Search Widget, Passing SQL query via URL String

2447
6
Jump to solution
05-09-2012 09:44 AM
KentuckyDGI
Emerging Contributor
It is very easy to configure the eSearch widget to utilize pure SQL query strings but is there a way to pass those query strings via a URL? I've experimented a bit but haven't gotten it to work. I suspect there must be a way to format the string so that it is recognized by the widget. Has anyone leveraged the eSearch widget in this manner?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Matthias and Kentucy DGI,

  What Kentucy DGI has posted works and avoids the bug I mentioned because it is searching for a number and not a string. As soon as you attempt to search for a string by putting single quotes in you will run into the bug. As I mentioned this bug will be addressed in the next release.

View solution in original post

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus
Kentucky DGI,

   If you are using the source code I can point you to the offending line that needs to be fixed. If you are using the compiled version than you will have to wait for the next release for this to be fixed.
0 Kudos
KentuckyDGI
Emerging Contributor
I'm using the compiled version. I just got it to work a few minutes ago!
Had to work with the string until I got the syntax just right.
0 Kudos
MatthiasPfeiffer
Occasional Contributor
Could you please print an example how it has to look like?

Cheers
Matthias
0 Kudos
KentuckyDGI
Emerging Contributor
This is the string I used in the URL:

index.html?search=AIRDIST%20%3E%2080&slayer=1&exprnum=3

In this case I'm querying the field "AIRDIST" (distance to the closest airport) for instances where the distance is greater than 80. I'm leveraging the first layer in the searchwidget config file and the 3rd expression for that particular layer.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Matthias and Kentucy DGI,

  What Kentucy DGI has posted works and avoids the bug I mentioned because it is searching for a number and not a string. As soon as you attempt to search for a string by putting single quotes in you will run into the bug. As I mentioned this bug will be addressed in the next release.
0 Kudos
KentuckyDGI
Emerging Contributor
Yes, I learned this weekend that it does not work for a text string. Luckily my application can leverage a number!
We appreciate your efforts and look forward to the next release.
0 Kudos