internations / solr-query-component
轻松构建 Solr 查询
0.13.0
2022-08-01 10:19 UTC
Requires
- php: >=7.4
- internations/solr-utils: ~0.8
- lstrojny/functional-php: ~0.1|~1.0
Requires (Dev)
This package is auto-updated.
Last update: 2024-08-29 03:41:51 UTC
README
轻松构建 Solr 查询
SolrQueryComponent
帮助使用查询构建器 API 构建 Solr/Lucene/ElasticSearch 查询。它与具体的客户端库无关,可以与例如 PECL Solr 或 Solarium 一起使用。
示例
构建 name:"John Doe"^100
<?php use InterNations\Component\Solr\Expression\ExpressionBuilder; $eb = new ExpressionBuilder(); echo $eb->field('name', $eb->boost($eb->eq('John Doe'), 100));
同样可以使用查询字符串对象
<?php use InterNations\Component\Solr\Query\QueryString; echo (new QueryString('name:<name>^<boost>')) ->setPlaceholder('name', 'John Doe') ->setPlaceholder('boost', 100);
有关如何在 docs/ 中使用该组件的更多信息。