diff --git a/docs/api/public_php_api_search.md b/docs/api/public_php_api_search.md index 5166d8ce90..0c02c649d6 100644 --- a/docs/api/public_php_api_search.md +++ b/docs/api/public_php_api_search.md @@ -406,46 +406,3 @@ $query->aggregations[] = new IntegerRangeAggregation('range', 'person', 'age', In the example all values above (and including) 60 are included in the last range. See [Agrregation reference](../guide/search/aggregation_reference.md) for details of all available aggregations. - -## Faceted search - -!!! caution "Deprecated" - - Search Facets are deprecated since version v3.2. - - Use [Aggregation API](#aggregation) instead. - -!!! tip "Checking feature support per search engine" - - Faceted search is available only for the Solr search engine. - - To find out if a given search engine supports any of the advanced search capabilities, - use the [`Ibexa\Contracts\Core\Repository\SearchService::supports`](https://github.com/ibexa/core/blob/main/src/contracts/Repository/SearchService.php#L188-L199) method: - - ``` php - $facetSupport = $this->searchService->supports(SearchService::CAPABILITY_FACETS); - ``` - -Faceted search enables you to find the count of search results for each Facet value. - -To do this, you need to make use of the query's `$facetBuilders` property: - -``` php -$query->facetBuilders[] = new FacetBuilderUserFacetBuilder( - [ - 'name' => 'User', - 'type' => FacetBuilder\UserFacetBuilder::OWNER, - 'minCount' => 2, - 'limit' => 5 - ] -); - -$result = $this->searchService->findContentInfo($query); - -$output->writeln("Number of results per facet value: "); -foreach ($result->facets[0]->entries as $facetEntry) { - $output->writeln("* " . $facetEntry); -} -``` - -See [Search Facet reference](../guide/search/search.md#search-facet-reference) for details of all available Facets. diff --git a/docs/guide/persistence_cache.md b/docs/guide/persistence_cache.md index 79d2883a74..653ca873b1 100644 --- a/docs/guide/persistence_cache.md +++ b/docs/guide/persistence_cache.md @@ -29,7 +29,7 @@ Notes: order to allow clearing cache by alternative indexes. For instance tree operations or changes to Content Types are examples of operations that also need to invalidate content cache by tags. -- Search is not defined as persistence and the queries themselves are not planned to be cached as they are too complex by design (full text, facets, etc.). +- Search is not defined as persistence and the queries themselves are not planned to be cached as they are too complex by design (for example, full text). UseĀ [Solr](search/solr.md) which caches this for you to improve scale/performance, and to offload your database. For further details on which calls are cached or not, see details in the [Symfony Web Debug Toolbar](devops.md#web-debug-toolbar) diff --git a/docs/guide/search/elastic.md b/docs/guide/search/elastic.md index c8f5b4d657..66363419e2 100644 --- a/docs/guide/search/elastic.md +++ b/docs/guide/search/elastic.md @@ -588,5 +588,5 @@ For more information about how Elasticsearch handles settings and mappings from ## Extending Elasticsearch -To learn how to create custom Search Criteria, Sort Clauses and Facets for use with Elasticsearch, +To learn how to create custom Search Criteria and Sort Clauses for use with Elasticsearch, and how to index custom data and manipulate the query, see [Elasticsearch extensibility](extend_elasticsearch.md). diff --git a/docs/guide/search/extend_elasticsearch.md b/docs/guide/search/extend_elasticsearch.md index c014a480f3..5536e2ecd5 100644 --- a/docs/guide/search/extend_elasticsearch.md +++ b/docs/guide/search/extend_elasticsearch.md @@ -519,137 +519,3 @@ services: ``` For content-based aggregations, use the `ibexa.elasticsearch.query.content.aggregation_visitor.` and `ibexa.elasticsearch.query.content.aggregation_result_extractor` tags respectively. - -## Custom Facet - -!!! caution "Deprecated" - - Search Facets are deprecated since version v3.2. Use a custom [Aggregation](../../api/public_php_api_search.md#aggregation) instead. - -To create a custom search Facet for use with Elasticsearch, create a Facet class and a Facet builder. -You also need to add a visitor and a result extractor. - -The following example shows how to create a Facet that filters results according to their Content Type group. - -`src/Query/ContentTypeGroupFacet`: - -``` php - [ - 'field' => 'content_type_group_id_mid', - ], - ]; - } -} -``` - -`src/Query/ContentTypeGroupFacetResultExtractor`: - -``` php -name = $builder->name; - foreach ($data['buckets'] as $bucket) { - $facet->entries[$bucket['key']] = $bucket['doc_count']; - } - - return $facet; - } -} -``` - -Remember to register the facet classes as services: - -``` yaml -services: - App\Query\FacetBuilder\ContentTypeGroupFacetBuilderVisitor: - tags: - - { name: ibexa.elasticsearch.query.content.facet_builder_visitor } - - { name: ibexa.elasticsearch.query.location.facet_builder_visitor } - - App\Query\FacetBuilder\ContentTypeGroupFacetResultExtractor: - tags: - - { name: ibexa.search.elasticsearch.query.facet_result.extractor } -``` diff --git a/docs/guide/search/search.md b/docs/guide/search/search.md index d0f349e81d..4329b7fac0 100644 --- a/docs/guide/search/search.md +++ b/docs/guide/search/search.md @@ -42,44 +42,6 @@ which will be used to translate the value object into a storage-specific search As an example take a look at the [`ContentId` Criterion handler](https://github.com/ibexa/core/blob/main/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/ContentId.php) in Legacy search engine or [`ContentId` Criterion handler](https://github.com/ibexa/solr-search-engine/blob/main/lib/Query/Common/CriterionVisitor/ContentIdIn.php) in Solr search engine. -## Search Facet reference - -!!! caution "Deprecated" - - Search Facets are deprecated since version v3.2. - - Use [Aggregation API](../../api/public_php_api_search.md#aggregation) instead. - -Search Facets enable you to apply [faceted search](../../api/public_php_api_search.md#faceted-search) -to get a count of search results for each Facet value. - -### Available FacetBuilders - -#### ContentTypeFacetBuilder - -Arguments: - -- `name`: `string` -- `minCount` (optional): `integer` -- `limit` (optional): `integer` - -#### SectionFacetBuilder - -Arguments: - -- `name`: `string` -- `minCount` (optional): `integer` -- `limit` (optional): `integer` - -#### UserFacetBuilder - -Arguments: - -- `name`: `string` -- `type`: `string` [`OWNER = 'owner'`, `GROUP = 'group'`, `MODIFIER = 'modifier'`] -- `minCount` (optional): `integer` -- `limit` (optional): `integer` - ## Custom Criteria and Sort Clauses Sometimes you will find that standardĀ Search Criteria and Sort Clauses provided with [[= product_name =]] are not sufficient for your needs. Most often this will be the case if you have a custom Field Type using external storage which cannot be searched using the standard Field Criterion.