Hi Everyone,
I'm trying to put together the search component by using a layer as the search source, and I'm getting maybe the first 1000 to 2000 records in a sorted order, and can't return anything else past those records from the search. I have roughly 4,000 rows I would like to search on.
I have updated the JSON definition of the layer to return a max record count of 5000, which is working for drop downs in Survey123. But I can't get this same result from the search widget in experience builder or the search component in the ArcGIS Maps SDK for JavaScript.
When I search on my layer, I can return the addresses in the beginning of a sorted result like "1 CRATER LN", "10 CRATER LN", but "6 CRATER LN" can't be found.
const sourceProperties = [
{
layer: featureLayerAddresses,
searchFields: ["Address"],
displayField: "Address",
exactMatch: false,
outFields: ["Address", "SRAddress", "TaxlotSitus", "TaxLotID", "SRPropID"],
name: "Addresses",
placeholder: "example: 1 CRATER LN",
minSuggestCharacters: 4
}
];
search.sources = new Collection(sourceProperties);
This statement is somewhat ambiguous: "I have updated the JSON definition of the layer to return a max record count of 5000". If that's something you've done on the client-side, I could see why it may not make a difference. Client-side queries will be constrained no matter what by the maximum allowed by the service being queried. For example, this layer used by one of the samples has a "Max Record Count" of 1000, and nothing can be done on the client-side to override that. If you have control of the service in question, and have configured the max to your liking, then it must be a different issue. If so, checking the Search component's maxResults property, or the LayerSearchSource object's maxResults property might be a good place to start.
I apologize for the ambiguity. I'll try to re-explain with a bit more clarity.
Before attempting to search on the feature layer, I went into the ArcGIS Online REST Admin page and updated the max record count to 5000 on the server instead of the default 2000. This helped in populating auto complete drop downs in Survey123 forms etc so I can search on the address I'm looking for.
I'm now working on the client side, and I'm still being limited in the returns I'm receiving in the Search Widget in Experience Builder, and in the Search Component in the ArcGIS Maps SDK for JavaScript.
I'll tinker with the maxResults property and report back on what I find.
Thank you for the reply.
-Jack