• Stars
    star
    198
  • Rank 191,557 (Top 4 %)
  • Language
    PHP
  • License
    MIT License
  • Created about 7 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Query Translator is a search query translator with AST representation

Query Translator

Build Status Code Coverage Downloads Latest stable License PHP

Query Translator takes a search string as user input and converts it into something a search backend can understand. Technically, it's a search query translator with abstract syntax tree representation. From the produced syntax tree, translation target can be anything you need. Usually it's a search backend, like Solr and Elasticsearch, or a database abstraction layer.

A set of interfaces for implementing a language processor is provided, with a single implemented language named Galach. Galach implements a syntax that is based on what seems to be the unofficial standard for search query as user input. Quick cheat sheet:

word "phrase" (group) +mandatory -prohibited AND && OR || NOT ! #tag @user domain:term

Error handling

User input means you have to expect errors and handle them gracefully. Because of that, the parser is completely resistant to errors. Syntax tree will contain detailed information about corrections applied to make sense of the user input. This can be useful to clean up the input or implement rich input interface, with features like suggestions, syntax highlighting and error feedback.

Customization

The implementation was made with customization in mind. You can change the special characters which will be used as part of the syntax, pick out elements of the language you want to use, implement your own term clauses, or change how the syntax tree is converted to the target output.

Some use cases

  • User-level query language on top of your search backend
  • Common query language on top of different search backends
  • Control over options of the query language that is already provided by the search backend
  • Better error handling than provided by the search backend
  • Analysis and manipulation of the query before sending to the backend
  • Customized query language (while remaining within the base syntax)
  • Implementing rich input interface (with suggestions, syntax highlighting, error feedback)

Note: This implementation is intended as a library, meaning it doesn't try to solve specific use cases for query translation. Instead, it's meant to be a base that you can use in implementing such a use case.

How to use

First add the library to your project:

composer require netgen/query-translator:^1.0

After that, make use of the features provided out of the box. If those are not enough, use extension points to customize various parts of the translator to fit your needs. See Galach documentation to find out more.

Run the demo

Demo is available as a separate repository at netgen/query-translator-demo.

Steps for running the demo:

  1. Create the demo project using composer composer create-project netgen/query-translator-demo
  2. Position into the demo project directory cd query-translator-demo
  3. Start the web server with src as the document root php -S localhost:8005 -t src
  4. Open http://localhost:8005 in your browser Query Translator demo

More Repositories

1

TagsBundle

Netgen Tags Bundle is an eZ Platform bundle for taxonomy management and easier classification of content, providing more functionality for tagging content than ezkeyword field type included in eZ Platform kernel.
PHP
48
star
2

ezplatform-site-api

Netgen's Site API is site building productivity layer for eZ/Ibexa Platform
PHP
37
star
3

NetgenAdminUIBundle

Netgen Admin UI implements an alternate administration UI for eZ Platform, based on eZ Publish Legacy administration interface
Smarty
33
star
4

ezplatform-sylius

eZ Platform and Sylius eCommerce integration
Shell
32
star
5

media-site

Netgen Media Site (Powered by Netgen Layouts & eZ Platform)
Twig
30
star
6

NetgenEzSyliusBundle

Bundle supporting integration of eZ Platform & Sylius eCommerce
PHP
24
star
7

vagrant-ansible-ezpublish

Vagrant setup with Ansible provisioner configured for running eZ Publish projects
Ruby
23
star
8

javascript-cookie-control

Javascript module for controling cookie consent on your website
JavaScript
19
star
9

ngsymfonytools

Netgen Symfony Tools is an eZ Publish 4 extension that provides a way to include Twig templates, as well as running Symfony sub-requests, directly from the eZ Publish legacy templates.
PHP
19
star
10

NetgenInformationCollectionBundle

Information collection alike feature for eZ Publish 5/eZ Platform
PHP
19
star
11

NetgenEnhancedSelectionBundle

Netgen Enhanced Selection Bundle is an eZ Publish and eZ Platform bundle that provides a field type that reimplements ezselection field type.
PHP
19
star
12

NetgenRemoteMediaBundle

Netgen Remote Media Bundle is an eZ Platform and eZ Publish extension providing field type which supports remote resource providers such as Cloudinary.
PHP
18
star
13

NetgenSiteAccessRoutesBundle

Netgen Siteaccess Routes Bundle is an eZ Publish / eZ Platform bundle which allows you to specify in which siteaccesses or siteaccess groups can a route be used
PHP
15
star
14

jquery.ngResponsiveTables

This jQuery plugin converts regular table view into user friendly table for mobile devices.
HTML
14
star
15

NetgenOpenGraphBundle

Netgen Open Graph Bundle is an eZ Publish and eZ Platform bundle that allows simple integration with Open Graph protocol.
PHP
14
star
16

ezplatform-search-extra

Netgen's extra bits for eZ Platform search
PHP
13
star
17

ezpublish-community-sylius

eZ Publish 5 & Sylius E-Commerce integration
PHP
13
star
18

NetgenEzFormsBundle

Integration of Symfony's Form component with eZ Publish / eZ Platform Public API
PHP
11
star
19

NetgenContentTypeListBundle

Netgen Content Type List Bundle is an eZ Publish and eZ Platform bundle that provides a field type to select and store a list of content type identifiers.
PHP
10
star
20

ezplatformsearch

eZ Platform Search is an eZ Publish legacy extension that integrates eZ Platform search capabilities into eZ Publish legacy
PHP
10
star
21

HtmlPdfApi

HTMLPDFAPI provides an easy way for generating PDF documents from HTML code.
PHP
10
star
22

NetgenRichTextDataTypeBundle

Netgen RichText datatype bundle allows eZ Publish Legacy to work with rich text (ezrichtext) field type available in eZ Platform
PHP
10
star
23

site-bundle

Netgen Site Bundle is an eZ Platform bundle that implements common features that are used by Netgen to implement websites
PHP
9
star
24

NetgenAdminUISyliusBundle

This bundle integrates Sylius into Netgen Admin UI
CSS
8
star
25

ngconnect

Netgen Connect is a simple eZ Publish extension able to provide user sign in by using social network authentication and authorization.
PHP
8
star
26

ezpublish-kernel

eZ Publish API and kernel. This is the heart of eZ Publish 5. This is a v2014.11 kernel, maintained for bugfixes by Netgen.
PHP
8
star
27

query-translator-demo

Demo project for the Query Translator library
PHP
8
star
28

LiveVotingBundle

Voting application for Web Summer Camp
JavaScript
8
star
29

HtmlPdfApiBundle

HTMLPDFAPI provides an easy way for generating PDF documents from HTML code.
PHP
8
star
30

media-site-data

Demo data for Netgen Media Site
7
star
31

NetgenBirthdayBundle

This bundle provides an eZ Publish / eZ Platform field type that stores the date in the format of YYYY-MM-DD in the attribute data_text field
PHP
7
star
32

ngpush

Netgen Push provides a simple and effective way to push any kind of content from eZ Publish to various social networks.
PHP
6
star
33

ngresponsiveimages

eZ Publish 4 extension that eases creation and usage of responsive images by leveraging eZ Publish image aliases
JavaScript
6
star
34

site-generator-bundle

This bundle generates a Netgen Site project
PHP
6
star
35

NetgenEzSocialConnectBundle

Integration of HWIOAuth bundle for social login with eZ Platform / eZ Publish
PHP
6
star
36

summercamp-2015

Vagrant setup with Ansible provisioner configured for running Summer Camp 2015 virtual machine
Shell
6
star
37

NetgenDemoSiteApp

Netgen Demo Site App is a prototype application built with React Native (v0.33) that fetches content from eZ Publish REST API.
JavaScript
6
star
38

NetgenOpenWeatherMapBundle

Netgen OpenWeatherMap Bundle is an eZ Publish / eZ Platform bundle for working with https://openweathermap.org API
PHP
6
star
39

NetgenEnhancedBinaryFileBundle

Netgen Enhanced Binary FIle Bundle is an eZ Platform bundle that provides a field type that reimplements ezbinaryfile field type.
PHP
6
star
40

metadata-bundle

Metadata bundle for eZ Platform. Based on xrowmetadata extension for eZ Publish Legacy.
PHP
5
star
41

admin-ui-styles

NPM package providing base styles for building admin UI interfaces
CSS
5
star
42

NetgenDocs

HTML
5
star
43

local-development-setup

Netgen's Local Development Setup
PHP
5
star
44

netgensearchandfilterbundle

Netgen Search And Filter Bundle is an eZ Publish 5 solution for configuring pages with custom searching and filtering
PHP
5
star
45

media-site-legacy

Variant of Netgen Media Site with Ibexa OSS and eZ Publish Legacy (Powered by Netgen Layouts)
Twig
4
star
46

site-installer-bundle

This bundle installs various Netgen Site projects
PHP
4
star
47

media-site-docs

HTML
4
star
48

site-legacy-bundle

Netgen Site Legacy Bundle is an eZ Platform bundle that implements common features that are used by Netgen to implement websites. This bundle acts as a glue between new and legacy kernels.
Smarty
4
star
49

legacy-operations-bridge

Legacy eZ Publish operations to eZ Platform bridge
PHP
4
star
50

ezpublish-legacy

eZ Publish 4.x (legacy) kernel, maintained by Netgen for compatibility with eZ Platform
PHP
4
star
51

ezclasslists

Adds a tab in the administration interface that lists objects by content class and lets you quickly edit or delete them.
Smarty
4
star
52

enhancedezbinaryfile

The Enhanced eZBinaryfile datatype makes it possible to use the information collector functionality to allow (anonymous) users to send/upload files as attachments.
PHP
4
star
53

birthday

This datatype stores the date in the format of YYYY-MM-DD in the data_text field
PHP
3
star
54

ngopengraph

Netgen Open Graph is an extension for eZ Publish CMS that allows simple integration with Open Graph protocol, either official or compatible with Facebook.
PHP
3
star
55

summercamp-2016

Repository with all workshops presented at Web Summer Camp 2016
Shell
3
star
56

open-source-skeleton

PHP
3
star
57

NetgenRSSFeedBundle

PHP
3
star
58

vagrant-ansible-ezplatform

Vagrant & Ansible setup for eZ Platform
VCL
2
star
59

nginfocollector

nginfocollector is an eZ Publish Legacy extension that integrates GDPR features into eZ Publish Legacy collected information
Smarty
2
star
60

better-ibexa-admin-ui

Better Ibexa Admin UI implements an enhanced administration UI for Ibexa DXP.
PHP
2
star
61

ngclasslist

Netgen Class List Datatype is an eZ Publish extension that provides a datatype to select and store a list of content classes.
PHP
2
star
62

LiveVoting

Voting application for Web Summer Camp
PHP
2
star
63

hideuntildate

Simple workflow for scheduling content to be revealed in eZ Publish
PHP
2
star
64

ngindexer

Netgen indexer is an extension that allows storing of data from a certain set of content objects directly to Solr document of another content object. The main purpose of the extension is to facilitate simple but powerful faceted search that would otherwise require great deal of trouble to enable or would not be possible at all.
PHP
2
star
65

enhancedselection2

The Enhanced Selection type was initially based on the standard eZ publish Selection ('ezselection') datatype. It's original intent was to provide the same functionality as the standard datatype, but store an identifier instead of an id in the contentobject attribute.
PHP
2
star
66

ezchangeclass

This extension allows to change a content object's content class.
PHP
1
star
67

query-translator-bundle

Symfony bundle providing semantic configuration for Query Translator library
1
star
68

xrowmetadata

This extension adds a data type which allows setting custom meta data in page head, per content object.
PHP
1
star
69

ibexa-site-api

Site building productivity layer for the Ibexa CMS
PHP
1
star
70

ngcomments

Netgen Comments is an eZ Publish extension that builds upon existing eZ Comments extension, adding AJAX commenting capabilities.
PHP
1
star
71

ngsuggest

This extension implements drop down suggestions on search fields using eZ Find/Solr facets. When user starts to type letters in search box suggestions are shown as drop down bellow. Suggestions are sorted by number of occurance in index. When next word is entered new suggestions are based on words before.
JavaScript
1
star