Smart Did You Mean - findologic/findologic-api GitHub Wiki
This article contains development features that are not yet available in the
master
branch. Some information may still change or can't be found in this article at all.
Description
We also support Smart Did-You-Mean functionality out of the box, with some neat helper functions. If you do not know what Smart Did-You-Mean is or how it works, please refer to the FINDOLOGIC Documentation about Smart Did-You-Mean.
Implementation
To implement Smart Did-You-Mean, you only need the tirade of functions.
getType()
: Returns the type of the query. Eitherimproved
orcorrected
.getOriginalQuery()
: The original query from the XML response.getAlternativeQuery()
: If it was a did you mean suggestion, returns thedidYouMeanQuery
, otherwise take thequeryString
.