Search Widget using Arabic Word

292
3
04-30-2019 06:21 AM
MayurPatel
New Contributor II

Hi,

I am using ArcGIS JavaScript API 4.10. I have implemented the search widget in my application. I am able to search feature using English words but when I am trying to search using Arabic word, I got 'No results found' in suggestion Template. I have set below two properties for Search Widget

searchFields: ["NAMEENGLISH", "NAMEARABIC"],

suggestionTemplate: "{NAMEENGLISH}, {NAMEARABIC}",

 1. Search using English Characters(Musaffah)

2. Search using Arabic Characters(مصفح)

I am not getting suggestion for the Arabic Case. Any help here. 

Tags (2)
0 Kudos
3 Replies
MahmoudHemdan2
Esri Contributor

Hi, to solve this issue should be done following item

1. try to hosting the Esri Javascript API locally.

2. go to the "search.js" in this path "https://<your machine>/arcgis_js_api/library/3.27/3.27/esri/dijit/search.js" and open it in the editor.

3. go to the method "_whereClause"

4. change this line from

'this.reHostedFS.test(b.url) && this._containsNonLatinCharacter(a) &&(f = "N");'

to

'this._containsNonLatinCharacter(a) && (f = "N");'.

5.check now will be solved.

0 Kudos
Noah-Sager
Esri Regular Contributor

A word of caution, we do not recommend or allow people to modify the JS API. Please see our policy here:

Frequently Asked Questions | ArcGIS API for JavaScript 4.13 

0 Kudos
Noah-Sager
Esri Regular Contributor

I tested a sample using Arabic localization, it seems to give suggestions.

https://codepen.io/noash/pen/KKKaaOP 

Are you searching a layer, a custom Locator source, or using the Esri world geocoding service?

0 Kudos