WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Forex Trading Online forex trading platform
Set the phrase delimiter

SwishSearch->setPhraseDelimiter

(No version information available, might be only in CVS)

SwishSearch->setPhraseDelimiterSet the phrase delimiter

Description

void SwishSearch->setPhraseDelimiter ( string $delimiter )
Warning

This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in a future release of PHP. This function should be used at your own risk.

Parameters

delimiter

Phrase delimiter character. The default delimiter is double-quotes.

Return Values

No value is returned.

Examples

Example #1 Basic SwishSearch->setPhraseDelimiter() example

<?php

try {

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

    
$results $search->execute('"every time"'); //looking for "every time"
    
echo "First query found: "$results->hits" hits\n";

    
$search->setPhraseDelimiter("'");
    
$results $search->execute("'every time'"); //the same query, but using different delimiter
    
echo "Second query found: "$results->hits" hits\n";

    
$search->setPhraseDelimiter('"');
    
$results $search->execute("'every time'"); //looking for "every" and "time"
    
echo "Third query found: "$results->hits" hits\n";

    
//let's look at parsed words
    
var_dump($results->getParsedWords("index.swish-e"));

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

?>

The above example will output something similar to:

 
 First query found: 1 hits Second query found: 1 hits Third query found: 2 hits array(2) {   [0]=>   string(5) "every"   [1]=>   string(4) "time" }