Smart.Framework Logo

final class \SmartSolrDb
{ } ->

Class Smart Solr (DB) Client


class Methods

public function get_ext_version ( ) {} -> STRING
@return: {STRING} Solr extension version
Get the Solr Extension version
public function findQuery ( string $y_query, array $y_options = ["mode" => "phrase", "settings" => [], "sort" => [], "filters" => [], "facets" => [], "fields" => [], "boost" => [], "mlt" => []] ) {} -> ARRAY
public function addDocument ( array $arrdoc, int $use_autocommit = 0 ) {} -> INT
public function deleteDocument ( string $id ) {} -> INT

class Properties


class Constants


Sample code: PHP

<?php

// Usage example:
 //--
 $mySolr = new SmartSolrDb();
 //--
    $data = $mySolr->findQuery(
        'word1 word2', // this is a real Solr Query and must be escaped in a proper way using SolrUtils::escapeQueryChars()
        [
            'settings' => [
                'start'             => 0, // offset
                'rows'                 => 10, // limit
            ],
            'sort' => [
                'score' => -1
            ],
            'filters' => [
                '!id' => 'ID1', // not ID1
                'category' => 'Some Categ',
                'subcategory' => 'Some Sub-Categ'
            ],
            'fields' => [] // all
        ]
    );
 //--

// #end php code


documentation generated on: 2024-12-16 17:13:20 +0000


Smart.Framework © 2009-2024 unix-world.org