Download the PHP package johnsnook/yii2-parsel without Composer

On this page you can find all versions of the php package johnsnook/yii2-parsel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yii2-parsel

Yii2 Parsel

Allows developers to provide a boolean search query interface, similar to Google or Sphinx search or other full-text search (FTS) engines.

Turns a user query like 'georgia -(atlanta or decatur)' into 'georgia AND NOT (atlanta or decatur)' which is then turn into the follow SQL:

Example results:

Ip Visits City Region
107.77.232.216 16 Georgia
107.77.235.199 3 Georgia
174.218.142.27 1 Lawrenceville Georgia
107.77.233.225 18 Georgia
205.201.132.14 42 Woodstock Georgia
192.3.160.15 4 Douglas Georgia

Installation

The preferred way to install this extension is through composer.

Either run

or add

to the require section of your composer.json file.

Usage

"Look, I didn't know I could speak Parseltongue! What else don't I know about myself? Look. Maybe you can do something, even something horrible and not know you did it."

Once the extension is installed, simply use it in your code by :

Tokens/behavior:

Fields to be search must be either text, varchar or char currently. Future versions may expand to number, dates and maybe even JSON. All search terms, except where specified bye the full match operator are wrapped in your databases wildcard of choice. Searching for "smart" is equivalent to the SQL expression '%smart%'. Search is case insensitive as long as your database's LIKE operator is. PostgreSQL will use ILIKE.

Conjunctives:

'AND' is the default behavior. "smart pretty" is the same as "smart AND pretty."

'OR' allows more results in your query: "smart OR pretty."

Operators:

Operator Type Description
- Negation The user query "smart pretty -judgmental" parses to "smart AND pretty AND NOT judgmental"
() Sub-query Allows grouping of terms . The user query "-crazy (smart AND pretty)" parses to "NOT crazy AND (smart AND pretty)"
* Wildcard Fuzzy matches. "butt*" matches butt, buttery, buttered etc.
_ Character wildcard Matches one character. "boo_" matches boot, book, bool, boon, etc.
= Full match Entire fields must be equal to the term. "=georgia" only matches where one or more fields is exactly equal to the search term. The search term will NOT be bracketed with %, but wildcards can still be used.
"" Double quotes Phrase. '"Super fun"' searches for the full phrase, space include. Wild cards, negation and exact match operators all work within the phrase.
'' Single quotes Phrase, no wildcards. The term will not be evaluated for or , but will be wrapped in wildcards. If a % or is in the term, it will be escaped. 'P%on' becomes '%P\%on*%'.
: Field Specify the field to search. 'name:jo' will search the name field for 'jo*.' If no field name matches, all fields will be searched for 'name:jo\'

Examples

See files in /examples. If it's still up, you might also be able to play with an example here

Additional Reading

PostgreSQL

Faster PostgreSQL Searches with Trigrams

Optimizing databases for fuzzy searching

MySQL

Performance analysis of MySQL's FULLTEXT indexes and LIKE queries for full text search

Acknowledgements

This project was built by heavily modifying the excellent "Search Query Parser" project. I de-abstracted the token structure and modified the parser class to better fit my needs. Their licsence file should be found at the root of this project.

Both projects are made possible by the amazing and lightning quick lexer library by Nikita Popov of Berlin. It's work reading his article on the subject.


All versions of yii2-parsel with dependencies

PHP Build Version
Package Version
Requires nikic/phlexy Version dev-master
yiisoft/yii2 Version ~2.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package johnsnook/yii2-parsel contains the following files

Loading the files please wait ....