• Stars
    star
    215
  • Rank 183,925 (Top 4 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ˜„ Emoji synonyms to build your own emoji-capable search engine (elasticsearch, solr, OpenSearch)

๐Ÿ™‚ Emoji, flags & emoticons support for Elasticsearch

Add support for emoji and flags in any Lucene compatible search engine!

If you wish to search ๐Ÿฉ to find donuts in your documents, you came to the right place. We offer synonym files ready for usage in Elasticsearch and OpenSearch analyzer.

Test all synonym files on a real Elasticsearch

Requirements to index emoji in Elasticsearch

There is no requirements for Elasticsearch >= 6.7.

Using older version of Elasticsearch? Open me! ๐Ÿ–ฑ
Version Requirements
Elasticsearch >= 6.4 and < 6.7 You need to install the official ICU Plugin. See our blog post about this change.
Elasticsearch < 6.4 You need our custom ICU Tokenizer Plugin, see our blog post (2016).

Run the following test to verify that you get 4 EMOJI tokens:

GET _analyze
{
  "text": ["๐Ÿฉ ๐Ÿ‡ซ๐Ÿ‡ท ๐Ÿ‘ฉโ€๐Ÿš’ ๐Ÿšฃ๐Ÿพโ€โ™€"]
}

The Synonyms, flags and emoticons

What you need to search with emoji is a way to expand them to words that can match searches and documents, in your language. That's the goal of the synonym dictionaries.

We build Solr / Lucene compatible synonyms files in all languages supported by Unicode CLDR so you can set them up in an analyzer. It looks like this:

๐Ÿ‘ฉโ€๐Ÿš’ => ๐Ÿ‘ฉโ€๐Ÿš’, firefighter, firetruck, woman
๐Ÿ‘ฉโ€โœˆ => ๐Ÿ‘ฉโ€โœˆ, pilot, plane, woman
๐Ÿฅ“ => ๐Ÿฅ“, bacon, meat, food
๐Ÿฅ” => ๐Ÿฅ”, potato, vegetable, food
๐Ÿ˜… => ๐Ÿ˜…, cold, face, open, smile, sweat
๐Ÿ˜† => ๐Ÿ˜†, face, laugh, mouth, open, satisfied, smile
๐ŸšŽ => ๐ŸšŽ, bus, tram, trolley
๐Ÿ‡ซ๐Ÿ‡ท => ๐Ÿ‡ซ๐Ÿ‡ท, france
๐Ÿ‡ฌ๐Ÿ‡ง => ๐Ÿ‡ฌ๐Ÿ‡ง, united kingdom

For emoticons, use this mapping with a char_filter to replace emoticons by emoji.

Installation

Download the emoji and emoticon file you want from this repository and store them in PATH_TO_ES/config/analysis (or anywhere Elasticsearch can read).

config
โ”œโ”€โ”€ analysis
โ”‚ย ย  โ”œโ”€โ”€ cldr-emoji-annotation-synonyms-en.txt
โ”‚ย ย  โ””โ”€โ”€ emoticons.txt
โ”œโ”€โ”€ elasticsearch.yml
...

Use them like this (this is a complete english example with Elasticsearch >= 6.7):

PUT /tweets
{
  "settings": {
    "analysis": {
      "filter": {
        "english_emoji": {
          "type": "synonym",
          "synonyms_path": "analysis/cldr-emoji-annotation-synonyms-en.txt"
        },
        "emoji_variation_selector_filter": {
          "type": "pattern_replace",
          "pattern": "\\uFE0E|\\uFE0F",
          "replace": ""
        },
        "english_stop": {
          "type":       "stop",
          "stopwords":  "_english_"
        },
        "english_keywords": {
          "type":       "keyword_marker",
          "keywords":   ["example"]
        },
        "english_stemmer": {
          "type":       "stemmer",
          "language":   "english"
        },
        "english_possessive_stemmer": {
          "type":       "stemmer",
          "language":   "possessive_english"
        }
      },
      "analyzer": {
        "english_with_emoji": {
          "tokenizer": "standard",
          "filter": [
            "english_possessive_stemmer",
            "lowercase",
            "emoji_variation_selector_filter",
            "english_emoji",
            "english_stop",
            "english_keywords",
            "english_stemmer"
          ]
        }
      }
    }
  },
  "mappings": {
    "properties": {
      "content": {
        "type": "text",
        "analyzer": "english_with_emoji"
      }
    }
  }
}

You can now test the result with:

GET tweets/_analyze
{
  "field": "content",
  "text": "๐Ÿฉ ๐Ÿ‡ซ๐Ÿ‡ท ๐Ÿ‘ฉโ€๐Ÿš’ ๐Ÿšฃ๐Ÿพโ€โ™€"
}

How to contribute

Build from CLDR SVN

You will need:

  • php cli
  • php zip and curl extensions

Edit the tag in tools/build-released.php and run php tools/build-released.php.

Update emoticons

Run php tools/build-emoticon.php.

Licenses

Emoji data courtesy of CLDR. See unicode-license.txt for details. Some modifications are done on the data, see here. Emoticon data based on https://github.com/wooorm/emoticon/ (MIT).

This repository in distributed under MIT License. Feel free to use and contribute as you please!

More Repositories

1

JoliNotif

๐Ÿ’ป Send notifications to your desktop directly from your PHP script
PHP
1,324
star
2

JoliCi

โœ… JoliCi - Run your TravisCi builds locally
PHP
657
star
3

castor

๐Ÿฆซ DX oriented task runner and command launcher built with PHP.
PHP
406
star
4

elasticsearch-cheatsheet

๐Ÿ”Ž Elasticsearch is awesome, here is a cheatsheet for it.
HTML
339
star
5

docker-starter

๐Ÿ—๏ธ A skeleton to start a new web project with PHP, Docker and Castor
PHP
335
star
6

JoliTypo

๐Ÿ”ค Microtypography fixer for the web
PHP
318
star
7

elastically

๐Ÿ” JoliCode's Elastica wrapper to bootstrap Elasticsearch PHP integrations
PHP
241
star
8

slack-php-api

#๏ธโƒฃ PHP Slack Client based on the official OpenAPI specification
PHP
219
star
9

secret-santa

๐ŸŽ… The code behind Secret Santa, the holiday bot for Slack / Discord / Webex
PHP
213
star
10

GifExceptionBundle

๐Ÿ˜› The GhostBuster of your exception page!
PHP
205
star
11

php-ar-drone

๐Ÿš Port of node-ar-drone which allows user to control a Parrot AR Drone over PHP
PHP
204
star
12

composer-cheatsheet

๐Ÿ“‹ Everything you have to know about composer.json in one page.
HTML
146
star
13

automapper

๐Ÿš€ Very FAST ๐Ÿš€ PHP AutoMapper with on the fly code generation
PHP
130
star
14

generator-joli-symfony

๐Ÿ‘จ Yeoman Generator for Symfony2 projects with sensible defaults and frontend tools.
JavaScript
100
star
15

asynit

๐ŸŒ  Asynchronous HTTP Request Testing Library for API or more...
PHP
77
star
16

Alloy-PullToRefresh

Pull to refresh widget for Titanium Alloy applications.
JavaScript
55
star
17

Badass-Pageflow

๐Ÿ“ฒ A simple Alloy "pageflow" widget, which allows to open windows w/ styles back buttons. Features a complete a simple API.
JavaScript
44
star
18

ffi-uuid

Binding of the libuuid library with PHP thanks to PHP/FFI.
PHP
39
star
19

docker-images

๐Ÿšข Basic images for different usages
Makefile
33
star
20

pomdok

๐Ÿ Simple wrapper to Symfony Go Binary for multi-app
Go
27
star
21

qotd

PHP
25
star
22

codingstyle

๐Ÿ’… JoliCode's base dotfile for PHP / JS projects
PHP
24
star
23

chef-cookbook-php

A Chef Cookbook for PHP, does not depend on apache and will not use or install pear like the official one.
Ruby
23
star
24

harvest-php-api

๐ŸŒพ A Harvest API PHP Client
PHP
22
star
25

starfleet

๐Ÿš€ Share your conferences activity to your buddies
PHP
20
star
26

php7-checker

โ˜‘๏ธ PHP7 checker
PHP
18
star
27

Harvest-Forecast-tools

๐Ÿ“… Some useful additions to https://www.getharvest.com/ and https://www.getharvest.com/forecast
JavaScript
16
star
28

symfony-jwt-article

PHP
16
star
29

seo-override

๐Ÿ Override your SEO related markup on the fly
PHP
14
star
30

harvest-openapi-generator

๐Ÿ”ฎ Transforms Harvest API HTML documentation pages into a valid Swagger / OpenAPI 3.0 specification
PHP
13
star
31

JoliTypoBundle

๐Ÿ”ค Integration of JoliTypo for Symfony2 (deprecated, use the provided bridge instead)
PHP
13
star
32

forecast-tools

โ›… Tools to get the most out of Harvest Forecast. Get Slack notifications, schedule Slack stand-up meetings, share public Forecasts, and more
PHP
13
star
33

JoliMarkdown

โœ A syntax fixer for markdown content
PHP
12
star
34

Symfony2BackboneDemo

JavaScript
12
star
35

symfony-security-article

PHP
12
star
36

php-os-helper

Provides helpers to detect OS of the machine where PHP is running.
PHP
12
star
37

monologue

A bot to manage "monologue" rule in a Slack Channel
PHP
10
star
38

ApacheTikaBundle

๐Ÿ“ Symfony Bundle for https://github.com/vaites/php-apache-tika
PHP
10
star
39

elasticsearch-php-benchmark

Benchmark of some PHP Clients for Elasticsearch
PHP
10
star
40

Reepo

Abstraction of repository providers (github, gitlab, redmine, ...)
PHP
9
star
41

symfony2-eventdispatcher-extension

Symfony2 Event Dispatcher as PHP extension written with Zephir
C
9
star
42

JoliToken

๐Ÿ” Elasticsearch plugin to visualize field tokens as analyzed by Lucene
JavaScript
9
star
43

isready-symfony2

Symfony2 production checklist for http://isready.org
7
star
44

best-bundle-conf

Symfony Live Paris 2013 talk about the best and unknown Symfony2 Bundles (in French)
JavaScript
7
star
45

JoliSnap

JavaScript
6
star
46

100-async-0-callback-conf

โœจ https://jolicode.github.io/100-async-0-callback-conf/#/0
JavaScript
6
star
47

webhook-demo

PHP
6
star
48

unicode-conf

๐Ÿ˜‹ Unicode, PHP et la sรฉcuritรฉ
JavaScript
5
star
49

forecast-php-api

โ›… A Forecastapp API PHP Client
PHP
5
star
50

GouvCamp-mobile

Mobile app for the GouvCamp 2012
JavaScript
5
star
51

SecurityBundle-avec-de-l-aspirine

JavaScript
4
star
52

react-et-symfony-conf

๐Ÿ’ Marier React et Symfony
HTML
4
star
53

value-object-conf

๐Ÿ’ป Slides from Forum PHP 2015 talk about Value Object
HTML
4
star
54

everything-titanium-using-the-cli-talk

Slides of the TiConf Amsterdam 2014 about using CLI tools in the Titanium world.
JavaScript
4
star
55

symfony-htmx-demo

Small Symfony project with HTMX and AssetMapper
PHP
3
star
56

lab-webgl-home

Jolicode website homepage in 3D
JavaScript
3
star
57

jolitypo-website

โœ๏ธ Sample app to testdrive JoliTypo
Twig
3
star
58

tabto

โžก๏ธ Auto-tabulation for your inputs. Tiny helper that focus user on the next field when a field reach maxLength.
JavaScript
3
star
59

php-the-wrong-way-conf

โ›” PHP The Wrong Way
PHP
3
star
60

docker-drupal-meetup-conf

CSS
2
star
61

php7cc-conf

๐Ÿ’ป A la recherche d'incompatibilitรฉs avec PHP 7, Apรฉro PHP conf by @pyrech
JavaScript
2
star
62

http-cache-conf

JavaScript
2
star
63

smile-php

๐Ÿ™‚
PHP
2
star
64

fosuserbundle-conf

๐Ÿ’ป Do Not Use FOSUserBundle conference
JavaScript
2
star
65

zephir-conf

Introduction about Zephir in french
JavaScript
2
star
66

typography-conf

Sud Web 2013 - Damien ALEXANDRE slides about space and french typography
JavaScript
1
star
67

drupal-rache-conf

Drupal Meetup Paris mai 2013 โ€“ Bastien Jaillot slides "Drupal au secours de la mรฉthode R.A.C.H.E"
JavaScript
1
star
68

Badass-Pageflow-Demo

Demo App for the Badass-Pageflow alloy widget
JavaScript
1
star
69

phptour-2014--dette-technique--conf

Confรฉrence "Prรฉvenez la dette technique de vos projets" au PHP Tour Lyon 2014
CSS
1
star
70

phptour2014-drink

1
star
71

phptour2014-burger

PHP
1
star
72

ca-marche-chez-moi

Sources des slides de la confรฉrence "Chez moi รงa marche" - PHP Tour 2012
CSS
1
star
73

sud-web--2014--dette-technique

Confรฉrence sur la dette technique ร  SudWeb 2014
CSS
1
star