diff --git a/reference/swish/classes.xml b/reference/swish/classes.xml
new file mode 100644
index 0000000000..d7bd88e73a
--- /dev/null
+++ b/reference/swish/classes.xml
@@ -0,0 +1,222 @@
+
+
+
+ &reftitle.classes;
+
+ &reftitle.classes;
+
+ Swish
+
+
+
+ &reftitle.properties;
+
+
+
+ indexes - the array of indexes used and their properties. Certain
+ list of properties depends on Swish-e version.
+
+
+
+
+
+ &reftitle.methods;
+
+
+
+ - constructs new
+ Swish object.
+ Throws SwishException on error.
+
+
+
+
+ - prepares and returns
+ SwishSearch object.
+ Throws SwishException on error.
+
+
+
+
+ - executes the query and
+ returns SwishResults object.
+ Throws SwishException on error.
+
+
+
+ - returns an array
+ of meta entries for the given index file.
+
+
+ - returns an array
+ of properties for the given index file.
+
+
+
+
+
+ SwishSearch
+
+
+
+ &reftitle.methods;
+
+
+
+ - sets the
+ structure flag in the search object. This flag is used to limit search
+ to certain parts of HTML documents.
+
+
+
+
+ - sets
+ the phrase delimiter character. The default delimiter is double-quotes.
+
+
+
+
+ - sets the sort
+ order of the results.
+
+
+
+
+ - sets the limits
+ for the search.
+ Throws SwishException on error.
+
+
+
+
+ - resets the
+ limits.
+
+
+
+
+ - executes the
+ query and returns SwishResults object.
+ Throws SwishException on error.
+
+
+
+
+
+
+ SwishResults
+
+
+
+ &reftitle.properties;
+
+
+
+ hits - the number of results in this
+ SwishResults object.
+
+
+
+
+ indexes - the array of indexes used in the search.
+
+
+
+
+
+ &reftitle.methods;
+
+
+
+ - returns
+ next SwishResult object or &false; if no
+ more results are available.
+
+
+
+
+ - sets the
+ current seek position in the SwishResults
+ object.
+ Throws SwishException on error.
+
+
+
+
+ -
+ returns an array of words in the query with stopwords removed.
+
+
+
+
+ -
+ returns an array of removed stopwords.
+
+
+
+
+
+
+ SwishResult
+
+
+
+ &reftitle.properties;
+
+
+ Properties list depends on Swish-e version, see examples.
+
+
+
+
+ &reftitle.methods;
+
+
+
+ - returns
+ an array of meta entries for the index used in this result.
+
+
+
+
+ - stems the word
+ and returns result as an array of strings.
+ Throws SwishException on error.
+
+
+
+
+
+
+ SwishException
+
+ SwishException extends the build in
+ Exception class and possesses the same set of
+ properties and methods. See for more details.
+
+
+
+
+
+
+
diff --git a/reference/swish/constants.xml b/reference/swish/constants.xml
new file mode 100644
index 0000000000..26d64a9573
--- /dev/null
+++ b/reference/swish/constants.xml
@@ -0,0 +1,240 @@
+
+
+
+ &reftitle.constants;
+ &extension.constants;
+
+
+
+ SWISH_META_TYPE_UNDEF
+ (integer)
+
+
+
+
+
+
+
+
+ SWISH_META_TYPE_STRING
+ (integer)
+
+
+
+
+
+
+
+
+ SWISH_META_TYPE_ULONG
+ (integer)
+
+
+
+
+
+
+
+
+ SWISH_META_TYPE_DATE
+ (integer)
+
+
+
+
+
+
+
+
+ SWISH_IN_FILE_BIT
+ (integer)
+
+
+
+
+
+
+
+
+ SWISH_IN_TITLE_BIT
+ (integer)
+
+
+
+
+
+
+
+
+ SWISH_IN_HEAD_BIT
+ (integer)
+
+
+
+
+
+
+
+
+ SWISH_IN_BODY_BIT
+ (integer)
+
+
+
+
+
+
+
+
+ SWISH_IN_COMMENTS_BIT
+ (integer)
+
+
+
+
+
+
+
+
+ SWISH_IN_HEADER_BIT
+ (integer)
+
+
+
+
+
+
+
+
+ SWISH_IN_EMPHASIZED_BIT
+ (integer)
+
+
+
+
+
+
+
+
+ SWISH_IN_META_BIT
+ (integer)
+
+
+
+
+
+
+
+
+ SWISH_IN_FILE
+ (integer)
+
+
+
+
+
+
+
+
+ SWISH_IN_TITLE
+ (integer)
+
+
+
+
+
+
+
+
+ SWISH_IN_HEAD
+ (integer)
+
+
+
+
+
+
+
+
+ SWISH_IN_BODY
+ (integer)
+
+
+
+
+
+
+
+
+ SWISH_IN_COMMENTS
+ (integer)
+
+
+
+
+
+
+
+
+ SWISH_IN_HEADER
+ (integer)
+
+
+
+
+
+
+
+
+ SWISH_IN_EMPHASIZED
+ (integer)
+
+
+
+
+
+
+
+
+ SWISH_IN_META
+ (integer)
+
+
+
+
+
+
+
+
+ SWISH_IN_ALL
+ (integer)
+
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/swish/functions/swish-construct.xml b/reference/swish/functions/swish-construct.xml
new file mode 100644
index 0000000000..9ad7d53459
--- /dev/null
+++ b/reference/swish/functions/swish-construct.xml
@@ -0,0 +1,93 @@
+
+
+
+
+ Swish::__construct
+ Construct a Swish object
+
+
+ &reftitle.description;
+
+ voidSwish::__construct
+ stringstring index_names
+
+ &warn.experimental.func;
+
+
+ &reftitle.parameters;
+
+
+
+ index_names
+
+
+ The list of index files separated by spaces.
+
+
+
+
+
+
+
+ &reftitle.errors;
+
+ Throws SwishException on error.
+
+
+
+ &reftitle.examples;
+
+
+ A Swish::__construct example
+
+getMessage(), "\n";
+}
+
+foreach ($swish->indexes as $index) {
+ var_dump($index["name"]);
+ var_dump($index["headers"]["Total Words"]);
+}
+
+?>
+]]>
+
+ The above example will output something like this:
+
+
+
+
+
+
+
+
+
diff --git a/reference/swish/functions/swish-getMetaList.xml b/reference/swish/functions/swish-getMetaList.xml
new file mode 100644
index 0000000000..158f6cd0ac
--- /dev/null
+++ b/reference/swish/functions/swish-getMetaList.xml
@@ -0,0 +1,99 @@
+
+
+
+
+ Swish->getMetaList
+ Get the list of meta entries for the index
+
+
+ &reftitle.description;
+
+ arraySwish->getMetaList
+ stringindex_name
+
+ &warn.experimental.func;
+
+
+ &reftitle.parameters;
+
+
+
+ index_name
+
+
+ The name of the index file.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns an array of meta entries for the given index.
+
+
+
+ &reftitle.examples;
+
+
+ Basic Swish->getMetaList example
+
+getMetaList("index.swish-e"));
+
+} catch (SwishException $e) {
+ echo $e->getMessage(), "\n";
+}
+
+?>
+]]>
+
+ The above example will output something like this:
+
+
+ array(3) {
+ ["Name"]=>
+ string(12) "swishdefault"
+ ["Type"]=>
+ int(0)
+ ["ID"]=>
+ int(1)
+ }
+}
+]]>
+
+
+
+
+
+
+
+
diff --git a/reference/swish/functions/swish-getPropertyList.xml b/reference/swish/functions/swish-getPropertyList.xml
new file mode 100644
index 0000000000..aa1518f9d3
--- /dev/null
+++ b/reference/swish/functions/swish-getPropertyList.xml
@@ -0,0 +1,99 @@
+
+
+
+
+ Swish->getPropertyList
+ Get the list of properties for the index
+
+
+ &reftitle.description;
+
+ arraySwish->getPropertyList
+ stringindex_name
+
+ &warn.experimental.func;
+
+
+ &reftitle.parameters;
+
+
+
+ index_name
+
+
+ The name of the index file.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns an array of properties for the given index.
+
+
+
+ &reftitle.examples;
+
+
+ Basic Swish->getPropertyList example
+
+getPropertyList("index.swish-e");
+ foreach ($properties as $prop) {
+ echo $prop["Name"],"\n";
+ }
+
+} catch (SwishException $e) {
+ echo $e->getMessage(), "\n";
+}
+
+?>
+]]>
+
+ The above example will output something like this:
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/swish/functions/swish-prepare.xml b/reference/swish/functions/swish-prepare.xml
new file mode 100644
index 0000000000..85775c7340
--- /dev/null
+++ b/reference/swish/functions/swish-prepare.xml
@@ -0,0 +1,106 @@
+
+
+
+
+ Swish->prepare
+ Prepare a search query
+
+
+ &reftitle.description;
+
+ objectSwish->prepare
+ stringquery
+
+ &warn.experimental.func;
+
+ Prepare and return a search object, which you can later use for unlimited
+ number of queries.
+
+
+
+ &reftitle.parameters;
+
+
+
+ query
+
+
+ Optional query string. The query can be also set using SwishSearch->execute
+ method.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns SwishSearch object.
+
+
+
+ &reftitle.errors;
+
+ Throws SwishException on error.
+
+
+
+ &reftitle.examples;
+
+
+ Basic Swish->prepare example
+
+prepare("search query");
+ $results = $search->execute();
+ echo "Found: ", $results->hits, " hits\n";
+
+ $results = $search->execute("new search");
+
+ echo "Found: ", $results->hits, " hits\n";
+} catch (SwishException $e) {
+ echo $e->getMessage(), "\n";
+}
+
+?>
+]]>
+
+ The above example will output something like this:
+
+
+
+
+
+
+
+
+
diff --git a/reference/swish/functions/swish-query.xml b/reference/swish/functions/swish-query.xml
new file mode 100644
index 0000000000..5346ff3a8a
--- /dev/null
+++ b/reference/swish/functions/swish-query.xml
@@ -0,0 +1,100 @@
+
+
+
+
+ Swish->query
+ Execute a query and return results object
+
+
+ &reftitle.description;
+
+ objectSwish->query
+ stringquery
+
+ &warn.experimental.func;
+
+ A quick method to execute a search with default parameters.
+
+
+
+ &reftitle.parameters;
+
+
+
+ query
+
+
+ Query string.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns SwishResults object.
+
+
+
+ &reftitle.errors;
+
+ Throws SwishException on error.
+
+
+
+ &reftitle.examples;
+
+
+ Basic Swish->query example
+
+query("test query");
+
+ echo "Found: ", $results->hits, " hits\n";
+
+} catch (SwishException $e) {
+ echo $e->getMessage(), "\n";
+}
+
+?>
+]]>
+
+ The above example will output something like this:
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/swish/functions/swishresult-getMetaList.xml b/reference/swish/functions/swishresult-getMetaList.xml
new file mode 100644
index 0000000000..f050bb2424
--- /dev/null
+++ b/reference/swish/functions/swishresult-getMetaList.xml
@@ -0,0 +1,46 @@
+
+
+
+
+ SwishResult->getMetaList
+ Get a list of meta entries
+
+
+ &reftitle.description;
+
+ arraySwishResult->getMetaList
+
+
+ &warn.experimental.func;
+
+
+ &reftitle.returnvalues;
+
+ Returns the same array as Swish->getMetaList,
+ but uses the index file from the result handle.
+
+
+
+
+
+
diff --git a/reference/swish/functions/swishresult-stem.xml b/reference/swish/functions/swishresult-stem.xml
new file mode 100644
index 0000000000..e7dc3e41be
--- /dev/null
+++ b/reference/swish/functions/swishresult-stem.xml
@@ -0,0 +1,113 @@
+
+
+
+
+ SwishResult->stem
+ Stems the given word
+
+
+ &reftitle.description;
+
+ arraySwishResult->stem
+ stringword
+
+ &warn.experimental.func;
+
+ Stems the word based on the fuzzy mode used during indexing.
+ Each result object is linked with its index, so the results are based on this index.
+
+
+
+ &reftitle.parameters;
+
+
+
+ word
+
+
+ The word to stem.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns array of results, in most cases with just one element.
+ If the stemmer used does not convert the word, the result array will
+ contain the original word.
+
+
+
+ &reftitle.errors;
+
+ Throws SwishException on error.
+
+
+
+ &reftitle.examples;
+
+
+ Basic example
+
+query("testing OR others");
+
+ if ($result = $results->nextResult()) {
+ var_dump($result->stem("testing")); //the results fully depend on the stemmer used in th index
+ var_dump($result->stem("others"));
+ }
+
+} catch (SwishException $e) {
+ echo "Error: ", $e->getMessage(), "\n";
+}
+
+?>
+]]>
+
+ The above example will output something like this:
+
+
+ string(4) "test"
+}
+array(1) {
+ [0]=>
+ string(5) "other"
+}
+]]>
+
+
+
+
+
+
+
+
diff --git a/reference/swish/functions/swishresults-getParsedWords.xml b/reference/swish/functions/swishresults-getParsedWords.xml
new file mode 100644
index 0000000000..a4d0921ab4
--- /dev/null
+++ b/reference/swish/functions/swishresults-getParsedWords.xml
@@ -0,0 +1,113 @@
+
+
+
+
+ SwishResults->getParsedWords
+ Get an array of parsed words
+
+
+ &reftitle.description;
+
+ arraySwishResults->getParsedWords
+ stringindex_name
+
+ &warn.experimental.func;
+
+
+ &reftitle.parameters;
+
+
+
+ indexi_name
+
+
+ The name of the index used to initialize Swish
+ object.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ An array of parsed words with stopwords removed. The list of parsed words
+ may be useful for highlighting search terms in the results.
+
+
+
+ &reftitle.examples;
+
+
+ Basic SwishResults->getParsedWords example
+
+query("'some characters' and numbers");
+
+ var_dump($results->getParsedWords("index.swish-e"));
+ var_dump($results->indexes[0]['parsed_words']); //same result in a different way
+
+} catch (SwishException $e) {
+ echo "Error: ", $e->getMessage(), "\n";
+}
+
+?>
+]]>
+
+ The above example will output something like this:
+
+
+ string(4) "some"
+ [1]=>
+ string(10) "characters"
+ [2]=>
+ string(3) "and"
+ [3]=>
+ string(7) "numbers"
+}
+array(4) {
+ [0]=>
+ string(4) "some"
+ [1]=>
+ string(10) "characters"
+ [2]=>
+ string(3) "and"
+ [3]=>
+ string(7) "numbers"
+}
+]]>
+
+
+
+
+
+
+
+
diff --git a/reference/swish/functions/swishresults-getRemovedStopwords.xml b/reference/swish/functions/swishresults-getRemovedStopwords.xml
new file mode 100644
index 0000000000..839ba77258
--- /dev/null
+++ b/reference/swish/functions/swishresults-getRemovedStopwords.xml
@@ -0,0 +1,60 @@
+
+
+
+
+ SwishResults->getRemovedStopwords
+ Get an array of stopwords removed from the query
+
+
+ &reftitle.description;
+
+ arraySwishResults->getRemovedStopwords
+ stringindex_name
+
+ &warn.experimental.func;
+
+
+ &reftitle.parameters;
+
+
+
+ index_name
+
+
+ The name of the index used to initialize Swish
+ object.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns array of stopwords removed from the query.
+
+
+
+
+
+
diff --git a/reference/swish/functions/swishresults-nextResult.xml b/reference/swish/functions/swishresults-nextResult.xml
new file mode 100644
index 0000000000..451fb96d15
--- /dev/null
+++ b/reference/swish/functions/swishresults-nextResult.xml
@@ -0,0 +1,75 @@
+
+
+
+
+ SwishResults->nextResult
+ Get the next search result
+
+
+ &reftitle.description;
+
+ objectSwishResults->nextResult
+
+
+ &warn.experimental.func;
+
+
+ &reftitle.returnvalues;
+
+ Returns the next SwishResult object in the result
+ set or &false; if there are no more results available.
+
+
+
+
+ &reftitle.examples;
+
+
+ Basic SwishResults->nextResult example
+
+prepare();
+
+ $results = $search->execute("lost");
+ while($result = $results->nextResult()) {
+ /* do something with the result object */
+ }
+
+} catch (SwishException $e) {
+ echo $e->getMessage(), "\n";
+}
+
+?>
+]]>
+
+
+
+
+
+
+
+
diff --git a/reference/swish/functions/swishresults-seekResult.xml b/reference/swish/functions/swishresults-seekResult.xml
new file mode 100644
index 0000000000..a554cb51a6
--- /dev/null
+++ b/reference/swish/functions/swishresults-seekResult.xml
@@ -0,0 +1,101 @@
+
+
+
+
+ SwishResults->seekResult
+ Set current seek pointer to the given position
+
+
+ &reftitle.description;
+
+ intSwishResults->seekResult
+ intposition
+
+ &warn.experimental.func;
+
+
+ &reftitle.parameters;
+
+
+
+ position
+
+
+ Zero-based position number. Cannot be less than zero.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns new position value on success.
+
+
+
+ &reftitle.errors;
+
+ Throws SwishException on error.
+
+
+
+ &reftitle.examples;
+
+
+ Basic SwishResults->seekResult example
+
+prepare();
+
+ $results = $search->execute("lost");
+
+ var_dump($results->seekResult(0)); //this will succeed
+ var_dump($results->seekResult(100)); //this will fail
+
+} catch (SwishException $e) {
+ echo "Error: ", $e->getMessage(), "\n";
+}
+
+?>
+]]>
+
+ The above example will output something like this:
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/swish/functions/swishsearch-execute.xml b/reference/swish/functions/swishsearch-execute.xml
new file mode 100644
index 0000000000..83f45d0d99
--- /dev/null
+++ b/reference/swish/functions/swishsearch-execute.xml
@@ -0,0 +1,110 @@
+
+
+
+
+ SwishSearch->execute
+ Execute the search and get the results
+
+
+ &reftitle.description;
+
+ objectSwishSearch->execute
+ stringquery
+
+ &warn.experimental.func;
+
+ Searches the index file(s) based on the parameters set in the search
+ object.
+
+
+
+ &reftitle.parameters;
+
+
+
+ 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.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns SwishResults object.
+
+
+
+ &reftitle.errors;
+
+ Throws SwishException on error.
+
+
+
+ &reftitle.examples;
+
+
+ Basic SwishSearch->execute example
+
+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";
+}
+
+?>
+]]>
+
+ The above example will output something like this:
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/swish/functions/swishsearch-resetLimit.xml b/reference/swish/functions/swishsearch-resetLimit.xml
new file mode 100644
index 0000000000..091d181c44
--- /dev/null
+++ b/reference/swish/functions/swishsearch-resetLimit.xml
@@ -0,0 +1,85 @@
+
+
+
+
+ SwishSearch->resetLimit
+ Reset the search limits
+
+
+ &reftitle.description;
+
+ voidSwishSearch->resetLimit
+
+
+ &warn.experimental.func;
+
+ Reset the search limits previous set by
+ .
+
+
+
+ &reftitle.examples;
+
+
+ Basic SwishSearch->resetLimit example
+
+prepare();
+
+ $results = $search->execute("time");
+ echo "First query found: ", $results->hits, " hits\n";
+
+ $search->setLimit("swishdocsize", "3000", "6000"); //limit by document size, from 3000 to 6000 bytes
+ $results = $search->execute("time");
+ echo "Second query found: ", $results->hits, " hits\n";
+
+ $search->resetLimit();
+ $results = $search->execute("time");
+ echo "Third query found: ", $results->hits, " hits\n";
+
+} catch (SwishException $e) {
+ echo $e->getMessage(), "\n";
+}
+
+?>
+]]>
+
+ The above example will output something like this:
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/swish/functions/swishsearch-setLimit.xml b/reference/swish/functions/swishsearch-setLimit.xml
new file mode 100644
index 0000000000..91285159b8
--- /dev/null
+++ b/reference/swish/functions/swishsearch-setLimit.xml
@@ -0,0 +1,131 @@
+
+
+
+
+ SwishSearch->setLimit
+ Set the search limits
+
+
+ &reftitle.description;
+
+ voidSwishSearch->setLimit
+ stringproperty
+ stringlow
+ stringhigh
+
+ &warn.experimental.func;
+
+
+ &reftitle.parameters;
+
+
+
+ property
+
+
+ Search result property name.
+
+
+
+
+ low
+
+
+ The lowest value of the property.
+
+
+
+
+ high
+
+
+ The highest value of the property.
+
+
+
+
+
+
+
+ &reftitle.errors;
+
+ Throws SwishException on error.
+
+
+
+ &reftitle.examples;
+
+
+ Basic SwishSearch->setLimit example
+
+prepare();
+
+ $results = $search->execute("time");
+ echo "First query found: ", $results->hits, " hits\n";
+
+ $i = 0;
+ while($result = $results->nextResult()) {
+ echo "Hit #", ++$i, " - ", $result->swishdocsize, " bytes\n";
+ }
+
+ $search->setLimit("swishdocsize", "3000", "6000"); //limit by document size, from 3000 to 6000 bytes
+ $results = $search->execute("time");
+ echo "Second query found: ", $results->hits, " hits\n";
+
+ $i = 0;
+ while($result = $results->nextResult()) {
+ echo "Hit #", ++$i, " - ", $result->swishdocsize, " bytes\n";
+ }
+
+} catch (SwishException $e) {
+ echo $e->getMessage(), "\n";
+}
+
+?>
+]]>
+
+ The above example will output something like this:
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/swish/functions/swishsearch-setPhraseDelimiter.xml b/reference/swish/functions/swishsearch-setPhraseDelimiter.xml
new file mode 100644
index 0000000000..d69e9e0416
--- /dev/null
+++ b/reference/swish/functions/swishsearch-setPhraseDelimiter.xml
@@ -0,0 +1,105 @@
+
+
+
+
+ SwishSearch->setPhraseDelimiter
+ Set the phrase delimiter
+
+
+ &reftitle.description;
+
+ voidSwishSearch->setPhraseDelimiter
+ stringdelimiter
+
+ &warn.experimental.func;
+
+
+ &reftitle.parameters;
+
+
+
+ delimiter
+
+
+ Phrase delimiter character. The default delimiter is double-quotes.
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+
+ Basic SwishSearch->setPhraseDelimiter example
+
+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 like this:
+
+
+ string(5) "every"
+ [1]=>
+ string(4) "time"
+}
+]]>
+
+
+
+
+
+
+
+
diff --git a/reference/swish/functions/swishsearch-setSort.xml b/reference/swish/functions/swishsearch-setSort.xml
new file mode 100644
index 0000000000..27406eb3ba
--- /dev/null
+++ b/reference/swish/functions/swishsearch-setSort.xml
@@ -0,0 +1,114 @@
+
+
+
+
+ SwishSearch->setSort
+ Set the sort order
+
+
+ &reftitle.description;
+
+ voidSwishSearch->setSort
+ stringsort
+
+ &warn.experimental.func;
+
+
+ &reftitle.parameters;
+
+
+
+ sort
+
+
+ Sort order of the results is a string containing name of a result
+ property combined with sort direction ("asc" or "desc").
+ Examples: "swishrank desc", "swishdocpath asc", "swishtitle asc",
+ "swishdocsize desc", "swishlastmodified desc" etc.
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+
+ Basic SwishSearch->setSort example
+
+prepare();
+
+ $results = $search->execute("time");
+ echo "First query found: ", $results->hits, " hits\n";
+
+ $i = 0;
+ while($result = $results->nextResult()) {
+ echo "Hit #", ++$i, " - ", $result->swishdocsize, " bytes\n";
+ }
+
+ $search->setSort("swishdocsize desc"); //sort by document size
+ $results = $search->execute("time");
+ echo "Second query found: ", $results->hits, " hits\n";
+
+ $i = 0;
+ while($result = $results->nextResult()) {
+ echo "Hit #", ++$i, " - ", $result->swishdocsize, " bytes\n";
+ }
+
+} catch (SwishException $e) {
+ echo $e->getMessage(), "\n";
+}
+
+?>
+]]>
+
+ The above example will output something like this:
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/swish/functions/swishsearch-setStructure.xml b/reference/swish/functions/swishsearch-setStructure.xml
new file mode 100644
index 0000000000..bb6f0f82bd
--- /dev/null
+++ b/reference/swish/functions/swishsearch-setStructure.xml
@@ -0,0 +1,142 @@
+
+
+
+
+ SwishSearch->setStructure
+ Set the structure flag in the search object
+
+
+ &reftitle.description;
+
+ voidSwishSearch->setStructure
+ intstructure
+
+ &warn.experimental.func;
+
+
+ &reftitle.parameters;
+
+
+
+ structure
+
+
+ The structure flag a bitmask is used to limit search to certain parts of HTML
+ documents (like title, meta, body etc.). Its possible values are listed below.
+ To combine several values use bitwise AND operator, see example below.
+
+
+
+
+
+
+
+
+
+ SWISH_IN_FILE
+
+
+
+
+ SWISH_IN_TITLE
+
+
+
+
+ SWISH_IN_HEAD
+
+
+
+
+ SWISH_IN_BODY
+
+
+
+
+ SWISH_IN_COMMENTS
+
+
+
+
+ SWISH_IN_HEADER
+
+
+
+
+ SWISH_IN_EMPHASIZED
+
+
+
+
+ SWISH_IN_META
+
+
+
+
+
+
+ &reftitle.examples;
+
+
+ Basic SwishSearch->setStructure example
+
+prepare();
+
+ $results = $search->execute("time");
+ echo "First query found: ", $results->hits, " hits\n";
+
+ $search->setStructure(SWISH_IN_TITLE|SWISH_IN_HEAD); //search in title and head
+ $results = $search->execute("time");
+ echo "Second query found: ", $results->hits, " hits\n";
+
+ $search->setStructure(SWISH_IN_ALL); //search in whole document, the default value
+ $results = $search->execute("time");
+ echo "Third query found: ", $results->hits, " hits\n";
+
+} catch (SwishException $e) {
+ echo $e->getMessage(), "\n";
+}
+
+?>
+]]>
+
+ The above example will output something like this:
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/swish/reference.xml b/reference/swish/reference.xml
new file mode 100644
index 0000000000..d40db2ae28
--- /dev/null
+++ b/reference/swish/reference.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+ Swish-e bindings
+ swish
+
+
+ &reftitle.intro;
+
+ The swish extension provides the bindings for Swish-e API.
+ Swish-e stands for "Simple Web Indexing System for Humans - Enhanced" and
+ is an open source system for indexing and search.
+ Swish-e itself is licensed under GPL license, but uses a clause that
+ allows applications to link against the library if every copy of the
+ combined work is accompanied by the URL to Swish-e source code. Here it
+ is: http://swish-e.org.
+
+
+ &warn.experimental;
+
+
+
+ &reftitle.required;
+
+ PECL/swish requires PHP 5.1.3 or newer.
+
+
+
+ &reftitle.install;
+
+ &pecl.info;
+ &url.pecl.package;swish.
+
+
+
+ &reftitle.runtime;
+ &no.config;
+
+ &reference.swish.constants;
+ &reference.swish.classes;
+
+ &reference.swish.functions;
+
+