Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 21744 программиста и 1007 роботов. Сейчас ищут 747 программистов ...
Приступая к работе

SwishSearch::execute - Execute the search and get the results

Вернуться к: Swish Функции

SwishSearch::execute

(PECL swish >= 0.1.0)

SwishSearch::executeExecute the search and get the results

Описание

object SwishSearch::execute ([ string $query ] )
Внимание

Эта функция является ЭКСПЕРИМЕНТАЛЬНОЙ. Поведение этой функции, ее имя и относящаяся к ней документация могут измениться в последующих версиях PHP без уведомления. Используйте эту функцию на свой страх и риск.

Searches the index file(s) based on the parameters set in the search object.

Список параметров

query

The query string is an optional parameter, it can be also set using Swish::prepare() method. The query string is preserved between executions, so you can set it once, but execute the search multiple times.

Возвращаемые значения

Returns SwishResults object.

Ошибки

Throws SwishException on error.

Примеры

Пример #1 Basic SwishSearch::execute() example

<?php

try {

    
$swish = new Swish("index.swish-e");
    
$search $swish->prepare();

    
$results $search->execute("query");
    echo 
"First query found: "$results->hits" hits\n";

    
$results $search->execute("new OR query");
    echo 
"Second query found: "$results->hits" hits\n";

} catch (
SwishException $e) {
    echo 
$e->getMessage(), "\n";
}

?>

Результатом выполнения данного примера будет что-то подобное:

First query found: 2 hits
Second query found: 12 hits



Вернуться к: Swish Функции

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware