{"issue":{"created_at":"2011-11-24T12:50:02Z","state":"open","updated_at":"2011-11-24T12:50:08Z","user":{"gravatar_id":"256406243346b9253f8610fb1d1e05f6","id":1215373,"url":"https://api.github.com/users/importer","login":"importer","avatar_url":"https://secure.gravatar.com/avatar/256406243346b9253f8610fb1d1e05f6?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":5,"body":"I currently have the problem that neither changed events nor my own extensions which make use of the search engine can take enough influence on updating the search index. I tried deleting the matching entry in tl_search and all child entries at tl_search_index but still there are 2 problems: \n- the search additionally created a tmp-file with the search results as serialized array which continues to list the deleted element.\n- the new element cannot be added instantly to the search.\n\nThe latter is not that important, the index will be rebuild eventually (when? I could not really find it), but listing invalid entries is bad mojo for the user. In case of events the visitor just gets \"invalid event id\".\n\nWould it be possible to add 2 new functions Search->removeFromIndex() and Search->addToIndex() which both get the URL to add/delete? Both should be usable within the core (for changed articles and pages, events etc.) and in third-party extensions.\n\nMost of this is a feature request, not changing the index when an event gets updated may be a bug report.\n\n--- _Originally created by markus.milkereit on January 24th, 2009, at 07:02pm (ID 447)_","assignee":{"gravatar_id":"360d94de41513598ac4440d46a3dab1b","id":1192057,"url":"https://api.github.com/users/leofeyer","login":"leofeyer","avatar_url":"https://secure.gravatar.com/avatar/360d94de41513598ac4440d46a3dab1b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"id":2341156,"number":447,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"labels":[{"name":"Feature","color":"4183c4","url":"https://api.github.com/repos/contao/issues/labels/Feature"},{"name":"framework","color":"e6e6e6","url":"https://api.github.com/repos/contao/issues/labels/framework"}],"title":"search index update possible for own extensions","closed_at":null,"html_url":"https://github.com/contao/issues/issues/447","milestone":null,"url":"https://api.github.com/repos/contao/issues/issues/447"},"action":"created","comment":{"created_at":"2011-11-24T12:50:08Z","updated_at":"2011-11-24T12:50:08Z","user":{"gravatar_id":"256406243346b9253f8610fb1d1e05f6","id":1215373,"url":"https://api.github.com/users/importer","login":"importer","avatar_url":"https://secure.gravatar.com/avatar/256406243346b9253f8610fb1d1e05f6?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Ich habe die Search-Klasse auch nicht wörlich gemeint, sondern als Synonym einer Klasse die zuständig sein sollte. Auch der Ablauf ist nur ein Vorschlag, und passt nach deiner Beschreibung nicht zum Ansatz - dann muss eben ein anderer Ablauf her ;)\nIch denke der Automator wäre ein toller Platz für die Funktionen, ich probiere es mal mit möglichst kurzem neuem Pseudocode.\n\n```\nclass Automator extends Backend \n{\n  public function generateSitemap($intId=0) // bereits vorhanden, mit neuem Hook\n  {\n    // neuer Hook zum Schluss der Methode Namens \"generateSitemap\"\n    // dem auch andere generierte Dateien angehängt werden können, \n    // zum Beispiel die News-Feeds oder eigene statische Erzeugnisse\n  } \n  public function purgeTempFolder() {} // bereits vorhanden\n\n  public function addToSearchindex($url) \n  {\n    Search->addToIndex($url); // neue methode von lib-Klasse \"Search\"\n    $this->purgeTempFolder();\n    $this->generateSitemap();\n  }\n  public function removeFromSearchIndex($url)\n  {\n    Search->removeFromIndex($url); // neue methode von lib-Klasse \"Search\"\n    $this->purgeTempFolder();\n    $this->generateSitemap();\n  }\n}\n```\n\nIch hoffe die Idee wird jetzt klar. Die Suche ist ein machtvolles Hilfsmittel, kann aber aktuell nur eingeschränkt genutzt werden. Ich würde sie gerne viel mehr auch in eigenen Erweiterungen einsetzen sowie auf wirklich aktiven Seiten wo teilweise sehr viel in den Events gearbeitet wird.\n\n--- _Originally created by markus.milkereit on January 25th, 2009, at 11:48am_","id":2863776,"url":"https://api.github.com/repos/contao/issues/issues/comments/2863776"}}