DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: YATSE

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed:2009-08-19T09:19:39.700000000
Classification:Yet another TYPO3 search engine
Description:This EXT is a new way of searching your website. Please read the manual carefully.
Keywords:yatse
Author:Mischa Heißmann
Email:typo3.YYYY@heissmann.org
Info 4:
Language:en

img-1 img-2 EXT: YATSE - Yet another TYPO3 search engine

EXT: YATSE

Extension Key: Yet another TYPO3 search engine

Language: en

Keywords: yatse

Copyright 2000-2008, Mischa Heißmann, <typo3.YYYY@heissmann.org>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.org

For further information see: http://www.heissmann.org

Table of Contents

EXT: YATSE 1

`Introduction 3 <#1.1.Introduction|outline>`_

What does it do? 3

Screenshots 3

`Users manual 4 <#1.2.Users%20manual|outline>`_

Installing the fe_plugin 4

FAQ 5

`Administration 6 <#1.3.Administration|outline>`_

FAQ 6

`Configuration 7 <#1.4.Configuration|outline>`_

FAQ 7

Reference 7

`Developper's Zone 8 <#1.5.Developper's%20Zone|outline>`_

1. Indexing the content 8

2. Searching for results 8

Introduction

What does it do?

  • This extension provides a new way of searching your website. It stores the content of each page into a special table. With a special MySQL- Query, this table is searched in milliseconds.
  • Searchresults can be grouped by pages, e.g. all tt_news-results first, then all the rest.
  • Working only with MySQL 5+
  • Please be aware, this version is only developer-version. Make backups, backups and more backups.

Screenshots

img-3 Image 1: Config of fe_plugin

img-4 Image 2: Searchresults

img-5 Image 3: Adding the static template

Users manual

This EXT is divided into two parts.

A class using a T3-hook that is responsible for saving the pagecontent into the database

A fe_plugin with searchbox and resultlist.

Installing the fe_plugin

  • Download and install the EXT from TER

  • Go to the root template an include the static template “YATSE - Searchbox”

  • Go to the page, where the searchbox should be displayed.

  • Insert a pagecontent and select the plugin “YATSE”

    img-6

  • Configure the plugin

img-7

  • Under 1. you set the rootpage of your website or the page from which the search should begin.
  • In point 2. you can set pages which should show searchresults first.
  • Finish.

FAQ

  • Is this extension compatible with the flag “no index” in pagesettings?

    Yes. Of course!

  • Will pages be stored, if page is not cached?

    Yes. It doesn't matter, if page is cached or not.

  • Can asterisk be used?

Administration

Some small settings can be done. Read carefully the chapter “Configuration”

FAQ

Can I add a searchbox on every page. Will mean: can I add a searchbox via TypoScript?

Of course you can. Just add an HTML-object with value

<form id="tx_yatse_pi1" method="post" name="tx_yatse_pi1" action="{add here your pagelink, where searchresults are listed}">
        <input type="text" value="" name="tx_yatse_pi1[sword]"/>
        <input type="submit" value="Suchen"/>
</form>

Configuration

FAQ

Reference

Configuration of pi1

Template

Property

Template

Data type

String

Description

URL to your templatefile

Default: EXT:yatse/res/tx_yatse_template.html

Default

result.chars.before

Property

result.chars.before

Data type

Int

Description

Number of letters before the searchword

Default

100

result.chars.after

Property

result.chars.after

Data type

Int

Description

Number of letters after the searchword

Default

100

result.strftime

Property

result.strftime

Data type

String

Description

Formatting the date and time in resultlist. Use the syntax on strftime() in php-ref:

http://de3.php.net/manual/en/function.strftime.php

Default

%d.%m.%Y

result.box.wrap

Property

result.box.wrap

Data type

Wrap

Description

How to wrap the single boxes of the searchresults.

Default: <div class="tx_yatse_pi1_boxwrap">|</div>

Default

result.box.titlewrap

Property

result.box.titlewrap

Data type

Wrap

Description

How to wrap the titles of the searchresults

Default

<h2>|</h2>

stats.saveIP

Property

stats.saveIP

Data type

Boolean

Description

Stats will store the IP of the visitor. Set to 0 to avoid saving. (eg. for German governmental websites)

Default

1

_CSS_DEFAULT_STYLE

Property

_CSS_DEFAULT_STYLE

Data type

Description

See setup.txt

Default

[plugin.tx_yatse_pi1]

((generated))
Example

Here you would show an example of the stuff from the reference or so:

Example for pi1:

plugin.tx_yatse_pi1 {
    template = EXT:yatse/res/tx_yatse_template.html
    result {
            chars {
                    before = 100
                    after = 100
            }
            strftime = %d.%m.%Y
            box {
                    wrap = <div class="tx_yatse_pi1_boxwrap">|</div>
                    titlewrap = <h2>|</h2>
            }
    }
    stats {
            saveIP = 1
    }
    _CSS_DEFAULT_STYLE (
            .tx_yatse_highlight { background-color: yellow; }
            a.yatse_helplink div.yatse_helpbox { display:none; }
            a.yatse_helplink:hover div.yatse_helpbox { display:block; position:absolute; width: 300px; margin-left: 10px;margin-top: -10px; padding: 4px; border: 1px solid black; background-color: white; font-size: 8pt; }
            h4.yatse_helpheader { font-size: 10pt; margin-bottom: 6px; }
    )
}

Developper's Zone

Here's a short explanation how this ext works.

1. Indexing the content

After TYPO3 has rendered all the content and before it is sent to the browser, the plugin will do several steps

get the rendered content and remove all HTML-tags, linebreaks and tabs. So we get a pure text-version.

check if the page should be indexed or not. If yes

check for an entry in database:

with the same pid and

with the same cHash.

if exists: check the content . Is the new content different to the stored or has the pagetitle changed?

if yes: update the entry.

else: do nothing.

else: create a new entry.

So the whole pagecontent is stored in one field into the database. The table has a fulltext-index on this content field which can be used for a boolean fulltext-search.

2. Searching for results

The plugin (pi1) does nothing else than perform the query

SELECT *, MATCH (content) AGAINST (\''.utf8_decode($this->cObj->removeBadHTML($this->piVars['sword'], $this->conf)).'\'  IN BOOLEAN MODE) AS data FROM tx_noindexedsearch_content WHERE MATCH (content) AGAINST (\''.utf8_decode($this->cObj->removeBadHTML($this->piVars['sword'], $this->conf)).'\'  IN BOOLEAN MODE)...

3. Hooks in YATSE

The frontend-plugin offers some hooks for manipulation.

YATSE_BeforeFormWrapMarkerHook

Name

YATSE_BeforeFormWrapMarkerHook

File / Class

class.tx_yatse_pi1.php

class_txyatse_pi1

Parameters

$this->markerArray,

$this->wrappedSubpartContentArray, $this->conf,

$this

Description

This hook manipulates the markerArrays for the result-output. With this hook you can add your own markers to the template.

8