Skip to content

[#1794] Improvements to hashtags extraction from search query

Ivan Tashkinov requested to merge fix/1794-hashtag-search-results into develop

Fixes #1794 (closed)

Note: hashtags aren't really searched but are produced from search query, i.e. it's not guaranteed that each produced hashtag is used in at least one status.

Made improvements beyond (or alternatively to) what #1794 (closed) currently specifies — please review.

  • if search query contains at least one explicit hashtag (prefixed with #), only explicit hashtags are extracted (some text with #ExplicitHashtag -> ["ExplicitHashtag"])

  • if search query contains no explicit hashtags, it's being split into lexemes; hyphenated words are also being split now since hashtags cannot contain hyphens

  • joined hashtag is being added by default, e.g. john doe would yield ["john", "doe", "JohnDoe]. Useful for names, for hyphenated words (e.g. accident-prone now yields ["accident", "prone", "AccidentProne] whilst previously it'd yield non-working ["accident-prone"]), etc.

Merge request reports