PHP code example of se7enxweb / expquery-translator

1. Go to this page and download the library: Download se7enxweb/expquery-translator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

se7enxweb / expquery-translator example snippets


$qt = new expQueryTranslator();

$analysis = $qt->analyze( 'foo -bar #folder "new york"' );
$filtered = $qt->filterNodes( $nodes, 'news -old #article' );
$params   = $qt->buildSubtreeParams( '#article', array( 'Limit' => 25 ) );

// $analysis[''exclude'] => array( 'bar' )
// $analysis['tags']    => array( 'folder' )
// $analysis['users']   => array()
// $analysis['raw']     => 'foo -bar #folder "new york"'

$params = $qt->buildSubtreeParams( $query, array(
    'Limit'  => 10,
    'Offset' => 0,
    'SortBy' => array( 'name', true ),
) );
$nodes = eZContentObjectTreeNode::subTreeByNodeID( $params, $parentNodeId );
$nodes = $qt->filterNodes( $nodes, $query );

use QueryTranslator\Languages\Galach\Tokenizer;
use QueryTranslator\Languages\Galach\TokenExtractor\Full;

$tokenizer = new Tokenizer( new Full() );
$sequence = $tokenizer->tokenize( 'foo -bar #baz "hello world"' );