internations/solr-utils

Solr/Lucene utilities for PHP

v0.10.0 2022-08-01 10:20 UTC

README

Test

SolrUtils help with recurring tasks when working with Solr like escaping and sanitizing user input.

use InterNations\Component\Solr\Expression\Expression\Util;

// Quote a string to be used in a query
Util::quote('(term)'); // "\(term\)"

// Escape a string but not quote it
Util::escape('(term)'); // \(term\)

// Sanitize a string to be used safely in a query
Util::sanitize('term'); // term