FindTask with more than 500 values

582
1
04-08-2013 02:02 AM
IonPadilla
New Contributor
Hello,

I want to make a findTask that gives me all the features with this searchText:

findParams.searchText = " ";


The problem is the map service is limited to 500 features per findTask, is there any way of asking the server for the information in another way or creating a loop that is able to ask for the features sequentially?

Sadly I am not able to edit the map service so I can't change the limit of the answers that the findTask is sending me.

Thanks in advance

PD: here you can find the code that retrieves the data
  findTask = new esri.tasks.FindTask("https://maps.cern.ch/ArcGIS/rest/services/General/loc/MapServer/");
  

  findParams = new esri.tasks.FindParameters();
  findParams.returnGeometry = true;
  findParams.layerIds = [6,7,8,10,11,15,16,17,19];
  findParams.searchFields = ["NUMERO", "SIGLE", "SITE","TITLE","SPAT_NAME","SPAT_ACCL_NAME","LOCATION_EXPERT_NAME"];
  findParams.outSpatialReference = map.spatialReference;
  findParams.searchText = " ";
  findTask.execute(findParams,function (results) {
 //parse results and add to autocomplete widget
 dojo.forEach(results, function(value, index){
   names.push(value.value);
 });
    }, function (error) {
        alert("Error: " + error);
  });
0 Kudos
1 Reply
JanJeske
New Contributor III
The best way would be to alter the 500 limit on the server.

The other way if you have a ascending or descending primary key or OBJECTID you could write a loop.

Selecting the first 500 take the last id of them and start the next query with > or < id and so on until there are no more results. Not the best solution i think but practicable.
0 Kudos