eSearch Query on Multiple Fields

2015
3
Jump to solution
02-10-2016 10:59 AM
TomLeMahieu
New Contributor II

Can eSearch be configured to search on multiple fields from the same layer?  For example, in the configuration, can it search on both parcel number (PIN) and school?  I tried this but eSearch just hangs when I add the School Expression.

"expressions": {

  "expression": [

  {

  "alias": "PIN",

  "textsearchlabel": "Search by PIN",

  "values": {

  "value": [

  {

  "fieldObj": {

  "name": "PIN",

  "label": "PIN",

  "shortType": "string",

  "type": "esriFieldTypeString"

  },

  "valueObj": {

  "value": ""

  },

  "prompt": "PIN is",

  "textsearchhint": "enter PIN number here.",

  "sqltext": "Upper(PIN) = Upper('[value]') OR Upper(KEYPIN) = Upper('[value]')",

  "operation": "stringOperatorIs"

  }

  ]

  }

  },

   "alias": "SCHOOLDESCRIPTION",

  "textsearchlabel": "Search by CVT",

  "values": {

  "value": [

  {

  "fieldObj": {

  "name": "SCHOOLDESCRIPTION",

  "label": "SCHOOLDESCRIPTION",

  "shortType": "string",

  "type": "esriFieldTypeString"

  },

  "valueObj": {

  "value": ""

  },

  "prompt": "SCHOOLDESCRIPTION is",

  "textsearchhint": "enter SCHOOLDESCRIPTION number here.",

  "sqltext": "Upper(SCHOOLDESCRIPTION) like Upper('[value]')",

  "operation": "stringOperatorIs"

  }

  ]

  }

  }

  ]

},

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Tom,

   Are you manually editing this json? It appears so because if you use the widget setting UI it would have added an "operator": "AND" property to the SCHOOLDESCRIPTION expression value.

Yes, the widget can definitely handle multiple fields in a query.

View solution in original post

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

Tom,

   Are you manually editing this json? It appears so because if you use the widget setting UI it would have added an "operator": "AND" property to the SCHOOLDESCRIPTION expression value.

Yes, the widget can definitely handle multiple fields in a query.

0 Kudos
TomLeMahieu
New Contributor II

Robert,

Yes I was configuring it manually. I put it back into the configurator which added the "operator" property.

It all works well now! Thanks!!

tom

0 Kudos
TomLeMahieu
New Contributor II

Nevermind!! I just didn't configure it correctly.

0 Kudos