All Projects → VincentFoulon80 → php-search

VincentFoulon80 / php-search

Licence: MIT License
A Lucene-inspired PHP Search engine library

Programming Languages

PHP
23972 projects - #3 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to php-search

bitshift
A semantic search engine for source code
Stars: ✭ 30 (+87.5%)
Mutual labels:  search-engine
Search Ads Web Service
Online search advertisement platform & Realtime Campaign Monitoring [Maybe Deprecated]
Stars: ✭ 30 (+87.5%)
Mutual labels:  search-engine
JASSv2
Experimental search engine in C/C++17 - still in early development.
Stars: ✭ 22 (+37.5%)
Mutual labels:  search-engine
Free-Internet-Plugin
A free Internet is a better Internet. This Chrome browser plugin removes paywalled content from Google search results.
Stars: ✭ 121 (+656.25%)
Mutual labels:  search-engine
openverse-api
The Openverse API allows programmatic access to search for CC-licensed and public domain digital media.
Stars: ✭ 41 (+156.25%)
Mutual labels:  search-engine
sonar-tantivy
Search engine based on tantivy with a Node.js frontend
Stars: ✭ 30 (+87.5%)
Mutual labels:  search-engine
dotnetlive.search
Asp.Net Core + ElasticSearch
Stars: ✭ 18 (+12.5%)
Mutual labels:  search-engine
fastmorph
Fast corpus search engine originally made for the Corpus of Written Tatar language
Stars: ✭ 14 (-12.5%)
Mutual labels:  search-engine
openverse-catalog
Identifies and collects data on cc-licensed content across web crawl data and public apis.
Stars: ✭ 27 (+68.75%)
Mutual labels:  search-engine
elliotforwater.com
Webapp which run the https://elliotforwater.com/ website
Stars: ✭ 15 (-6.25%)
Mutual labels:  search-engine
collector-filesystem
Norconex Filesystem Collector is a flexible crawler for collecting, parsing, and manipulating data ranging from local hard drives to network locations into various data repositories such as search engines.
Stars: ✭ 17 (+6.25%)
Mutual labels:  search-engine
bing-ip2hosts
bingip2hosts is a Bing.com web scraper that discovers websites by IP address
Stars: ✭ 99 (+518.75%)
Mutual labels:  search-engine
james
Fast and extendable modern launcher for Windows
Stars: ✭ 32 (+100%)
Mutual labels:  search-engine
see
Search Engine in Erlang
Stars: ✭ 27 (+68.75%)
Mutual labels:  search-engine
app-search-flask-app
This is an example of a Python Flask app with Elasticsearch/ Elastic App Search with respective Python Clients
Stars: ✭ 17 (+6.25%)
Mutual labels:  search-engine
vim-www
Toolbox to open & search URLs from vim
Stars: ✭ 32 (+100%)
Mutual labels:  search-engine
open-semantic-desktop-search
Virtual Machine for Desktop Search with Open Semantic Search
Stars: ✭ 22 (+37.5%)
Mutual labels:  search-engine
indieweb-search
Source code for the IndieWeb search engine.
Stars: ✭ 16 (+0%)
Mutual labels:  search-engine
ISeeNN
A CNN feature based image retrieval website
Stars: ✭ 15 (-6.25%)
Mutual labels:  search-engine
Kotlin-Coroutine-Flow
Search engine functionality using Kotlin Coroutines and Flow
Stars: ✭ 25 (+56.25%)
Mutual labels:  search-engine

Demo

A small demo of this search engine is available here. This demo is made with a dataset of 1000 movies from 2006 and 2016. The results are provided as you type.

Installation

install this library via Composer :

composer require vfou/php-search 1.1

What can it do ?

in short :

  • indexing and searching documents (with score, fuzzy search and tokenization)
  • Stemming and stop-words of 12 supported languages
  • Faceting
  • Autocompletion
  • Connex Search

Take a look at the Feature Page for a more complete listing

Quick start

The search engine is packaged with an example schema that allow you to take hand quickly on the library.

at first you need to load the search engine.

use VFou\Search\Engine;

$engine = new Engine();

You can give an array in parameter of the class constructor, see the wiki's configuration page for more informations.

By constructing the engine, there'll be some directory that appeared next to your index file :

  • var/engine/index
  • var/engine/documents
  • var/engine/cache

(All these directories can be changed with the configuration array)

At first, you have to give to the engine something to search for. We'll create some documents and ask the engine to index them.

$doc = [
    "id" => 1,
    "type" => "example-post",
    "title" => "this is my first blog post !",
    "content" => "I am very happy to post this first post in my blog !",
    "categories" => [
        "party",
        "misc."
    ],
    "date" => "2018/01/01",
    "comments" => [
        [
            "author" => "vincent",
            "date" => "2018/01/01",
            "message" => "Hello world!"
        ],
        [
            "author" => "someone",
            "date" => "2018/01/02",
            "message" => "Welcome !"
        ]
    ]
];
$engine->update($doc);
$doc = [
    "id" => 2,
    "type" => "example-post",
    "title" => "This is the second blog post",
    "content" => "a second one for fun",
    "date" => "2018/01/05",
    "categories" => [
        "misc."
    ],
    "comments" => [
        [
            "author" => "someone",
            "date" => "2018/01/05",
            "message" => "Another one ?!"
        ]
    ]
];
$engine->update($doc);

Note : you can also put these two documents in one array and use the updateMultiple() function for indexing multiple documents at once.

Now that you documents are indexed, you can use the search function and fetch results :

$response = $engine->search('second post');
var_dump($response);

$response = $engine->search('post');
var_dump($response);

For more informations about this library, like using more advanced features, go to the wiki page of this repository

Admin Panel

⚠️ Warning : This panel does not handle any security by itself. If you use it, it's up to you to prevent the public from accessing it !

The Admin panel is a class that need to be instantiated and then run. It's not a callable file so you'll need to call it via a regular php file :

<?php

use VFou\Search\AdminPanel;

// include the composer autoload file, modify the path if needed
require "vendor/autoload.php";

// securize your file access or directly here
// if($_SERVER['REMOTE_ADDR'] != "127.0.0.1") exit('unauthorized');

// instantiate the panel and then run it
$admin = new AdminPanel();
echo $admin->run();

the AdminPanel's constructor accept as first parameter the same config array as you may use to instanciate the Engine, and you'll want to pass it if you have customized schemas. (or else the panel will not work properly)

More informations in the Admin Panel Manual

License

This library is under the MIT license. See the complete 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].