All Projects → manticoresoftware → Manticoresearch Php

manticoresoftware / Manticoresearch Php

Licence: apache-2.0
Official PHP client for Manticore Search

Labels

Projects that are alternatives of or similar to Manticoresearch Php

Mcavoy
Discover what visitors are searching for on your WordPress site.
Stars: ✭ 24 (-27.27%)
Mutual labels:  search
Txtai
AI-powered search engine
Stars: ✭ 874 (+2548.48%)
Mutual labels:  search
Pelias Android Sdk
Android sdk for pelias
Stars: ✭ 20 (-39.39%)
Mutual labels:  search
Multisearchview
Yet another built-in animated search view for Android.
Stars: ✭ 837 (+2436.36%)
Mutual labels:  search
Wechat
🔥 iOS 利用MVVM + RAC + ViewModel-Based Navigation来搭建微信(WeChat 7.0.0+)的整体基本架构,以及实现微信朋友圈、通讯录、下拉小程序、搜索等主要功能,代码规范惊为天人、注释详解令人发指、细节处理精益求精、核心功能配备文档、接近98%还原度的原生App视觉体验,代码不多,注释多。(持续更新,敬请期待,欢迎Star和Fork…)
Stars: ✭ 870 (+2536.36%)
Mutual labels:  search
Flexsearch
Next-Generation full text search library for Browser and Node.js
Stars: ✭ 8,108 (+24469.7%)
Mutual labels:  search
Alfred Unicode
Preview Unicode characters and emoji in Alfred
Stars: ✭ 23 (-30.3%)
Mutual labels:  search
Rom Elasticsearch
Elasticsearch adapter for rom-rb
Stars: ✭ 30 (-9.09%)
Mutual labels:  search
Vscode Tsquery
TSQuery extension for Visual Studio Code
Stars: ✭ 13 (-60.61%)
Mutual labels:  search
Scrapy Azuresearch Crawler Samples
Scrapy as a Web Crawler for Azure Search Samples
Stars: ✭ 20 (-39.39%)
Mutual labels:  search
Better Search
Better Search WordPress plugin
Stars: ✭ 9 (-72.73%)
Mutual labels:  search
Vanilla Select
Standalone replacement for select boxes.
Stars: ✭ 12 (-63.64%)
Mutual labels:  search
Opensse
Open Sketch Search Engine- 3D object retrieval based on sketch image as input
Stars: ✭ 883 (+2575.76%)
Mutual labels:  search
Blast
Blast is a full text search and indexing server, written in Go, built on top of Bleve.
Stars: ✭ 934 (+2730.3%)
Mutual labels:  search
App Search Node
Elastic App Search Official Node.js Client
Stars: ✭ 29 (-12.12%)
Mutual labels:  search
Search Ui
🔍 A set of UI components to build a fully customized search!
Stars: ✭ 24 (-27.27%)
Mutual labels:  search
Cerebro
Open-source productivity booster with a brain
Stars: ✭ 7,181 (+21660.61%)
Mutual labels:  search
Globus Sdk Python
Globus SDK for Python
Stars: ✭ 32 (-3.03%)
Mutual labels:  search
Meme Glossary
Meme serving with NLP
Stars: ✭ 30 (-9.09%)
Mutual labels:  search
Spimedb
EXPLORE & EDIT REALITY
Stars: ✭ 14 (-57.58%)
Mutual labels:  search

manticoresearch-php

Build Status Scrutinizer Code Quality codecov.io Latest Stable Version License Slack

Total Downloads Monthly Downloads Daily Downloads composer.lock

GitHub Code Size GitHub Repo Size GitHub Last Commit GitHub Activity GitHub Issues

Official PHP client for Manticore Search.

Features

  • One to one mapping with the HTTP API
  • connection pools with pluggable selection strategy. Defaults to static round robin
  • pluggable PSR/Log interface
  • pluggable transport protocols.
  • persistent connections

Requirements

Requires PHP 7.1 or greater with the native JSON extension. Default transport handler uses the cURL extension.

Minimum Manticore Search version is 2.5.1 with HTTP protocol enabled.

Manticore Search manticoresearch-php PHP
>= 3.5.2 1.6.x >= 7.1, >=8.0
>= 3.5.0 1.5.x >= 7.1, <8.0
>= 3.5.0 1.4 >= 7.1, <8.0
<= 3.4.x 1.3 >= 7.1, <8.0
>= 2.5.1, <3.4.0 1.2 >= 7.1, <8.0

Documentation

Full documentation is available in docs folder.

Manticore Search server documentation: https://manual.manticoresearch.com/.

Getting Started

Install the Manticore Search PHP client using composer package manager:

composer require manticoresoftware/manticoresearch-php

Initiate an index:

require_once __DIR__ . '/vendor/autoload.php';

$config = ['host'=>'127.0.0.1','port'=>9308];
$client = new \Manticoresearch\Client($config);
$index = $client->index('movies');

Create the index:

$index->create([
    'title'=>['type'=>'text'],
    'plot'=>['type'=>'text'],
    'year'=>['type'=>'integer'],
    'rating'=>['type'=>'float']
    ]);

Add a document:

$index->addDocument([
        'title' => 'Star Trek: Nemesis',
        'plot' => 'The Enterprise is diverted to the Romulan homeworld Romulus, supposedly because they want to negotiate a peace treaty. Captain Picard and his crew discover a serious threat to the Federation once Praetor Shinzon plans to attack Earth.',
        'year' => 2002,
        'rating' => 6.4
        ],
    1);

Add several documents at once:

$index->addDocuments([
        ['id'=>2,'title'=>'Interstellar','plot'=>'A team of explorers travel through a wormhole in space in an attempt to ensure humanity\'s survival.','year'=>2014,'rating'=>8.5],
        ['id'=>3,'title'=>'Inception','plot'=>'A thief who steals corporate secrets through the use of dream-sharing technology is given the inverse task of planting an idea into the mind of a C.E.O.','year'=>2010,'rating'=>8.8],
        ['id'=>4,'title'=>'1917 ','plot'=>' As a regiment assembles to wage war deep in enemy territory, two soldiers are assigned to race against time and deliver a message that will stop 1,600 men from walking straight into a deadly trap.','year'=>2018,'rating'=>8.4],
        ['id'=>5,'title'=>'Alien','plot'=>' After a space merchant vessel receives an unknown transmission as a distress call, one of the team\'s member is attacked by a mysterious life form and they soon realize that its life cycle has merely begun.','year'=>1979,'rating'=>8.4]
    ]); 

Perform a search:

$results = $index->search('space team')->get();

foreach($results as $doc) {
   echo 'Document:'.$doc->getId()."\n";
   foreach($doc->getData() as $field=>$value)
   {   
        echo $field.": ".$value."\n";
   }
}

Result:

Document:2
year: 2014
rating: 8.5
title: Interstellar
plot: A team of explorers travel through a wormhole in space in an attempt to ensure humanity's survival.

A text search with attribute filters:

$results = $index->search('space team')
                 ->filter('year','gte',2000)
                 ->filter('rating','gte',8.0)
                 ->sort('year','desc')
                 ->get();

foreach($results as $doc) {
    echo 'Document:'.$doc->getId()."\n";
    foreach($doc->getData() as $field=>$value)
    {   
        echo $field.": ".$value."\n";
    }
}

Update documents:

By document id:

$index->updateDocument(['year'=>2019],4);

By query:

$index->updateDocument(['year'=>2019],['match'=>['*'=>'team']]);

Get index schema:

$index->describe();

Drop index:

$index->drop();

The above will fail if the index does not exist. To get around this pass a parameter of true, which cause the failure to be silent.

$index->drop(true);

License

Manticore Search PHP Client is an open-source software licensed under the Apache v2.0 license

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].