{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/20781","repository_url":"https://api.github.com/repos/joomla/joomla-cms","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/20781/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/20781/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/20781/events","html_url":"https://github.com/joomla/joomla-cms/pull/20781","id":333009436,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MzQ1NTI4","number":20781,"title":"[4.0] com_finder: Adding a solution to add common words per language","user":{"login":"Hackwar","id":313866,"node_id":"MDQ6VXNlcjMxMzg2Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/313866?v=4","gravatar_id":"","url":"https://api.github.com/users/Hackwar","html_url":"https://github.com/Hackwar","followers_url":"https://api.github.com/users/Hackwar/followers","following_url":"https://api.github.com/users/Hackwar/following{/other_user}","gists_url":"https://api.github.com/users/Hackwar/gists{/gist_id}","starred_url":"https://api.github.com/users/Hackwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hackwar/subscriptions","organizations_url":"https://api.github.com/users/Hackwar/orgs","repos_url":"https://api.github.com/users/Hackwar/repos","events_url":"https://api.github.com/users/Hackwar/events{/privacy}","received_events_url":"https://api.github.com/users/Hackwar/received_events","type":"User","site_admin":false},"labels":[{"id":198658453,"node_id":"MDU6TGFiZWwxOTg2NTg0NTM=","url":"https://api.github.com/repos/joomla/joomla-cms/labels/Language%20Change","name":"Language Change","color":"eb6420","default":false},{"id":444033883,"node_id":"MDU6TGFiZWw0NDQwMzM4ODM=","url":"https://api.github.com/repos/joomla/joomla-cms/labels/PR-4.0-dev","name":"PR-4.0-dev","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":22,"created_at":"2018-06-16T19:25:40Z","updated_at":"2018-09-23T19:43:21Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/20781","html_url":"https://github.com/joomla/joomla-cms/pull/20781","diff_url":"https://github.com/joomla/joomla-cms/pull/20781.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/20781.patch"},"body":"This PR adds a way to add/remove common words in Smart Search during installation of language packs.\r\n\r\nSmart Search has a table for common words per language, which Smart Search filters out in the suggestions. (In a coming PR, these common words can also be filtered out of the index itself in order to keep the index smaller.) Up till now, there was no way for language packs to add their common words to that table and in general no way to update those words. (Although that should rarely be necessary. These lists are pretty static.)\r\n\r\nI've added an additional column \"custom\" to the ```#__finder_terms_common``` table to mark words as coming from a language pack (=0) or having been inserted by a user (=1). There currently is no interface for a user to add their own words. Depending on the discussion, this could be added as an option in the component configuration.\r\n\r\nI also added a ```finder``` plugin in the ```extension``` group. Upon installing an extension, this plugin looks if this is a language and if that language comes with a *.com_finder.commonwords.txt file. It then reads that file and adds its content to the ```#__finder_terms_common``` table. When a language is updated, the entries for that language from a language pack are deleted and re-added. Upon uninstalling, these entries are also deleted. That file can be put both in the frontend and backend language folder. If it is in both, the plugin will simply run twice for the frontend and backend. Since these steps are very rarely executed, this waste of resources should still be okay.\r\n\r\nThe ```*.com_finder.commonwords.txt``` file is a simple text file with a word per line. Everything following a semi-colon (```;```) is considered a comment and comments are ignored. Whitespace and empty lines are also ignored. The file has to be saved as UTF-8.\r\n\r\nI extended the list of the common words for english to the list proposed here: http://snowball.tartarus.org/ This site would also be the source for a bunch of other languages. To test and give more examples, I also modified the attached translation package for german with the list from that site.\r\n[de-DE_joomla_lang_full_3.8.8v1.zip](https://github.com/joomla/joomla-cms/files/2108471/de-DE_joomla_lang_full_3.8.8v1.zip)\r\n"},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/423842410","html_url":"https://github.com/joomla/joomla-cms/pull/20781#issuecomment-423842410","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/20781","id":423842410,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzg0MjQxMA==","user":{"login":"Hackwar","id":313866,"node_id":"MDQ6VXNlcjMxMzg2Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/313866?v=4","gravatar_id":"","url":"https://api.github.com/users/Hackwar","html_url":"https://github.com/Hackwar","followers_url":"https://api.github.com/users/Hackwar/followers","following_url":"https://api.github.com/users/Hackwar/following{/other_user}","gists_url":"https://api.github.com/users/Hackwar/gists{/gist_id}","starred_url":"https://api.github.com/users/Hackwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hackwar/subscriptions","organizations_url":"https://api.github.com/users/Hackwar/orgs","repos_url":"https://api.github.com/users/Hackwar/repos","events_url":"https://api.github.com/users/Hackwar/events{/privacy}","received_events_url":"https://api.github.com/users/Hackwar/received_events","type":"User","site_admin":false},"created_at":"2018-09-23T19:43:21Z","updated_at":"2018-09-23T19:43:21Z","author_association":"MEMBER","body":"@TobsBobs please notice that the pulltester does not work with this PR. The out-of-date message has nothing to do with this. I'll still update it to the latest version."}}
{"actor":{"display_login":"Hackwar"}}