global19 / pecl-search_engine-swish Goto Github PK
View Code? Open in Web Editor NEWThis project forked from php/pecl-search_engine-swish
Swish-e bindings
Home Page: http://pecl.php.net/package/swish
This project forked from php/pecl-search_engine-swish
Swish-e bindings
Home Page: http://pecl.php.net/package/swish
README for PHP Swish-e bindings =============================== $Id$ This extension provides bindings to the swish-e API. Swish-e is a GPL licensed search engine, with a clause that allows applications to link against the libswish-e library to use the published API to do so without invoking the viral portion of the GPL. This is subject to returning a link back to the swish-e source code. Here it is: http://swish-e.org/index.html How do I use this? ================== First you need to have built a swish index. Consult the swish docs for details on that: http://swish-e.org/docs/index.html % swish-e -i /path/to/stuff/to/index Now build this PHP module: % phpize % configure --with-swish=/usr/local % make % su - # make install # echo 'extension=swish.so' >> /usr/local/lib/php.ini Then you can code up an interface to the index using PHP: <?php $h = new Swish("index.swish-e"); $results = $h->query("lemons"); echo "There are ", $results->hits, " lemons\n"; while ($r = $results->nextResult()) { printf("in file %s, relevance %d\n", $r->swishdocpath, $r->swishrank ); } ?> Brief API reference: ==================== See http://swish-e.org/docs/swish-library.html for more background. /* major handle class */ class Swish { public indexes = array(); //indexes and their properties SwishSearch prepare([string query]); SwishResult query(string query); array getMetaList(string indexname); array getPropertyList(string indexname); } /* search handle class */ class SwishSearch { void setStructure(int structure); void setPhraseDelimiter(string delimiter_char); void setSort(string sort_string); void setLimit(string property, string low, string high); void resetLimit(); SwishResults execute([string query]); } /* search results class */ class SwishResults { public hits = 0; public indexes = array(); SwishResult nextResult(); int seekResult(int position); array getParsedWords(string indexname); array getRemovedStopWords(string indexname); } /* search result class */ class SwishResult { /* properties defined by Swish, automatically "converted" to object properties */ array getMetaList(); array stem(string word); } vim:ts=2:sw=2:et:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.