Output Suggestions Order - AFS

AFS Integration Guide

Product
AFS
AFS_Version
7.9
Category
Reference Guide

ACP results are sorted using the following criteria in this exact order:

  1. The shortest "edit distance" between what matched and the query. ACP first sends back the exact matches, then the results with one error, then those with two errors.
  2. Results matching the first word rather than the following one.
  3. The highest score. More information on a word's score in afs_acp_extract section of AFS Configuration Guide.
  4. Lexicographic order on the labels without taking into account neither the letter case nor the diacritical signs, e.g., é=É=e=E =è=È=ê=Ê=etc. All words are changed to lower case and accents are removed.
  5. An arbitrary deterministic order. This order remains unchanged unless the afs_acp daemon restarts.

If two results have the same value for a given criterion, the next criterion is applied.

Examples

Here is an ACP set with the following terms and expressions:

Back Office ACP term list

Example with one letter

To look for words beginning by "t", the URL using ACP web service takes the following form:

http://myServer/acp?afs:service=1&afs:query=t

[
"t",
[
"table de chez nous",
"tennis de table",
"tennisdetable"
]
]

Example with two letters

To look for words beginning by "ta", the URL using ACP web service takes the following form:

http://myServer/acp?afs:service=1&afs:query=ta

[
"ta",
[
"table de chez nous",
"tennis de table"
]
]

Example with a space

To look for expressions containing “table” and “de” separated by a space, the URL using ACP web service takes the following form:

http://myServer/acp?afs:service=1&afs:query=table%20de

[
"table de",
[
"table de chez nous",
"tennis de table"
]
]

Spaces are automatically encoded by the browser and replaced by « %20 ».

Example with two letters and a special character in the results

To look for words beginning by "ro" in a content with diacritical signs, the URL using ACP web service takes the following form:

http://myServer/acp?afs:service=1&afs:query=ro

[
"ro",
[
"Roméo & Juliette",
"Romeo and Juliet"
]
]

Example with a special character in the query

To look for the word “romeo” followed by the special character “&”, the URL using ACP web service takes the following form:

http://myServer/acp?afs:service=1&afs:query=romeo%26

[
"romeo&",
[
"Roméo & Juliette",
"Romeo and Juliet"
]
]

Special characters must be encoded.