Beta version

class DocumentSearchHandler extends AbstractSearchHandler

Class DocumentSearchHandler

Methods

__construct(Client $client, EntityManager $em, LoggerInterface $logger = null)

No description

array
searchWithHighlight(string $q, array $args = array(), int $rows = 20, boolean $searchTags = false, int $proximity = 10000000, int $page = 1)

Search on Solr with pre-filled argument for highlighting

array
search(string $q, array $args = array(), int $rows = 20, boolean $searchTags = false, int $proximity = 10000000, int $page = 1)

Search on Solr.

int
count($q, array $args = array(), int $rows, bool $searchTags = false, int $proximity = 10000000)

No description

Details

in AbstractSearchHandler at line 46
__construct(Client $client, EntityManager $em, LoggerInterface $logger = null)

Parameters

Client $client
EntityManager $em
LoggerInterface $logger

in AbstractSearchHandler at line 116
array searchWithHighlight(string $q, array $args = array(), int $rows = 20, boolean $searchTags = false, int $proximity = 10000000, int $page = 1)

Search on Solr with pre-filled argument for highlighting

  • $q is the search criteria.
  • $args is a array with solr query argument. The common argument can be found here and for highlighting argument is here.

Parameters

string $q
array $args
int $rows
boolean $searchTags Search in tags/folders too, even if a node don’t match
int $proximity Proximity matching: Lucene supports finding words are a within a specific distance away.
int $page

Return Value

array Return a array of tuple for each result. [document, highlighting] for Documents and [nodeSource, highlighting]

Search on Solr.

  • $q is the search criteria.
  • $args is a array with solr query argument. The common argument can be found here and for highlighting argument is here.

You can use shortcuts in $args array to filter:

For node-sources:

  • status (int)
  • visible (boolean)
  • nodeType (RZ\Roadiz\Core\Entities\NodeType or string or array)
  • tags (RZ\Roadiz\Core\Entities\Tag or array of Tag)
  • translation (RZ\Roadiz\Core\Entities\Translation)

For other filters, use $args['fq'][] array, eg.

$args["fq"][] = "title:My title";

this explicitly filter by title.

Parameters

string $q
array $args
int $rows Results per page
boolean $searchTags Search in tags/folders too, even if a node don’t match
int $proximity Proximity matching: Lucene supports finding words are a within a specific distance away. Default 10000000
int $page Retrieve a specific page

Return Value

array Return an array of doctrine Entities (Document, NodesSources)

in AbstractSearchHandler at line 184
int count($q, array $args = array(), int $rows, bool $searchTags = false, int $proximity = 10000000)

Parameters

$q
array $args
int $rows Useless var but keep it for retrocompatibility
bool $searchTags
int $proximity Proximity matching: Lucene supports finding words are a within a specific distance away. Default 10000000

Return Value

int