Download the PHP package neoslive/hybridsearch without Composer

On this page you can find all versions of the php package neoslive/hybridsearch. 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 hybridsearch

HybridSearch

HybridSearch is a powerful realtime search engine written in Javascript/AngularJS based on an intelligent indexing mechanism powered by Google Firebase (noSQL). Hybrid stands for the innovative way of streaming search results. Every search request delivers small and preselected data blocks and then they are processed client side for calculation the search result. Whenever data of the source application (Neos CMS, Magento, etc.) was changed, HybridSearch updates the search index und performs a live update of current search results - that's why we call it realtime search engine. The search engine was invented by Michael Egli in 2016 and it's a free open source software. Special thanks to Oliver Nightingale (lunr.js) and Wei Song (elasticlunr.js).

Features

Demo / Show case

Implementations

HybridSearch comes with default integration for Neos CMS. Other implementations can be done very easy. Default Implementation for Magento is coming soon.

Installation with Neos

Backend

Minimal configuration

composer require neoslive/hybridsearch

Create new a firebase project for free. Then you need a database token. Open your firebase project settings and create new database secret/token (see service accounts > Database secrets).

Add to your flow Settings.yaml (minimal configuration)

Optimal configuration

Example of Settings.yaml

If you are using optimal configuration, then you need also something like following settings.

TypoScript (root.ts)

NodeTypes.yaml

Indexing your data

Run flow command for initial indexing your Neos Site

php ./flow hybridsearch:createfullindex

For better semantic you should use optimal configuration and don't index all of your node types. The indexer is rendering every node as a standalone front-end view and not simple raw data, so initially it takes time. But the result is magic.

If you have set "Realtime: true", then all further changes are done automatically as an intelligent background job asynchronously and without any performance impacts while editing in Neos backend.

It's recommended to execute full index creating from time to time. Just create a cronjob like this one:

1 1 * * 1 FLOW_CONTEXT=Production php -d memory_limit=8096M /home/www-data/flow hybridsearch:createfullindex >/dev/null 2>&1

So, while your index is creating you should not waiting and do the frontend integration.

Front-End

Add the following javascript files to your layout/template.

Create an Angular Controller.

Create an HTML search page.

HybridSearch own JavaScript Framework

HybridSearch provides a javascript framework for creating fantastic user experience. Create robust search-as-you-type, lists, facet-filters, etc. in minutes - and everything is wired to the realtime index without writing one line of code.

Initializing

$HybridsearchObject (define the search request)

This is the main request object, where all methods are called that are defining the search request.

Configuration methods

This methods are influencing the behavior of the search result.

setNodeTypeLabels

For each resulting nodeType the search engine creates a group name by the nodeType. So you can easy create facetted search results, etc.. With the method setNodeTypeLabels you are able to combine several nodeType groups into one.

Arguments
Param Type Details
nodetypelabels Object set nodeType labels grouped result
Returns

{HybridsearchObject} the search object

Examples

setPropertiesBoost

Adjust the relevance score calculation for each nodeType property. Higher values means higher relevance score for matching properties.

Arguments
Param Type Details
boost Object Adjust the relevance score
Returns

{HybridsearchObject} the search object

Examples

setParentNodeTypeBoostFactor

Adjust the relevance score calculation for each node by parent node type. The given boost value is the factor that is applied to the relavence score of each node.

Arguments
Param Type Details
boost Object Adjust the relevance score by given factor
Returns

{HybridsearchObject} the search object

Examples

Filtering methods

This methods are restricting the search result.

setQuery

Sets a query for the search. If scope is given, then threat the param as reference to the scopes variable and watch automatically for any changes. If param scope is undefined then search for the string itself.

Arguments
Param Type Details
query String query search for
scope (optional) Scope angular scope
Returns

{HybridsearchObject} the search object


setNodeType

Sets the nodeType (example 'vendor-package-contact'). If scope is given, then threat the param as reference to the scopes variable and watch automatically for any changes. If param scope is undefined then search for the string itself. NodeTypes are equivalent to Neos NodeTypes, but all special chars a replaced with '-' and everything is lowercase.

Arguments
Param Type Details
nodeType String restrict search to given NodeType
scope (optional) Scope angular scope
Returns

{HybridsearchObject} the search object

addPropertyFilter

Adds a property filter that restrict the search result. If scope is given, then threat the param as reference to the scopes variable and watch automatically for any changes. If param scope is undefined then search for the string itself.

Arguments
Param Type Details
property String name of the property to filter
value String, ArrayLike, ObjectLike value(s) to filter
scope (optional) Scope angular scope
inverted (optional) boolean true filter is inverted
booleanmode (optional) boolean false if all array values must match all
nodeType (optional) string apply filter only to given nodeType
Returns

{HybridsearchObject} the search object

Examples

setNodePath

Sets the node path (or uri segment) that is the entry point searching for. If scope is given, then threat the param as reference to the scopes variable and watch automatically for any changes. If param scope is undefined then search for the string itself. NodeTypes are equivalent to Neos NodeTypes, but all special chars a replaced with '-' and everything is lowercase.

Arguments
Param Type Details
nodePath String restrict search to given node path
scope (optional) Scope angular scope
Returns

{HybridsearchObject} the search object

Examples

Preprocessing methods

This methods are called before the search filters are applied.

addNodesByIdentifier

Add nodes to local search index by given node identifiers (uuid). If the there are no further restrictions (filters), then the added nodes are added to the search result.

Arguments
Param Type Details
nodes Array add nodes to search result
Returns

{HybridsearchObject} the search object

Examples

Postprocessing methods

This methods are called after the search result was calculated.

setOrderBy

Sets orderings for the result. You can order the result in template view, but then you cannot use the limit/paginate method. Orderings are configured per nodeType or nodeTypeLabel. Ordering cannot be DESC because its an internal behavior of complex search algorithm.

Arguments
Param Type Details
orderBy Object set orderings for each given nodeType or nodeTypeLabel
Returns

{HybridsearchObject} the search object

Examples

setGroupedBy

Group the result by given identifiers. With this groupedBy function you can filter out duplicates from the search result. GroupedBy are configured per nodeType or nodeTypeLabel.

Arguments
Param Type Details
groupBy Object set groupBy for each given nodeType or nodeTypeLabel
Returns

{HybridsearchObject} the search object

Examples

Runtime methods

This methods are called not more than once while initializing.

$watch

Watching the {HybridsearchResultsObject} for any changes.

Returns

{HybridsearchObject} the search object

Examples

$bind

Bind the {HybridsearchResultsObject} to given scope variable.

Arguments
Param Type Details
variable String scope variable name for binding to
scope Scope angular scope
Returns

{HybridsearchObject} the search object

Examples

$HybridsearchResultsObject (define the search result)

This is the main result object, where all methods are called that are presenting the search result.

Runtime methods

isLoading

Check if search is in progress. Return false when current search is done.

Returns

{boolean} if search is done or not

Examples

Counter methods

The counter methods delivers statistics about current search result.

count

Get number of nodes in current result (excluding turbo nodes)

Returns

{Integer} number of nodes excluding turbonodes

Examples

countAll

Get number of nodes in current result (including turbo nodes)

Returns

{Integer} number of nodes including turbo nodes


countTurboNodes

Get number of turbo nodes nodes in current result

Returns

{Integer} number of turbo nodes


countByNodeType

Get number of nodes in current result by node type

Arguments
Param Type Details
nodeType String nodeType
Returns

{Integer} number of nodes


countByNodeTypeLabel

Get number of nodes in current result by node type label

Arguments
Param Type Details
nodeTypeLabel String nodeType label
Returns

{Integer} number of nodes


getDistinctCount

Get number of different values (distinct) of current search result.

Arguments
Param Type Details
property String name of the property for distinct calculcation
Returns

{Integer} number of different values

Getter methods

The getter methods delivers the result as collection {HybridsearchResultsNode}.

getNodes

Get result collection (excluding turbo nodes)

Arguments
Param Type Details
limit (optional) Integer number of results
Returns

{Array} Collection of HybridsearchResultsNode

Examples

getTurboNodes

Get result collection (only turbo nodes)

Arguments
Param Type Details
limit (optional) Integer number of results
Returns

{Array} Collection of HybridsearchResultsNode


getNodesByNodeType

Get result collection by node type

Arguments
Param Type Details
nodeType String node type
Returns

{Array} Collection of HybridsearchResultsNode


getNodesByNodeTypeLabel

Get result collection by node type label

Arguments
Param Type Details
nodeType String node type label
Returns

{Array} Collection of HybridsearchResultsNode


getDistinct

Get distinct values of given property

Arguments
Param Type Details
property String name of the property for distinct calculcation
Returns

{Object.value} Value {Object.count} Number of nodes containing this value.


getGrouped

Get alle nodes from current search result a grouped object.

Returns

{HybridsearchResultsGroupObject} Result groups

Examples

Where result is scope variable with binding to HybridsearchResultsObject (see $bind)


$HybridsearchResultsGroupObject (define a group of result)

This object is representing a grouped result.

count

Get number of items in group object

Returns

{Integer} number of items

getItems

Get group items as array

Returns

{array} collection of {HybridsearchResultsDataObject}


$HybridsearchResultsDataObject (define a set of results)

This object is representing a group of result items.

count

Get number of items in this group

Returns

{Integer} number of items

getLabel

Get groups label

Returns

{String} label of group

getNodes

Get result collection (excluding turbo nodes)

Arguments
Param Type Details
limit (optional) Integer number of results
Returns

{Array} Collection of HybridsearchResultsNode

getProperty

Get value of first node in the group by given property. This is useful for getting values for grouped objects.

Arguments
Param Type Details
property String Name of the property
Returns

{Mixed} Properties value


$HybridsearchResultsNode (define a single result item/node)

This object is representing a single result item.

Getter methods

The getter methods delivers all informations about the item.

getNodeType

Get the node type.

Returns

{String} node type


getScore

Get the relevance score of the items.

Returns

{integer} relevance score (highest value is highest relevance)


isTurboNode

Check if its a turbo node or a normal node.

Returns

{boolean} true if is a turbo node, false is default node


getBreadcrumb

Get breadcrumb as HTML code (if its a document node).

Returns

{String} HTML


getUrl

Get Url (if its a document node).

Returns

{String} url


getPreview

Get rendered preview of node.

Arguments
Param Type Details
maxlength (optional) Integer max. length of preview text
Returns

{String} preview content


getSortingIndex

Get sorting index of node.

Returns

{Integer} sorting index value


getProperty

Get value by given property.

Arguments
Param Type Details
property String Name of the property
Returns

{Mixed} Properties value

Examples

getDocumentNode

Get the nearest document node.

Returns

{HybridsearchResultsNode} HybridsearchResultsNode containing breadcrumb and url

Examples

All versions of hybridsearch with dependencies

PHP Build Version
Package Version
Requires ktamas77/firebase-php Version *
neitanod/forceutf8 Version *
google/apiclient Version *
algolia/algoliasearch-client-php Version *
ramsey/uuid Version ^3.0.0
symfony/console Version *
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 neoslive/hybridsearch contains the following files

Loading the files please wait ....