Skip to content

Commit 0b06c96

Browse files
committed
Add lib description and improve demo steps
1 parent c8e29b0 commit 0b06c96

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

README.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,30 @@
66
[![Latest stable](https://img.shields.io/packagist/v/netgen/query-translator.svg?style=flat-square)](https://packagist.org/packages/netgen/query-translator)
77
[![License](https://img.shields.io/packagist/l/netgen/query-translator.svg?style=flat-square)](https://packagist.org/packages/netgen/query-translator)
88

9-
## How to run a demo
9+
Query Translator is a search query [translator](https://en.wikipedia.org/wiki/Translator_(computing))
10+
with [abstract syntax tree](https://en.wikipedia.org/wiki/Abstract_syntax_tree) representation.
11+
It takes a search query as a user input and converts it into something a specific search
12+
backend can understand. AST representation means that output of the parser is a hierarchical tree
13+
structure. It represents the syntax of the given query in an abstract way and it's easy to process
14+
using [tree traversal](https://en.wikipedia.org/wiki/Tree_traversal).
1015

11-
1. Clone the repository
16+
Query language implementation is named [Galach](https://github.com/netgen/query-translator/tree/master/lib/Languages/Galach).
17+
18+
### Use cases
19+
20+
1. Common query language on top of multiple search backends
21+
2. Better control over options of the query language provided by the search backend
22+
3. Post-processing user's query input
23+
4. Customization of the query language
24+
5. ...
25+
26+
This implementation is a [library](https://en.wikipedia.org/wiki/Library_(computing)), meaning it
27+
doesn't intend to solve a specific use case for query translation. Instead, it's meant as a base that
28+
you can use in implementing such a use case.
29+
30+
## Run the demo
31+
32+
1. Clone the repository and position into it
1233
2. Generate autoloader using composer `composer dump-autoload -o`
1334
3. Start the web server with demo document root `php -S localhost:8005 -t demo`
14-
4. Open http://localhost:8005 in your browser
35+
4. Open [http://localhost:8005](http://localhost:8005) in your browser

0 commit comments

Comments
 (0)