Search Queries Localization - AFS

AFS Integration Guide

Product
AFS
AFS_Version
7.9
Category
Reference Guide

Since AFS v7.7, the localization of a search query is driven by the value of the parameter afs:lang.

The following configuration parameters allow to specify the keyword used for every operator for a given language:

  • QueryParsing/NEAR/localizedKeyword
  • QueryParsing/NLP/Operator/localizedAND
  • QueryParsing/NLP/Operator/localizedOR
  • QueryParsing/NLP/Operator/localizedNOT
  • QueryParsing/NLP/Operator/localizedOPT

The following configuration parameters allow to specify the empty words to use for a given language:

  • QueryParsing/localizedEmptyWords

These parameters are of the key/value type. Key allows to specify the language code and optionally the region code (locale). Value allows to specify the value for this language / region.

Example of localized AND operator keywords configuration, within the Configuration application of the Back Office and in XML:

Screen Shot 2014-08-13 at 15.40.11

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
[...]
<afs:QueryParsing>
<afs:NLP>
<afs:Operator>
<afs:localizedAND>
<afs:mapItem key="en-US" value="AND"/>
<afs:mapItem key="es" value="Y"/>
<afs:mapItem key="de-DE" value="UND"/>
<afs:mapItem key="fr" value="ET"/>
</afs:localizedAND>
</afs:Operator>
</afs:NLP>
</afs:QueryParsing>
[...]

Legacy non localized configuration parameters are still available. They are used by default.

  • QueryParsing/NEAR/keyword
  • QueryParsing/NLP/Operator/AND
  • QueryParsing/NLP/Operator/OR
  • QueryParsing/NLP/Operator/NOT
  • QueryParsing/NLP/Operator/OPT
  • QueryParsing/emptyWords

Query behavior

  • If the query contains a parameter afs:lang=langCode (meaning the query is localized):
    • If there is a value for this particular langCode language in one of the previous configuration parameter, it is used.
    • Otherwise, the default value is used.
  • If the query contains a parameter afs:lang=langCode-regionCode (meaning the query is precisely localized):
    • If there is a value for this particular langCode-regionCode language in one of the previous configuration parameter, it is used.
    • Or, if there is a value for the langCode language in one of the previous configuration parameter, it is used.
    • Otherwise, the default value is used.
  • Otherwise, if the query does not contain a parameter afs:lang=, the default value is used.

Examples

  • Query containing afs:lang=enUS / Value of conf parameter for enUS and enGB / enUS is used
  • Query containing afs:lang=enUS / Value of conf parameter for en only / en is used
  • Query containing afs:lang=enUS / Value of conf parameter for enGB only / default value is used
  • Query not containing afs:lang= / default value is used