This article provides information about how Happeo indexes and delivers search results and how those results are prioritized.
How Happeo's search works
The score of a search query is determined by its keyword match. We use Elastic search to assign these scores. The weight of each result type (post, Channel, Page, etc.), however, can be configured as a means to tune something. By default in Happeo, all weights are the same.
Currently, the location or field that a keyword is in does not affect its weighting. In practice, this means that there is no difference between the “score” of a keyword if it is in a different field in Happeo, such as:
- Page Title
- Page Description
- Page Header
- Text Widget
- Channel Name
- Channel Description
- User Card
Instead, if two or more terms have an equal “score”, Happeo will prioritize based on the “recentness” of results. This means the most recently created or updated results will be prioritized above older content.
Additionally, for posts, comments, and Channels, after 7 days of no updates or activity, the “score” of their contents will decrease.
In Pages and Page Groups, after 30 days of no updates or activity, the “score” of their contents will decrease.
How are the results sorted?
In the Elasticsearch cluster, the search query is parsed into terms and then queried to a relevant index like *Posts*.
Documents (in this index, *Posts*) are given scores by algorithms and sorted based on the scores.
These algorithms take into account:
- Term match in the document
- Term frequency in the document
- Term frequency overall
- Term importance in the document (is it once in a 300-word document, or once in a 10-word document?)
- Partial searches/matches
- Document age (older documents are less relevant) - this is used more heavily in the case of posts and comments, less in the case of pages, and not used at all in the case of users and groups)
Partial searches and suggestions
Typing part of a word or sentence correctly will show a correct result. However, misspelling a word or a sentence will show no results.
"Suggestion" means that the search suggests tags that were found by the search term and a user can click on one of the suggested tags. In other words, it suggests hashtags related to the search by matching hashtags to the keyword.