定制 elzekool/koolsearch 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

elzekool/koolsearch

Composer 安装命令:

composer require elzekool/koolsearch

包简介

Token based Search Engine

README 文档

README

A Lucene inspired Search platform, very simple at the moment. Can be used if a simple LIKE query won't suffice. It's not meant to replace SOLR or Lucene in any way, they are far superior. Use KoolSearch if you want to know a little bit about search platforms or need a simple PHP/MySQL only solution.

KoolSearch is meant to be used together with the KoolDevelop framework but it can be used without. Filenames are following the PSR-0 standard. You have to write your own Storage classes.

Some example queries the KoolSearch platform understands:

  • Apple -Computer
  • OS +"MS Dos"
  • +Linus +Tovalds
  • +title:Ubuntu title:Linux "OS"

Main Parts

This are the main parts that make up the KoolSearch platform.

  • Indexer and Searcher
  • Storage
  • Filters (CharFilter, Tokenizer, Transformer)
  • Query Tokenizer, Parser and Elements
  • Entities

Indexer and Searcher

This are the classes you will be talking to the most. The Indexer is used to update the index, the Searcher is used to query the index.

Storage

The KoolSearch platform uses a SQL database to store the index. The Storage interfaces are used to interface the database. Standard classes are provided if using the KoolDevelop framework. Create your own if you are not using this framework.

Filters (CharFilter, Tokenizer, Transformer)

Are used for indexing and searching transforming strings into terms. CharFilters work on the raw input string and perform things like lowercasing, replacing special characters, etc. Tokenizers transforms the filtered input string to individual tokens or terms. This terms are what are actualy stored and retrieved from the database. Transformers can be used to manipulate terms. The work on the tokenized terms instead of the input string. This makes them different from the CharFilters. Transformers do things like removing duplicate terms, removing stopwords and making NGrams.

Query Tokenizer, Parser and Elements

KoolSearch supports an user friendly query syntax. This syntax consists of the + and minus operators, field selection (:) and phrases. The search query is first Tokenized by the Tokenizer into Tokens. The Tokens are read by the Parser. The parser creates the individual Elements that make up the search query. Supported elements at this moment are Term and Phrase.

Entities

Entities contain the different entities used in the application. This includes:

  • Term, Search Term as stored in the Index
  • Document, Index Document as stored in the Index, uniquely identified by it's Id
  • Field, Fields that are index. Contain the configuration for indexing and searching the index.
  • TermDocument, The actual elements the Index is build uppon, contains the links between terms and documents.
  • SearchResult, Search result as returned from the searcher, contains document, score and matching TermDocuments.

统计信息

  • 总下载量: 18
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2014-08-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固