getOrderAI

getOrderAI ( string search , map list , boolean _isCloserSearch , boolean _returnList ) : int_or_array

Returns the corresponding key in a map. Our IA algorithm can help you to order by similarities.
Use activeFlexibleComparaison to ignore for example accent differences in the search.

Example


array=["return1":"oo", "return2":"vv"]

console(getOrderAI("oa", array, true, true)) //  -> [return1, return2]
console(getOrderAI("va", array, true, true)) //  -> [return2, return1]

Parameters

search

what you search in the list.

list

map of elements to_return=>to_search.

_isCloserSearch (optional)

• if false, the function return the corresponding ID if there is an exact matching and null else
• if true (default), it returns everytime someting. In IA algorithm compare textual similarities and return the closer element ID.

_returnList (optional)

• if false (default), it return an ID
• if true, it returns a list of ID. So if isCloserSearch=false, it returns all element with a name equals to the search. If isCloserSearch=true, it returns all the list ordered by proximity.