diff --git a/docs/search/criteria_reference/ancestor_criterion.md b/docs/search/criteria_reference/ancestor_criterion.md index edc196fa4e..71ea04f47a 100644 --- a/docs/search/criteria_reference/ancestor_criterion.md +++ b/docs/search/criteria_reference/ancestor_criterion.md @@ -9,10 +9,34 @@ searches for content that is an ancestor of the provided Location, including thi ## Example +### PHP + ``` php $query->query = new Criterion\Ancestor([$this->locationService->loadLocation(62)->pathString]); ``` +### REST API + +=== "XML" + + ```xml + + + /81/82/ + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "AncestorCriterion": "/81/82/" + } + } + ``` + ## Use case You can use the Ancestor Search Criterion to create a list of breadcrumbs leading to the Location: diff --git a/docs/search/criteria_reference/attributegroupidentifier_criterion.md b/docs/search/criteria_reference/attributegroupidentifier_criterion.md new file mode 100644 index 0000000000..1b6521011d --- /dev/null +++ b/docs/search/criteria_reference/attributegroupidentifier_criterion.md @@ -0,0 +1,33 @@ +# AttributeGroupIdentifier Criterion + +The `AttributeGroupIdentifier` Search Criterion searches for products by the value of their attribute group identifier. + +## Arguments + +- `value` - string representing the attribute's identifier + +## Example + +### REST API + +=== "XML" + + ```xml + + + attribute_group + + + ``` + +=== "JSON" + + ```json + { + "AttributeQuery": { + "Query": { + "AttributeGroupIdentifier": "attribute_group" + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/attributename_criterion.md b/docs/search/criteria_reference/attributename_criterion.md new file mode 100644 index 0000000000..b80ecf4365 --- /dev/null +++ b/docs/search/criteria_reference/attributename_criterion.md @@ -0,0 +1,33 @@ +# AttributeName Criterion + +The `AttributeName` Search Criterion searches for products by the value of their attribute name. + +## Arguments + +- `value` - string representing the attribute's name + +## Example + +### REST API + +=== "XML" + + ```xml + + + measure + + + ``` + +=== "JSON" + + ```json + { + "AttributeQuery": { + "Query": { + "AttributeNameCriterion": "measure" + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/baseprice_criterion.md b/docs/search/criteria_reference/baseprice_criterion.md index c3c7b6cc43..31a9d8d184 100644 --- a/docs/search/criteria_reference/baseprice_criterion.md +++ b/docs/search/criteria_reference/baseprice_criterion.md @@ -13,6 +13,8 @@ The `BasePrice` Criterion is not available in the Legacy Search engine. ## Example +### PHP + ``` php $query = new ProductQuery( null, diff --git a/docs/search/criteria_reference/catalogidentifier_criterion.md b/docs/search/criteria_reference/catalogidentifier_criterion.md new file mode 100644 index 0000000000..227c8db2c8 --- /dev/null +++ b/docs/search/criteria_reference/catalogidentifier_criterion.md @@ -0,0 +1,33 @@ +# CatalogIdentifier Criterion + +The `CatalogIdentifier` Search Criterion searches for a catalog by the value of its identifier. + +## Arguments + +- `value` - string representing the catalog's identifier + +## Example + +### REST API + +=== "XML" + + ```xml + + + catalog_1 + + + ``` + +=== "JSON" + + ```json + { + "CatalogQuery": { + "Query": { + "CatalogIdentifierCriterion": "catalog_1", + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/catalogname_criterion.md b/docs/search/criteria_reference/catalogname_criterion.md new file mode 100644 index 0000000000..463d68989c --- /dev/null +++ b/docs/search/criteria_reference/catalogname_criterion.md @@ -0,0 +1,33 @@ +# CatalogName Criterion + +The `CatalogName` Search Criterion searches for catalogs by the value of their name. + +## Arguments + +- `value` - string representing the catalog's name + +## Example + +### REST API + +=== "XML" + + ```xml + + + Furniture + + + ``` + +=== "JSON" + + ```json + { + "CatalogQuery": { + "Query": { + "CatalogNameCriterion": "Furniture" + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/catalogstatus_criterion.md b/docs/search/criteria_reference/catalogstatus_criterion.md new file mode 100644 index 0000000000..9c2135ee49 --- /dev/null +++ b/docs/search/criteria_reference/catalogstatus_criterion.md @@ -0,0 +1,33 @@ +# CatalogStatus Criterion + +The `CatalogStatus` Search Criterion searches for catalogs by the value of their status. + +## Arguments + +- `value` - string representing the catalog's status + +## Example + +### REST API + +=== "XML" + + ```xml + + + published + + + ``` + +=== "JSON" + + ```json + { + "CatalogQuery": { + "Query": { + "CatalogStatusCriterion": "published" + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/checkboxattribute_criterion.md b/docs/search/criteria_reference/checkboxattribute_criterion.md index da375d8774..ee0836c3a4 100644 --- a/docs/search/criteria_reference/checkboxattribute_criterion.md +++ b/docs/search/criteria_reference/checkboxattribute_criterion.md @@ -9,6 +9,8 @@ The `CheckboxAttribute` Search Criterion searches for products by the value of t ## Example +### PHP + ``` php $query = new ProductQuery( null, diff --git a/docs/search/criteria_reference/colorattribute_criterion.md b/docs/search/criteria_reference/colorattribute_criterion.md index 33e000f7c9..bcb61e9fef 100644 --- a/docs/search/criteria_reference/colorattribute_criterion.md +++ b/docs/search/criteria_reference/colorattribute_criterion.md @@ -9,9 +9,41 @@ The `ColorAttribute` Search Criterion searches for products by the value of thei ## Example +### PHP + ``` php $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ColorAttribute('color', ['#FF0000']) ); ``` + +### REST API + +=== "XML" + + ```xml + + + + color + #000000 + + + + ``` + +=== "JSON" + + ```json + { + "AttributeQuery": { + "Query": { + "ColorAttributeCriterion": { + "identifier": "color", + "value": ["#000000"] + }, + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/contentid_criterion.md b/docs/search/criteria_reference/contentid_criterion.md index b7c73850a2..6a15e5fbf3 100644 --- a/docs/search/criteria_reference/contentid_criterion.md +++ b/docs/search/criteria_reference/contentid_criterion.md @@ -9,6 +9,30 @@ searches for content by its ID. ## Example +### PHP + ``` php $query->query = new Criterion\ContentId([62, 64]); ``` + +### REST API + +=== "XML" + + ```xml + + + [69, 72] + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "ContentIdCriterion": [69, 72] + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/contenttypegroupid_criterion.md b/docs/search/criteria_reference/contenttypegroupid_criterion.md index e7d0e27972..0c3645274c 100644 --- a/docs/search/criteria_reference/contenttypegroupid_criterion.md +++ b/docs/search/criteria_reference/contenttypegroupid_criterion.md @@ -9,10 +9,34 @@ searches for content based on the ID of its Content Type group. ## Example +### PHP + ``` php $query->query = new Criterion\ContentTypeGroupId([1, 2]); ``` +### REST API + +=== "XML" + + ```xml + + + [1, 2] + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "ContentTypeGroupIdCriterion": [1, 2] + } + } + ``` + ## Use case You can use the `ContentTypeGroupId` Criterion to query all Media Content items @@ -28,3 +52,25 @@ You can use the `ContentTypeGroupId` Criterion to query all Media Content items } } ``` + +### REST API + +=== "XML" + + ```xml + + + [69, 72] + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "ContentIdCriterion": [69, 72] + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/contenttypeid_criterion.md b/docs/search/criteria_reference/contenttypeid_criterion.md index fc882745b5..f88b9c06e5 100644 --- a/docs/search/criteria_reference/contenttypeid_criterion.md +++ b/docs/search/criteria_reference/contenttypeid_criterion.md @@ -9,6 +9,30 @@ searches for content based on the ID of its Content Type. ## Example +### PHP + ``` php $query->query = new Criterion\ContentTypeId([44]); ``` + +### REST API + +=== "XML" + + ```xml + + + 44 + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "ContentTypeIdCriterion": 44 + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/contenttypeidentifier_criterion.md b/docs/search/criteria_reference/contenttypeidentifier_criterion.md index 35a4c4a47f..c50b1353ec 100644 --- a/docs/search/criteria_reference/contenttypeidentifier_criterion.md +++ b/docs/search/criteria_reference/contenttypeidentifier_criterion.md @@ -9,6 +9,30 @@ searches for content based on the identifier of its Content Type. ## Example +### PHP + ``` php $query->query = new Criterion\ContentTypeIdentifier(['article', 'blog_post']); ``` + +### REST API + +=== "XML" + + ```xml + + + article + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "ContentTypeIdentifierCriterion": "article" + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/createdat_criterion.md b/docs/search/criteria_reference/createdat_criterion.md index 8ef582b841..7eb9eb06c9 100644 --- a/docs/search/criteria_reference/createdat_criterion.md +++ b/docs/search/criteria_reference/createdat_criterion.md @@ -4,11 +4,13 @@ The `CreatedAt` Search Criterion searches for products based on the date when th ## Arguments -- `createdAt` - indicating the date that should be matched, provided as a `DateTimeInterface` object -- `operator` - Operator constant (EQ, GT, GTE, LT, LTE) +- `createdAt` (PHP), `created_at` (REST) - indicating the date that should be matched, provided as a `DateTimeInterface` object in PHP, or as a string acceptable by `DateTime` constructor in REST +- `operator` - Operator constant (EQ, GT, GTE, LT, LTE) in PHP or its value in REST ## Example +### PHP + ``` php $criteria = new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CreatedAt( new DateTime('2023-03-01'), @@ -17,3 +19,33 @@ $criteria = new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\C $productQuery = new ProductQuery(null, $criteria); ``` + +### REST API + +=== "XML" + + ```xml + + + + 2023-06-12 + >= + + + + ``` + +=== "JSON" + + ```json + { + "ProductQuery": { + "Filter": { + "CreatedAtCriterion": { + "created_at": "2023-06-12", + "operator": ">=" + } + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/createdatrange_criterion.md b/docs/search/criteria_reference/createdatrange_criterion.md index 2e47444b2e..1b461050e0 100644 --- a/docs/search/criteria_reference/createdatrange_criterion.md +++ b/docs/search/criteria_reference/createdatrange_criterion.md @@ -9,6 +9,8 @@ The `CreatedAtRange` Search Criterion searches for products based on the date ra ## Example +### PHP + ``` php $criteria = new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\CreatedAtRange( new \DateTimeImmutable('2020-07-10T00:00:00+00:00'), @@ -17,3 +19,33 @@ $criteria = new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\C $productQuery = new ProductQuery(null, $criteria); ``` + +### REST API + +=== "XML" + + ```xml + + + + 2023-06-12 + 2023-06-20 + + + + ``` + +=== "JSON" + + ```json + { + "ProductQuery": { + "Filter": { + "CreatedAtRange": { + "min": "2023-06-12", + "max": "2023-06-20" + } + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/currencycode_criterion.md b/docs/search/criteria_reference/currencycode_criterion.md index fa187df4ed..0f4fd83f2b 100644 --- a/docs/search/criteria_reference/currencycode_criterion.md +++ b/docs/search/criteria_reference/currencycode_criterion.md @@ -12,6 +12,8 @@ The `CurrencyCodeCriterion` Criterion is not available in Solr or Elasticsearch ## Example +### PHP + ``` php $query->query = new \Ibexa\Contracts\ProductCatalog\Values\Currency\Query\Criterion\CurrencyCodeCriterion('EUR'); ``` diff --git a/docs/search/criteria_reference/customergroupid_criterion.md b/docs/search/criteria_reference/customergroupid_criterion.md index 349a4745a5..ce0e13ce14 100644 --- a/docs/search/criteria_reference/customergroupid_criterion.md +++ b/docs/search/criteria_reference/customergroupid_criterion.md @@ -9,6 +9,8 @@ searches for content based on the ID of its customer group. ## Example +### PHP + ``` php $query->query = new Criterion\CustomerGroupId(1); ``` diff --git a/docs/search/criteria_reference/customprice_criterion.md b/docs/search/criteria_reference/customprice_criterion.md index 82562f1b5c..c771ff9015 100644 --- a/docs/search/criteria_reference/customprice_criterion.md +++ b/docs/search/criteria_reference/customprice_criterion.md @@ -15,6 +15,8 @@ The `CustomPrice` Criterion is not available in the Legacy Search engine. ## Example +### PHP + ``` php $query = new ProductQuery( null, diff --git a/docs/search/criteria_reference/datemetadata_criterion.md b/docs/search/criteria_reference/datemetadata_criterion.md index e1b7aa53d6..1ab031ec8a 100644 --- a/docs/search/criteria_reference/datemetadata_criterion.md +++ b/docs/search/criteria_reference/datemetadata_criterion.md @@ -11,6 +11,8 @@ searches for content based on the date when it was created or last modified. ## Example +### PHP + ``` php $query->query = new Criterion\DateMetadata( Criterion\DateMetadata::CREATED, @@ -19,6 +21,37 @@ $query->query = new Criterion\DateMetadata( ); ``` +### REST API + +=== "XML" + + ```xml + + + + modified + 1675681020 + gte + + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "DateMetadataCriterion": { + "Target": "modified", + "Value": 1675681020, + "Operator": "gte" + } + } + } + ``` + + ## Use case You can use the `DateMetadata` Criterion to search for blog posts that have been created within the last week: diff --git a/docs/search/criteria_reference/depth_criterion.md b/docs/search/criteria_reference/depth_criterion.md index bcf127e7b4..b66d588b7b 100644 --- a/docs/search/criteria_reference/depth_criterion.md +++ b/docs/search/criteria_reference/depth_criterion.md @@ -18,6 +18,8 @@ The `value` argument requires: ## Example +### PHP + ``` php $query->query = new Criterion\Location\Depth(Criterion\Operator::LT, 3); ``` diff --git a/docs/search/criteria_reference/field_criterion.md b/docs/search/criteria_reference/field_criterion.md index b63d7f83a8..ca95602ae3 100644 --- a/docs/search/criteria_reference/field_criterion.md +++ b/docs/search/criteria_reference/field_criterion.md @@ -13,17 +13,52 @@ The `LIKE` operator works together with wildcards (`*`). Without a wildcards its The `CONTAINS` operator works with collection Fields like the Country Field Type, enabling you to retrieve results when the query value is one of the values of the collection. -Querying for a collection with the `EQ` operator will return result only when the whole collection equals the query values. +Querying for a collection with the `EQ` operator returns result only when the whole collection equals the query values. + +## Limitations + +The `Field` Criterion isn't available in [Repository filtering](search_api.md#repository-filtering). + ## Example +### PHP + ``` php $query->query = new Criterion\Field('name', Criterion\Operator::CONTAINS, 'Platform'); ``` -## Limitations +### REST API + +=== "XML" + + ```xml + + + + name + CONTAINS + Platform + + + + ``` + +=== "JSON" -The `Field` Criterion is not available in [Repository filtering](search_api.md#repository-filtering). + ```json + { + "Query": { + "Filter": { + "FieldCriterion": { + "target": "name", + "operator": "CONTAINS", + "value": "Platform" + } + } + } + } + ``` ## Use case diff --git a/docs/search/criteria_reference/fieldrelation_criterion.md b/docs/search/criteria_reference/fieldrelation_criterion.md index 36812c56f3..8803f64596 100644 --- a/docs/search/criteria_reference/fieldrelation_criterion.md +++ b/docs/search/criteria_reference/fieldrelation_criterion.md @@ -17,6 +17,8 @@ The `FieldRelation` Criterion is not available in [Repository filtering](search_ ## Example +### PHP + ``` php $query->query = new Criterion\FieldRelation('relations', Criterion\Operator::CONTAINS, [55, 63]); ``` diff --git a/docs/search/criteria_reference/floatattribute_criterion.md b/docs/search/criteria_reference/floatattribute_criterion.md index 48a270f2ae..ac8b94f8e9 100644 --- a/docs/search/criteria_reference/floatattribute_criterion.md +++ b/docs/search/criteria_reference/floatattribute_criterion.md @@ -9,6 +9,8 @@ The `FloatAttribute` Search Criterion searches for products by the value of thei ## Example +### PHP + ``` php $query = new ProductQuery( null, @@ -18,3 +20,33 @@ $query = new ProductQuery( ) ); ``` + +### REST API + +=== "XML" + + ```xml + + + + length + 16.5 + + + + ``` + +=== "JSON" + + ```json + { + "AttributeQuery": { + "Query": { + "FloatAttributeCriterion": { + "identifier": "length", + "value": 16.5 + } + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/floatattributerange_criterion.md b/docs/search/criteria_reference/floatattributerange_criterion.md new file mode 100644 index 0000000000..c7edf29441 --- /dev/null +++ b/docs/search/criteria_reference/floatattributerange_criterion.md @@ -0,0 +1,43 @@ +# FloatAttributeRange Criterion + +The `FloatAttributeRange` Search Criterion searches for products by the range of values of their float attribute. + +## Arguments + +- `identifier` - string representing the attribute +- `min` - indicating the beginning of the range +- `max` - indicating the end of the date range + +## Example + +### REST API + +=== "XML" + + ```xml + + + + length + 16.5 + 25 + + + + ``` + +=== "JSON" + + ```json + { + "AttributeQuery": { + "Query": { + "FloatAttributeRangeCriterion": { + "identifier": "length", + "min": 16.5, + "max": 25 + } + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/fulltext_criterion.md b/docs/search/criteria_reference/fulltext_criterion.md index ea9f2ddc02..ed8c38d77d 100644 --- a/docs/search/criteria_reference/fulltext_criterion.md +++ b/docs/search/criteria_reference/fulltext_criterion.md @@ -29,6 +29,8 @@ The `FullText` Criterion is not available in [Repository filtering](search_api.m ## Example +### PHP + ``` php $query->query = new Criterion\FullText('victory'); ``` @@ -45,6 +47,28 @@ Using the AND operator and parenthesis to search for both words at the same time $query->query = new Criterion\FullText('baseball AND cup'); ``` +### REST API + +=== "XML" + + ```xml + + + victory + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "FullTextCriterion": "victory" + } + } + ``` + ## Use cases Assume the following search query: diff --git a/docs/search/criteria_reference/integerattribute_criterion.md b/docs/search/criteria_reference/integerattribute_criterion.md index 8e33910892..61834e559a 100644 --- a/docs/search/criteria_reference/integerattribute_criterion.md +++ b/docs/search/criteria_reference/integerattribute_criterion.md @@ -9,6 +9,8 @@ The `IntegerAttribute` Search Criterion searches for products by the value of th ## Example +### PHP + ``` php $query = new ProductQuery( null, @@ -18,3 +20,33 @@ $query = new ProductQuery( ) ); ``` + +### REST API + +=== "XML" + + ```xml + + + + size + 38 + + + + ``` + +=== "JSON" + + ```json + { + "AttributeQuery": { + "Query": { + "IntegerAttributeCriterion": { + "identifier": "size", + "value": 38 + } + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/integerattributerange_criterion.md b/docs/search/criteria_reference/integerattributerange_criterion.md new file mode 100644 index 0000000000..e737a11653 --- /dev/null +++ b/docs/search/criteria_reference/integerattributerange_criterion.md @@ -0,0 +1,43 @@ +# IntegerAttributeRange Criterion + +The `IntegerAttributeRange` Search Criterion searches for products by the range of values of their integer attribute. + +## Arguments + +- `identifier` - string representing the attribute +- `min` - indicating the beginning of the range +- `max` - indicating the end of the date range + +## Example + +### REST API + +=== "XML" + + ```xml + + + + length + 16 + 25 + + + + ``` + +=== "JSON" + + ```json + { + "AttributeQuery": { + "Query": { + "IntegerAttributeRangeCriterion": { + "identifier": "length", + "min": 16, + "max": 25 + } + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/iscurrencyenabled_criterion.md b/docs/search/criteria_reference/iscurrencyenabled_criterion.md index 4dbad2da35..49592891bc 100644 --- a/docs/search/criteria_reference/iscurrencyenabled_criterion.md +++ b/docs/search/criteria_reference/iscurrencyenabled_criterion.md @@ -13,6 +13,8 @@ The `IsCurrencyEnabledCriterion` Criterion is not available in Solr or Elasticse ## Example +### PHP + ``` php $query->query = new \Ibexa\Contracts\ProductCatalog\Values\Currency\Query\Criterion\IsCurrencyEnabledCriterion(); ``` diff --git a/docs/search/criteria_reference/isfieldempty_criterion.md b/docs/search/criteria_reference/isfieldempty_criterion.md index f16205d023..04f535d3d1 100644 --- a/docs/search/criteria_reference/isfieldempty_criterion.md +++ b/docs/search/criteria_reference/isfieldempty_criterion.md @@ -17,6 +17,8 @@ The Richtext Field Type (`ezrichtext`) is not searchable in the Legacy search en ## Example +### PHP + ``` php $query->query = new Criterion\IsFieldEmpty('title'); ``` diff --git a/docs/search/criteria_reference/ismainlocation_criterion.md b/docs/search/criteria_reference/ismainlocation_criterion.md index c0f5a1e5bd..16df929312 100644 --- a/docs/search/criteria_reference/ismainlocation_criterion.md +++ b/docs/search/criteria_reference/ismainlocation_criterion.md @@ -12,6 +12,8 @@ representing whether to search for a main or not main Location ## Example +### PHP + ``` php $query->query = new Criterion\Location\IsMainLocation(IsMainLocation::MAIN); ``` diff --git a/docs/search/criteria_reference/isproductbased_criterion.md b/docs/search/criteria_reference/isproductbased_criterion.md index 48eea13a2f..e82ad0bad5 100644 --- a/docs/search/criteria_reference/isproductbased_criterion.md +++ b/docs/search/criteria_reference/isproductbased_criterion.md @@ -4,6 +4,8 @@ The `IsProductBased` Search Criterion searches for content that plays the role o ## Example +### PHP + ``` php $query->query = new Ibexa\Contracts\ProductCatalog\Values\Content\Query\Criterion\IsProductBased(); ``` diff --git a/docs/search/criteria_reference/isuserbased_criterion.md b/docs/search/criteria_reference/isuserbased_criterion.md index 3e80dc91a5..83f97e7009 100644 --- a/docs/search/criteria_reference/isuserbased_criterion.md +++ b/docs/search/criteria_reference/isuserbased_criterion.md @@ -19,6 +19,30 @@ The `IsUserBased` Criterion is not available in Solr or Elastic search engines. ## Example +### PHP + ``` php $query->query = new Criterion\IsUserBased(); ``` + +### REST API + +=== "XML" + + ```xml + + + false + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "IsUserBasedCriterion": "false" + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/isuserenabled_criterion.md b/docs/search/criteria_reference/isuserenabled_criterion.md index 9b0d14fde9..f09a443c0f 100644 --- a/docs/search/criteria_reference/isuserenabled_criterion.md +++ b/docs/search/criteria_reference/isuserenabled_criterion.md @@ -14,6 +14,30 @@ The `IsUserEnabled` Criterion is not available in Solr or Elastic search engines ## Example +### PHP + ``` php $query->query = new Criterion\IsUserEnabled(); ``` + +### REST API + +=== "XML" + + ```xml + + + true + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "IsUserEnabledCriterion": "true" + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/languagecode_criterion.md b/docs/search/criteria_reference/languagecode_criterion.md index 3140c1ba84..8daebaade4 100644 --- a/docs/search/criteria_reference/languagecode_criterion.md +++ b/docs/search/criteria_reference/languagecode_criterion.md @@ -11,10 +11,34 @@ should be returned even if it does not contain the selected language (default `t ## Example +### PHP + ``` php $query->query = new Criterion\LanguageCode('ger-DE', false); ``` +### REST API + +=== "XML" + + ```xml + + + eng-GB + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "LanguageCodeCriterion": "eng-GB" + } + } + ``` + ## Use case You can use the `LanguageCode` Criterion to search for articles that are lacking a translation diff --git a/docs/search/criteria_reference/locationid_criterion.md b/docs/search/criteria_reference/locationid_criterion.md index 61c4f02b71..3358561f96 100644 --- a/docs/search/criteria_reference/locationid_criterion.md +++ b/docs/search/criteria_reference/locationid_criterion.md @@ -9,6 +9,30 @@ searches for content based in the Location ID. ## Example +### PHP + ``` php $query->query = new Criterion\LocationId(62); ``` + +### REST API + +=== "XML" + + ```xml + + + 62 + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "LocationIdCriterion": "62" + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/locationremoteid_criterion.md b/docs/search/criteria_reference/locationremoteid_criterion.md index f8d49f1f6d..1119b17cf8 100644 --- a/docs/search/criteria_reference/locationremoteid_criterion.md +++ b/docs/search/criteria_reference/locationremoteid_criterion.md @@ -9,6 +9,30 @@ searches for content based in the Location remote ID. ## Example +### PHP + ``` php $query->query = new Criterion\LocationRemoteId(['4d1e5f216c0a7aaab7f005ffd4b6a8a8', 'b81ef3e62b514188bfddd2a80d447d34']); ``` + +### REST API + +=== "XML" + + ```xml + + + 3aaeefdb0ae573ac91f6d6ea78d230b7 + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "LocationRemoteIdCriterion": "3aaeefdb0ae573ac91f6d6ea78d230b7" + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/logicaland_criterion.md b/docs/search/criteria_reference/logicaland_criterion.md index e10eca08e6..8278a3ba05 100644 --- a/docs/search/criteria_reference/logicaland_criterion.md +++ b/docs/search/criteria_reference/logicaland_criterion.md @@ -9,6 +9,8 @@ matches content if all provided Criteria match. ## Example +### PHP + ``` php $query->query = new Criterion\LogicalAnd([ new Criterion\ContentTypeIdentifier('article'), @@ -16,3 +18,33 @@ $query->query = new Criterion\LogicalAnd([ ] ); ``` + +### REST API + +=== "XML" + + ```xml + + + + article + news + + + + ``` + +=== "JSON" + + ```json + { + "Query": { + "Filter": { + "AND": { + "ContentTypeIdentifierCriterion": "article", + "SectionIdentifierCriterion": "news" + } + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/logicalnot_criterion.md b/docs/search/criteria_reference/logicalnot_criterion.md index dceadd8328..cbf5382459 100644 --- a/docs/search/criteria_reference/logicalnot_criterion.md +++ b/docs/search/criteria_reference/logicalnot_criterion.md @@ -16,3 +16,31 @@ $query->filter = new Criterion\LogicalNot( new Criterion\ContentTypeIdentifier($contentTypeId) ); ``` + +### REST API + +=== "XML" + + ```xml + + + + article + + + + ``` + +=== "JSON" + + ```json + { + "Query": { + "Criterion": { + "LogicalNotCriterion": { + "ContentTypeIdentifierCriterion": "article" + } + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/logicalor_criterion.md b/docs/search/criteria_reference/logicalor_criterion.md index 7654162a19..2b8db78c7a 100644 --- a/docs/search/criteria_reference/logicalor_criterion.md +++ b/docs/search/criteria_reference/logicalor_criterion.md @@ -9,6 +9,8 @@ matches content if at least one of the provided Criteria matches. ## Example +### PHP + ``` php $query->filter = new Criterion\LogicalOr([ new Criterion\ContentTypeIdentifier('article'), @@ -16,3 +18,33 @@ $query->filter = new Criterion\LogicalOr([ ] ); ``` + +### REST API + +=== "XML" + + ```xml + + + + article + news + + + + ``` + +=== "JSON" + + ```json + { + "Query": { + "Filter": { + "OR": { + "ContentTypeIdentifierCriterion": "article", + "SectionIdentifierCriterion": "news" + } + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/maplocationdistance_criterion.md b/docs/search/criteria_reference/maplocationdistance_criterion.md index ded19e480b..ecc2485ee3 100644 --- a/docs/search/criteria_reference/maplocationdistance_criterion.md +++ b/docs/search/criteria_reference/maplocationdistance_criterion.md @@ -22,6 +22,8 @@ The `MapLocationDistance` Criterion is not available in [Repository filtering](s ## Example +### PHP + ``` php $query->query = new Criterion\MapLocationDistance('location', Criterion\Operator::LTE, 5, 51.395973, 22.531696); ``` diff --git a/docs/search/criteria_reference/objectstateid_criterion.md b/docs/search/criteria_reference/objectstateid_criterion.md index f2a73a1082..a3ebae1620 100644 --- a/docs/search/criteria_reference/objectstateid_criterion.md +++ b/docs/search/criteria_reference/objectstateid_criterion.md @@ -9,6 +9,30 @@ searches for content based on its Object State ID. ## Example +### PHP + ``` php $query->query = new Criterion\ObjectStateId([4, 5]); ``` + +### REST API + +=== "XML" + + ```xml + + + 1 + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "ObjectStateIdCriterion": "1" + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/objectstateidentifier_criterion.md b/docs/search/criteria_reference/objectstateidentifier_criterion.md index 859c316db8..11f28fe666 100644 --- a/docs/search/criteria_reference/objectstateidentifier_criterion.md +++ b/docs/search/criteria_reference/objectstateidentifier_criterion.md @@ -6,10 +6,12 @@ searches for content based on its Object State identifier. ## Arguments - `value` - string(s) representing the Object State identifier(s) -- (optional) `target` - string representing the Object State group +- `target` (optional for PHP) - string representing the Object State group ## Example +### PHP + ``` php $query->query = new Criterion\ObjectStateIdentifier(['ready']); ``` @@ -17,3 +19,33 @@ $query->query = new Criterion\ObjectStateIdentifier(['ready']); ``` php $query->query = new Criterion\ObjectStateIdentifier(['not_locked'], 'ez_lock'); ``` + +### REST API + +=== "XML" + + ```xml + + + + not_locked + ez_lock + + + + ``` + +=== "JSON" + + ```json + { + "Query": { + "Filter": { + "ObjectStateIdentifierCriterion": { + "value": "not_locked", + "target": "ez_lock" + } + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/order_company_associated_criterion.md b/docs/search/criteria_reference/order_company_associated_criterion.md index 2cefe8042e..21e888a257 100644 --- a/docs/search/criteria_reference/order_company_associated_criterion.md +++ b/docs/search/criteria_reference/order_company_associated_criterion.md @@ -13,6 +13,8 @@ The `IsCompanyAssociatedCriterion` Search Criterion searches for orders based on ## Example +### PHP + ``` php $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\IsCompanyAssociatedCriterion(true) diff --git a/docs/search/criteria_reference/order_company_name_criterion.md b/docs/search/criteria_reference/order_company_name_criterion.md index f49cd45805..a594cfda90 100644 --- a/docs/search/criteria_reference/order_company_name_criterion.md +++ b/docs/search/criteria_reference/order_company_name_criterion.md @@ -13,6 +13,8 @@ The `CompanyNameCriterion` Search Criterion searches for orders based on the nam ## Example +### PHP + ``` php $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\CompanyNameCriterion('IBM') diff --git a/docs/search/criteria_reference/order_created_criterion.md b/docs/search/criteria_reference/order_created_criterion.md index 6e84dbc534..729ae60b29 100644 --- a/docs/search/criteria_reference/order_created_criterion.md +++ b/docs/search/criteria_reference/order_created_criterion.md @@ -14,6 +14,8 @@ The `CreatedAtCriterion` Search Criterion searches for orders based on the date ## Example +### PHP + ``` php $criteria = new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\CreatedAtCriterion( new DateTime('2023-03-01'), diff --git a/docs/search/criteria_reference/order_currency_code_criterion.md b/docs/search/criteria_reference/order_currency_code_criterion.md index 77d2dde685..31246f83d6 100644 --- a/docs/search/criteria_reference/order_currency_code_criterion.md +++ b/docs/search/criteria_reference/order_currency_code_criterion.md @@ -13,6 +13,8 @@ The `CurrencyCodeCriterion` Search Criterion searches for orders based on the cu ## Example +### PHP + ``` php $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\CurrencyCodeCriterion('USD') diff --git a/docs/search/criteria_reference/order_customer_name_criterion.md b/docs/search/criteria_reference/order_customer_name_criterion.md index d450f731c8..a0cdf9f841 100644 --- a/docs/search/criteria_reference/order_customer_name_criterion.md +++ b/docs/search/criteria_reference/order_customer_name_criterion.md @@ -13,6 +13,8 @@ The `CustomerNameCriterion` Search Criterion searches for orders based on the na ## Example +### PHP + ``` php $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\CustomerNameCriterion('john') diff --git a/docs/search/criteria_reference/order_identifier_criterion.md b/docs/search/criteria_reference/order_identifier_criterion.md index ff6f9ff77e..97e1619a71 100644 --- a/docs/search/criteria_reference/order_identifier_criterion.md +++ b/docs/search/criteria_reference/order_identifier_criterion.md @@ -13,6 +13,8 @@ The `IdentifierCriterion` Search Criterion searches for orders based on the orde ## Example +### PHP + ``` php $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\IdentifierCriterion('f7578972-e7f4-4cae-85dc-a7c74610204e') diff --git a/docs/search/criteria_reference/order_price_criterion.md b/docs/search/criteria_reference/order_price_criterion.md index 5d5c8aada0..afaa3aa789 100644 --- a/docs/search/criteria_reference/order_price_criterion.md +++ b/docs/search/criteria_reference/order_price_criterion.md @@ -14,10 +14,13 @@ The `PriceCriterion` searches for orders by their total net value. ## Example +### PHP + ``` php -$criteria = new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\PriceCriterion(12900, +$criteria = new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\PriceCriterion( + 12900, 'GTE' - ); +); $orderQuery = new OrderQuery($criteria); ``` diff --git a/docs/search/criteria_reference/order_source_criterion.md b/docs/search/criteria_reference/order_source_criterion.md index 832477dfa2..b0de30c95a 100644 --- a/docs/search/criteria_reference/order_source_criterion.md +++ b/docs/search/criteria_reference/order_source_criterion.md @@ -13,6 +13,8 @@ The `SourceCriterion` Search Criterion searches for orders based on the source o ## Example +### PHP + ``` php $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\SourceCriterion('local_shop') diff --git a/docs/search/criteria_reference/order_status_criterion.md b/docs/search/criteria_reference/order_status_criterion.md index f997ca4a99..5e03e2c0e8 100644 --- a/docs/search/criteria_reference/order_status_criterion.md +++ b/docs/search/criteria_reference/order_status_criterion.md @@ -13,6 +13,8 @@ The `StatusCriterion` Search Criterion searches for orders based on order status ## Example +### PHP + ``` php $query = new OrderQuery( new \Ibexa\Contracts\OrderManagement\Value\Order\Query\Criterion\StatusCriterion('pending') diff --git a/docs/search/criteria_reference/parentlocationid_criterion.md b/docs/search/criteria_reference/parentlocationid_criterion.md index 730c4b6851..a2e5cd4789 100644 --- a/docs/search/criteria_reference/parentlocationid_criterion.md +++ b/docs/search/criteria_reference/parentlocationid_criterion.md @@ -9,10 +9,34 @@ searches for content based on the Location ID of its parent. ## Example +### PHP + ``` php $query->query = new Criterion\ParentLocationId([54, 58]); ``` +### REST API + +=== "XML" + + ```xml + + + [81, 82] + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "ParentLocationIdCriterion": [69, 72] + } + } + ``` + ## Use case You can use the `ParentLocationId` Search Criterion to list blog posts contained in a blog: diff --git a/docs/search/criteria_reference/parentlocationremoteId_criterion.md b/docs/search/criteria_reference/parentlocationremoteId_criterion.md new file mode 100644 index 0000000000..9dd0112c11 --- /dev/null +++ b/docs/search/criteria_reference/parentlocationremoteId_criterion.md @@ -0,0 +1,30 @@ +# ParentLocationRemoteId Criterion + +The `ParentLocationRemoteId` Search Criterion searches for content based on the Location remote ID of its parent. + +## Arguments + +- `value` - int(s) representing the parent Location remote IDs + + +### REST API + +=== "XML" + + ```xml + + + abab615dcf26699a4291657152da4337 + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "ParentLocationRemoteIdCriterion": "abab615dcf26699a4291657152da4337" + } + } + ``` diff --git a/docs/search/criteria_reference/payment_createdat_criterion.md b/docs/search/criteria_reference/payment_createdat_criterion.md index 7b1efd847f..089907fcdc 100644 --- a/docs/search/criteria_reference/payment_createdat_criterion.md +++ b/docs/search/criteria_reference/payment_createdat_criterion.md @@ -14,6 +14,8 @@ The `CreatedAt` Search Criterion searches for payments based on the date when th ## Example +### PHP + ``` php $criteria = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\CreatedAt( new DateTime('2023-03-01') diff --git a/docs/search/criteria_reference/payment_currency_criterion.md b/docs/search/criteria_reference/payment_currency_criterion.md index a5dd335c58..0cc61b97aa 100644 --- a/docs/search/criteria_reference/payment_currency_criterion.md +++ b/docs/search/criteria_reference/payment_currency_criterion.md @@ -13,6 +13,8 @@ The `Currency` Search Criterion searches for payments based on the currency code ## Example +### PHP + ``` php $query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Currency('EUR'); ``` diff --git a/docs/search/criteria_reference/payment_id_criterion.md b/docs/search/criteria_reference/payment_id_criterion.md index 1edb6e1ca3..a88ddd70d2 100644 --- a/docs/search/criteria_reference/payment_id_criterion.md +++ b/docs/search/criteria_reference/payment_id_criterion.md @@ -13,6 +13,8 @@ The `Id` Search Criterion searches for payments based on the payment ID. ## Example +### PHP + ``` php $query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Id(2); ``` diff --git a/docs/search/criteria_reference/payment_identifier_criterion.md b/docs/search/criteria_reference/payment_identifier_criterion.md index 04ad42ba00..f011cf1df5 100644 --- a/docs/search/criteria_reference/payment_identifier_criterion.md +++ b/docs/search/criteria_reference/payment_identifier_criterion.md @@ -13,6 +13,8 @@ The `Identifier` Search Criterion searches for payments based on the payment ide ## Example +### PHP + ``` php $query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Identifier('f7578972-e7f4-4cae-85dc-a7c74610204e'); ``` diff --git a/docs/search/criteria_reference/payment_logicaland_criterion.md b/docs/search/criteria_reference/payment_logicaland_criterion.md index 83c2dcbdd0..6ac2f2f158 100644 --- a/docs/search/criteria_reference/payment_logicaland_criterion.md +++ b/docs/search/criteria_reference/payment_logicaland_criterion.md @@ -13,8 +13,11 @@ The `LogicalAnd` Search Criterion matches payments if all provided Criteria matc ## Example +### PHP + ``` php -$query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\LogicalAnd([ +$query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\LogicalAnd( + [ new \Ibexa\Contracts\Payment\Payment\Query\Criterion\CreatedAt(new DateTime('2023-03-01')); new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Currency('USD'); ] diff --git a/docs/search/criteria_reference/payment_logicalor_criterion.md b/docs/search/criteria_reference/payment_logicalor_criterion.md index bc95717090..6332467125 100644 --- a/docs/search/criteria_reference/payment_logicalor_criterion.md +++ b/docs/search/criteria_reference/payment_logicalor_criterion.md @@ -13,8 +13,11 @@ The `LogicalOr` Search Criterion matches payments if at least one of the provide ## Example +### PHP + ``` php -$query->query = new Criterion\LogicalOr([ +$query->query = new Criterion\LogicalOr( + [ new \Ibexa\Contracts\Payment\Payment\Query\Criterion\CreatedAt(new DateTime('2023-03-01')); new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Currency('USD'); ] diff --git a/docs/search/criteria_reference/payment_method_createdat_criterion.md b/docs/search/criteria_reference/payment_method_createdat_criterion.md index 3a592114ed..bc839c9f73 100644 --- a/docs/search/criteria_reference/payment_method_createdat_criterion.md +++ b/docs/search/criteria_reference/payment_method_createdat_criterion.md @@ -14,6 +14,8 @@ The `CreatedAt` Search Criterion searches for payment methods based on the date ## Example +### PHP + ``` php $criteria = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\CreatedAt( new DateTime('2023-03-01') diff --git a/docs/search/criteria_reference/payment_method_enabled_criterion.md b/docs/search/criteria_reference/payment_method_enabled_criterion.md index b9a6b1334e..9fbdb89776 100644 --- a/docs/search/criteria_reference/payment_method_enabled_criterion.md +++ b/docs/search/criteria_reference/payment_method_enabled_criterion.md @@ -13,6 +13,8 @@ The `Enabled` Search Criterion searches for payment methods based on whether the ## Example +### PHP + ``` php $query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Enabled(true); ``` diff --git a/docs/search/criteria_reference/payment_method_id_criterion.md b/docs/search/criteria_reference/payment_method_id_criterion.md index 3f20d388d5..eb10551b69 100644 --- a/docs/search/criteria_reference/payment_method_id_criterion.md +++ b/docs/search/criteria_reference/payment_method_id_criterion.md @@ -13,6 +13,8 @@ The `Id` Search Criterion searches for payment methods based on the payment meth ## Example +### PHP + ``` php $query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Id(2); ``` diff --git a/docs/search/criteria_reference/payment_method_identifier_criterion.md b/docs/search/criteria_reference/payment_method_identifier_criterion.md index 3cb57f29d9..47da32af4c 100644 --- a/docs/search/criteria_reference/payment_method_identifier_criterion.md +++ b/docs/search/criteria_reference/payment_method_identifier_criterion.md @@ -13,6 +13,8 @@ The `Identifier` Search Criterion searches for payment methods based on the paym ## Example +### PHP + ``` php $query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Identifier('f7578972-e7f4-4cae-85dc-a7c74610204e'); ``` diff --git a/docs/search/criteria_reference/payment_method_logicaland_criterion.md b/docs/search/criteria_reference/payment_method_logicaland_criterion.md index bcc13e495b..9683602a46 100644 --- a/docs/search/criteria_reference/payment_method_logicaland_criterion.md +++ b/docs/search/criteria_reference/payment_method_logicaland_criterion.md @@ -13,8 +13,11 @@ The `LogicalAnd` Search Criterion matches payment methods if all provided Criter ## Example +### PHP + ``` php -$query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\LogicalAnd([ +$query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\LogicalAnd( + [ new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\CreatedAt(new DateTime('2023-03-01')); new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Enabled(true); ] diff --git a/docs/search/criteria_reference/payment_method_logicalor_criterion.md b/docs/search/criteria_reference/payment_method_logicalor_criterion.md index 2901c93c89..6391d313e0 100644 --- a/docs/search/criteria_reference/payment_method_logicalor_criterion.md +++ b/docs/search/criteria_reference/payment_method_logicalor_criterion.md @@ -13,8 +13,11 @@ The `LogicalOr` Search Criterion matches payment methods if at least one of the ## Example +### PHP + ``` php -$query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\LogicalOr([ +$query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\LogicalOr( + [ new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\CreatedAt(new DateTime('2023-03-01')); new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\CreatedAt(new DateTime('2023-05-01')); ] diff --git a/docs/search/criteria_reference/payment_method_type_criterion.md b/docs/search/criteria_reference/payment_method_type_criterion.md index 4b7676e6b8..d3388836a5 100644 --- a/docs/search/criteria_reference/payment_method_type_criterion.md +++ b/docs/search/criteria_reference/payment_method_type_criterion.md @@ -13,6 +13,8 @@ The `Type` Search Criterion searches for payment methods based on payment method ## Example +### PHP + ``` php $query->query = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\Type('offline'); ``` diff --git a/docs/search/criteria_reference/payment_method_updatedat_criterion.md b/docs/search/criteria_reference/payment_method_updatedat_criterion.md index b5de5c0fc8..04998f2d95 100644 --- a/docs/search/criteria_reference/payment_method_updatedat_criterion.md +++ b/docs/search/criteria_reference/payment_method_updatedat_criterion.md @@ -14,6 +14,8 @@ The `UpdatedAt` Search Criterion searches for payment methods based on the date ## Example +### PHP + ``` php $criteria = new \Ibexa\Contracts\Payment\PaymentMethod\Query\Criterion\UpdatedAt( new DateTime('2023-03-01') diff --git a/docs/search/criteria_reference/payment_order_criterion.md b/docs/search/criteria_reference/payment_order_criterion.md index ec85e02570..1d93dc08cb 100644 --- a/docs/search/criteria_reference/payment_order_criterion.md +++ b/docs/search/criteria_reference/payment_order_criterion.md @@ -13,6 +13,8 @@ The `Order` Search Criterion searches for payments based on an ID of an associat ## Example +### PHP + ``` php $query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Order(4); ``` diff --git a/docs/search/criteria_reference/payment_payment_method_criterion.md b/docs/search/criteria_reference/payment_payment_method_criterion.md index 93c3ead7e0..20a865f590 100644 --- a/docs/search/criteria_reference/payment_payment_method_criterion.md +++ b/docs/search/criteria_reference/payment_payment_method_criterion.md @@ -13,6 +13,8 @@ The `PaymentMethod` Search Criterion searches for payments based on a payment me ## Example +### PHP + ``` php $query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\PaymentMethod(2); ``` diff --git a/docs/search/criteria_reference/payment_status_criterion.md b/docs/search/criteria_reference/payment_status_criterion.md index 5907f0c2b8..50561d1865 100644 --- a/docs/search/criteria_reference/payment_status_criterion.md +++ b/docs/search/criteria_reference/payment_status_criterion.md @@ -13,6 +13,8 @@ The `Status` Search Criterion searches for payments based on payment status. ## Example +### PHP + ``` php $query->query = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\Status('failed'); ``` diff --git a/docs/search/criteria_reference/payment_updatedat_criterion.md b/docs/search/criteria_reference/payment_updatedat_criterion.md index 95ba3782e4..07f0866cc1 100644 --- a/docs/search/criteria_reference/payment_updatedat_criterion.md +++ b/docs/search/criteria_reference/payment_updatedat_criterion.md @@ -14,6 +14,8 @@ The `UpdatedAt` Search Criterion searches for payments based on the date when th ## Example +### PHP + ``` php $criteria = new \Ibexa\Contracts\Payment\Payment\Query\Criterion\UpdatedAt( new DateTime('2023-03-01') diff --git a/docs/search/criteria_reference/priority_criterion.md b/docs/search/criteria_reference/priority_criterion.md index fdc817e4fd..6d65d0e2b3 100644 --- a/docs/search/criteria_reference/priority_criterion.md +++ b/docs/search/criteria_reference/priority_criterion.md @@ -17,6 +17,8 @@ The `value` argument requires: ## Example +### PHP + ``` php $query->query = new Criterion\Location\Priority(Criterion\Operator::GTE, 50); ``` diff --git a/docs/search/criteria_reference/product_search_criteria.md b/docs/search/criteria_reference/product_search_criteria.md index f8823c763e..077e0a596d 100644 --- a/docs/search/criteria_reference/product_search_criteria.md +++ b/docs/search/criteria_reference/product_search_criteria.md @@ -13,12 +13,19 @@ Search Criterion let you to filter product by specific attributes, for example: |Search Criterion|Search based on| |-----|-----| +|[AttributeName](attributename_criterion.md)|Value of product's attribute name| +|[AttributeGroupIdentifier](attributegroupidentifier_criterion.md)|Value of product's attribute group identifier| +|[CatalogIdentifier](catalogidentifier_criterion.md)|Catalog's identifier| +|[CatalogName](catalogname_criterion.md)|Catalog's name| +|[CatalogStatus](catalogstatus_criterion.md)|Catalog's status| |[CheckboxAttribute](checkboxattribute_criterion.md)|Value of product's checkbox attribute| |[ColorAttribute](colorattribute_criterion.md)|Value of product's color attribute| |[CreatedAt](createdat_criterion.md)|Date and time when product was created| |[CreatedAtRange](createdatrange_criterion.md)|Date and time range when product was created| |[FloatAttribute](floatattribute_criterion.md)|Value of product's float attribute| +|[FloatAttributeRange](floatattributerange_criterion.md)|Value of product's float attribute| |[IntegerAttribute](integerattribute_criterion.md)|Value of product's integer attribute| +|[IntegerAttributeRange](integerattributerange_criterion.md)|Value of product's integer attribute| |[SelectionAttribute](selectionattribute_criterion.md)|Value of product's selection attribute| |[ProductAvailability](productavailability_criterion.md)|Product's availability| |[ProductStock](productstock_criterion.md)|Product's numerical stock| diff --git a/docs/search/criteria_reference/productavailability_criterion.md b/docs/search/criteria_reference/productavailability_criterion.md index 01cf312792..d79e3220ba 100644 --- a/docs/search/criteria_reference/productavailability_criterion.md +++ b/docs/search/criteria_reference/productavailability_criterion.md @@ -8,9 +8,35 @@ The `ProductAvailability` Search Criterion searches for products by their availa ## Example +### PHP + ``` php $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductAvailability(true) ); ``` + +### REST API + +=== "XML" + + ```xml + + + false + + ``` + +=== "JSON" + + ```json + { + "ProductQuery": { + "Filter": { + "ProductAvailabilityCriterion": false + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/productcategory_criterion.md b/docs/search/criteria_reference/productcategory_criterion.md index f98e0dc0dc..2aa791c55f 100644 --- a/docs/search/criteria_reference/productcategory_criterion.md +++ b/docs/search/criteria_reference/productcategory_criterion.md @@ -8,9 +8,38 @@ The `ProductCategory` Search Criterion searches for products by the category the ## Example +### PHP + ``` php $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductCategory([2, 3]) ); ``` + +### REST API + +=== "XML" + + ```xml + + + [2, 3] + + + ``` + +=== "JSON" + + ```json + { + "ProductQuery": { + "Filter": { + "ProductCategoryCriterion": [ + 2, + 3 + ] + } + } + } + ``` diff --git a/docs/search/criteria_reference/productcode_criterion.md b/docs/search/criteria_reference/productcode_criterion.md index bd367603dc..3ba1867a8d 100644 --- a/docs/search/criteria_reference/productcode_criterion.md +++ b/docs/search/criteria_reference/productcode_criterion.md @@ -8,9 +8,39 @@ The `ProductCode` Search Criterion searches for products by their codes. ## Example +### PHP + ``` php $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductCode(['ergo_desk', 'alter_desk']) ); ``` + +### REST API + +=== "XML" + +```xml + + + ski + snowboard + + +``` + +=== "JSON" + + ```json + { + "ProductQuery": { + "Filter": { + "ProductCodeCriterion": [ + "ski", + "snowboard" + ] + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/productname_criterion.md b/docs/search/criteria_reference/productname_criterion.md index d0b319e7d7..33a673f144 100644 --- a/docs/search/criteria_reference/productname_criterion.md +++ b/docs/search/criteria_reference/productname_criterion.md @@ -8,9 +8,35 @@ The `ProductName` Search Criterion searches for products by theis names. ## Example +### PHP + ``` php $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductName('sofa*') ); ``` + +### REST API + +=== "XML" + + ```xml + + + sofa* + + + ``` + +=== "JSON" + + ```json + { + "ProductQuery": { + "Filter": { + "ProductNameCriterion": "sofa*" + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/productstock_criterion.md b/docs/search/criteria_reference/productstock_criterion.md index c4b3911422..29bf6b6965 100644 --- a/docs/search/criteria_reference/productstock_criterion.md +++ b/docs/search/criteria_reference/productstock_criterion.md @@ -9,6 +9,8 @@ The `ProductStock` Search Criterion searches for products by their numerical sto ## Example +### PHP + ``` php $productQuery = new ProductQuery( null, diff --git a/docs/search/criteria_reference/productstockrange_criterion.md b/docs/search/criteria_reference/productstockrange_criterion.md index 92608d1549..da6548c146 100644 --- a/docs/search/criteria_reference/productstockrange_criterion.md +++ b/docs/search/criteria_reference/productstockrange_criterion.md @@ -9,6 +9,8 @@ The `ProductStockRange` Search Criterion searches for products by their numerica ## Example +### PHP + ``` php $productQuery = new ProductQuery( null, diff --git a/docs/search/criteria_reference/producttype_criterion.md b/docs/search/criteria_reference/producttype_criterion.md index 97e92f2b16..37b57d7135 100644 --- a/docs/search/criteria_reference/producttype_criterion.md +++ b/docs/search/criteria_reference/producttype_criterion.md @@ -8,9 +8,35 @@ The `ProductType` Search Criterion searches for products by their codes. ## Example +### PHP + ``` php $query = new ProductQuery( null, new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductType(['dress']) ); ``` + +### REST API + +=== "XML" + + ```xml + + + desk + + + ``` + +=== "JSON" + + ```json + { + "ProductQuery": { + "Filter": { + "ProductTypeCriterion": "desk" + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/rangemeasurementattributemaximum_criterion.md b/docs/search/criteria_reference/rangemeasurementattributemaximum_criterion.md index b981740d47..ee0ce321b4 100644 --- a/docs/search/criteria_reference/rangemeasurementattributemaximum_criterion.md +++ b/docs/search/criteria_reference/rangemeasurementattributemaximum_criterion.md @@ -9,6 +9,8 @@ The `RangeMeasurementAttributeMaximum` Search Criterion searches for products by ## Example +### PHP + ``` php $value = $this->measurementService->buildSimpleValue('length', 150, 'centimeter'); diff --git a/docs/search/criteria_reference/rangemeasurementattributeminimum_criterion.md b/docs/search/criteria_reference/rangemeasurementattributeminimum_criterion.md index 2b8444b3d8..c80876a0da 100644 --- a/docs/search/criteria_reference/rangemeasurementattributeminimum_criterion.md +++ b/docs/search/criteria_reference/rangemeasurementattributeminimum_criterion.md @@ -9,6 +9,8 @@ The `RangeMeasurementAttributeMinimum` Search Criterion searches for products by ## Example +### PHP + ``` php $value = $this->measurementService->buildSimpleValue('length', 100, 'centimeter'); diff --git a/docs/search/criteria_reference/remoteid_criterion.md b/docs/search/criteria_reference/remoteid_criterion.md index 4cbd6f4349..178790409e 100644 --- a/docs/search/criteria_reference/remoteid_criterion.md +++ b/docs/search/criteria_reference/remoteid_criterion.md @@ -1,6 +1,6 @@ -# RemoteId Criterion +# RemoteId / ContentRemoteId Criterion -The [`RemoteId` Search Criterion](https://github.com/ibexa/core/blob/main/src/contracts/Repository/Values/Content/Query/Criterion/RemoteId.php) +The [`RemoteId` / `ContentRemoteId` Search Criterion](https://github.com/ibexa/core/blob/main/src/contracts/Repository/Values/Content/Query/Criterion/RemoteId.php) searches for content based on its remote content ID. ## Arguments @@ -9,6 +9,30 @@ searches for content based on its remote content ID. ## Example +### PHP + ``` php $query->query = new Criterion\RemoteId('abab615dcf26699a4291657152da4337'); ``` + +### REST API + +=== "XML" + + ```xml + + + abab615dcf26699a4291657152da4337 + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "ContentRemoteIdCriterion": "abab615dcf26699a4291657152da4337" + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/search_criteria_reference.md b/docs/search/criteria_reference/search_criteria_reference.md index bf0ef80777..9046a1130e 100644 --- a/docs/search/criteria_reference/search_criteria_reference.md +++ b/docs/search/criteria_reference/search_criteria_reference.md @@ -49,6 +49,7 @@ Due to this storage limitation, searching content using the Country Field Type o |[ObjectStateId](objectstateid_criterion.md)|Object State ID|✔ |✔ |✔ | |[ObjectStateIdentifier](objectstateidentifier_criterion.md)|Object State Identifier|✔ |✔ |✔ | |[ParentLocationId](parentlocationid_criterion.md)|Location ID of a Content item's parent|✔ |✔ |✔ | +|[ParentLocationRemoteId](parentlocationremoteId_criterion.md)|Location remote ID of a Content item's parent|✔ |✔ | |[Priority](priority_criterion.md)|Location priority| |✔ |✔ | |[RemoteId](remoteid_criterion.md)|Remote content ID|✔ |✔ |✔ | |[SectionId](sectionid_criterion.md)|ID of the Section content is assigned to|✔ |✔ |✔ | diff --git a/docs/search/criteria_reference/sectionid_criterion.md b/docs/search/criteria_reference/sectionid_criterion.md index e2f578f99e..aa428db707 100644 --- a/docs/search/criteria_reference/sectionid_criterion.md +++ b/docs/search/criteria_reference/sectionid_criterion.md @@ -9,6 +9,30 @@ searches for content based on the ID of the Section it is assigned to. ## Example +### PHP + ``` php $query->query = new Criterion\SectionId(3); ``` + +### REST API + +=== "XML" + + ```xml + + + 3 + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "SectionIdCriterion": "3" + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/sectionidentifier_criterion.md b/docs/search/criteria_reference/sectionidentifier_criterion.md index c244ca6509..2253fc4434 100644 --- a/docs/search/criteria_reference/sectionidentifier_criterion.md +++ b/docs/search/criteria_reference/sectionidentifier_criterion.md @@ -9,6 +9,30 @@ searches for content based on the identifier of the Section it is assigned to. ## Example +### PHP + ``` php $query->query = new Criterion\SectionIdentifier(['sports', 'news']); ``` + +### REST API + +=== "XML" + + ```xml + + + sports + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "SectionIdentifierCriterion": "sports" + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/selectionattribute_criterion.md b/docs/search/criteria_reference/selectionattribute_criterion.md index 07ce8eee7b..2d79712a12 100644 --- a/docs/search/criteria_reference/selectionattribute_criterion.md +++ b/docs/search/criteria_reference/selectionattribute_criterion.md @@ -9,6 +9,8 @@ The `SelectionAttribute` Search Criterion searches for products by the value of ## Example +### PHP + ``` php $query = new ProductQuery( null, @@ -18,3 +20,35 @@ $query = new ProductQuery( ) ); ``` + +### REST API + +=== "XML" + + ```xml + + + + fabric_type + [cotton] + + + + ``` + +=== "JSON" + + ```json + { + "AttributeQuery": { + "Query": { + "SelectionAttributeCriterion": { + "identifier": "fabric_type", + "value": [ + "cotton" + ] + } + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/shipment_createdat_criterion.md b/docs/search/criteria_reference/shipment_createdat_criterion.md index e95b777199..6837ef0d6a 100644 --- a/docs/search/criteria_reference/shipment_createdat_criterion.md +++ b/docs/search/criteria_reference/shipment_createdat_criterion.md @@ -14,6 +14,8 @@ The `CreatedAt` Search Criterion searches for shipments based on the date when t ## Example +### PHP + ``` php $criteria = new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\CreatedAt( new DateTime('2023-03-01 14:07:02'), diff --git a/docs/search/criteria_reference/shipment_currency_criterion.md b/docs/search/criteria_reference/shipment_currency_criterion.md index 8ea9c687d1..78fe110038 100644 --- a/docs/search/criteria_reference/shipment_currency_criterion.md +++ b/docs/search/criteria_reference/shipment_currency_criterion.md @@ -13,6 +13,8 @@ The `Currency` Search Criterion searches for shipments based on the currency cod ## Example +### PHP + ``` php $query = new ShipmentQuery( new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\Currency('USD', 'CZK') diff --git a/docs/search/criteria_reference/shipment_id_criterion.md b/docs/search/criteria_reference/shipment_id_criterion.md index 1bb4affa7d..1679d6b286 100644 --- a/docs/search/criteria_reference/shipment_id_criterion.md +++ b/docs/search/criteria_reference/shipment_id_criterion.md @@ -13,6 +13,8 @@ The `Id` Search Criterion searches for shipments based on the shipment ID. ## Example +### PHP + ``` php $query = new ShipmentQuery( new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\Id(2) diff --git a/docs/search/criteria_reference/shipment_identifier_criterion.md b/docs/search/criteria_reference/shipment_identifier_criterion.md index ed88b30523..d5a747c67a 100644 --- a/docs/search/criteria_reference/shipment_identifier_criterion.md +++ b/docs/search/criteria_reference/shipment_identifier_criterion.md @@ -13,6 +13,8 @@ The `Identifier` Search Criterion searches for shipments based on the shipment i ## Example +### PHP + ``` php $query = new ShipmentQuery( new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\Identifier('f1t7z-3rb3rt') diff --git a/docs/search/criteria_reference/shipment_logicaland_criterion.md b/docs/search/criteria_reference/shipment_logicaland_criterion.md index 66ada3a329..1c1bca7d71 100644 --- a/docs/search/criteria_reference/shipment_logicaland_criterion.md +++ b/docs/search/criteria_reference/shipment_logicaland_criterion.md @@ -13,10 +13,13 @@ The `LogicalAnd` Search Criterion matches shipments if all provided Criteria mat ## Example +### PHP + ``` php -$query->query = new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\LogicalAnd([ - new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\CreatedAt(new DateTime('2023-03-01')), - new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\ShippingMethod($shippingMethod) +$query->query = new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\LogicalAnd( + [ + new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\CreatedAt(new DateTime('2023-03-01')), + new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\ShippingMethod($shippingMethod) ] ); ``` diff --git a/docs/search/criteria_reference/shipment_logicalor_criterion.md b/docs/search/criteria_reference/shipment_logicalor_criterion.md index 0cd93be3f7..55686eda3e 100644 --- a/docs/search/criteria_reference/shipment_logicalor_criterion.md +++ b/docs/search/criteria_reference/shipment_logicalor_criterion.md @@ -13,10 +13,13 @@ The `LogicalOr` Search Criterion matches shipments if at least one of the provid ## Example +### PHP + ``` php -$query->query = new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\LogicalOr([ - new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\CreatedAt(new DateTime('2023-03-01')), - new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\ShippingMethod($shippingMethod) +$query->query = new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\LogicalOr( + [ + new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\CreatedAt(new DateTime('2023-03-01')), + new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\ShippingMethod($shippingMethod) ] ); ``` diff --git a/docs/search/criteria_reference/shipment_shipping_method_criterion.md b/docs/search/criteria_reference/shipment_shipping_method_criterion.md index f95fff7ae6..c8a2157173 100644 --- a/docs/search/criteria_reference/shipment_shipping_method_criterion.md +++ b/docs/search/criteria_reference/shipment_shipping_method_criterion.md @@ -13,6 +13,8 @@ The `ShippingMethod` Search Criterion searches for shipments based on a shipping ## Example +### PHP + ``` php $query = new ShipmentQuery( new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\ShippingMethod($shippingMethod) diff --git a/docs/search/criteria_reference/shipment_status_criterion.md b/docs/search/criteria_reference/shipment_status_criterion.md index 84afcc4e07..2d0ea888af 100644 --- a/docs/search/criteria_reference/shipment_status_criterion.md +++ b/docs/search/criteria_reference/shipment_status_criterion.md @@ -13,6 +13,8 @@ The `Status` Search Criterion searches for shipments based on shipment status. ## Example +### PHP + ``` php $query = new ShipmentQuery( new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\Status('pending') diff --git a/docs/search/criteria_reference/shipment_updatedat_criterion.md b/docs/search/criteria_reference/shipment_updatedat_criterion.md index ae190a3046..d38c04d766 100644 --- a/docs/search/criteria_reference/shipment_updatedat_criterion.md +++ b/docs/search/criteria_reference/shipment_updatedat_criterion.md @@ -14,6 +14,8 @@ The `UpdatedAt` Search Criterion searches for shipments based on the date when t ## Example +### PHP + ``` php $criteria = new \Ibexa\Contracts\Shipping\Shipment\Query\Criterion\UpdatedAt( new DateTime('2023-03-01'), diff --git a/docs/search/criteria_reference/sibling_criterion.md b/docs/search/criteria_reference/sibling_criterion.md index 6a64ee660a..f6614a63a6 100644 --- a/docs/search/criteria_reference/sibling_criterion.md +++ b/docs/search/criteria_reference/sibling_criterion.md @@ -10,6 +10,8 @@ searches for content under the same parent as the indicated Location. ## Example +### PHP + ``` php $query->query = new Criterion\Sibling(59, 2); ``` @@ -21,3 +23,33 @@ and provide it with the Location object: $location = $locationService->loadLocation(59); $query->query = Criterion\Sibling::fromLocation($location); ``` + +### REST API + +### REST API + +=== "XML" + + ```xml + + + + 85 + 81 + + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "SiblingCriterion": { + "locationId": 85, + "parentLocationId": 81 + } + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/simplemeasurementattribute_criterion.md b/docs/search/criteria_reference/simplemeasurementattribute_criterion.md index a948daed98..e26ec572ba 100644 --- a/docs/search/criteria_reference/simplemeasurementattribute_criterion.md +++ b/docs/search/criteria_reference/simplemeasurementattribute_criterion.md @@ -9,6 +9,8 @@ The `SimpleMeasurementAttribute` Search Criterion searches for products by the v ## Example +### PHP + ``` php $value = $this->measurementService->buildSimpleValue('length', 120, 'centimeter'); diff --git a/docs/search/criteria_reference/subtree_criterion.md b/docs/search/criteria_reference/subtree_criterion.md index 10c9aeeb6e..ed258660b2 100644 --- a/docs/search/criteria_reference/subtree_criterion.md +++ b/docs/search/criteria_reference/subtree_criterion.md @@ -1,8 +1,8 @@ # Subtree Criterion The [`Subtree` Search Criterion](https://github.com/ibexa/core/blob/main/src/contracts/Repository/Values/Content/Query/Criterion/Subtree.php) -searches for content based on its subtree. -It will return the Content item and all the Content items below it in the subtree. +searches for content based on its Location ID subtree path. +It returns the Content item and all the Content items below it in the subtree. ## Arguments @@ -10,6 +10,30 @@ It will return the Content item and all the Content items below it in the subtre ## Example +### PHP + ``` php $query->query = new Criterion\Subtree('/1/2/71/72/'); ``` + +### REST API + +=== "XML" + + ```xml + + + /1/2/71/ + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "SubtreeCriterion": "/1/2/71/" + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/taxonomy_entry_id.md b/docs/search/criteria_reference/taxonomy_entry_id.md index 9a79d56ebd..18a1c5c93c 100644 --- a/docs/search/criteria_reference/taxonomy_entry_id.md +++ b/docs/search/criteria_reference/taxonomy_entry_id.md @@ -9,6 +9,8 @@ searches for content based on the ID of the Taxonomy Entry it is assigned to. ## Example +### PHP + ``` php $query->query = new Criterion\TaxonomyEntryId(1); ``` diff --git a/docs/search/criteria_reference/useremail_criterion.md b/docs/search/criteria_reference/useremail_criterion.md index 705ff074d9..fe2c5f6d57 100644 --- a/docs/search/criteria_reference/useremail_criterion.md +++ b/docs/search/criteria_reference/useremail_criterion.md @@ -14,6 +14,8 @@ Solr search engine and Elasticsearch support IN and EQ operators only. ## Example +### PHP + ``` php $query->query = new Criterion\UserEmail(['johndoe']); ``` @@ -21,3 +23,25 @@ $query->query = new Criterion\UserEmail(['johndoe']); ``` php $query->query = new Criterion\UserEmail('nospam*', Criterion\Operator::LIKE); ``` + +### REST API + +=== "XML" + + ```xml + + + j.black* + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "UserEmailCriterion": "j.black*" + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/userid_criterion.md b/docs/search/criteria_reference/userid_criterion.md index 9b549aa25a..a5a012c5df 100644 --- a/docs/search/criteria_reference/userid_criterion.md +++ b/docs/search/criteria_reference/userid_criterion.md @@ -9,6 +9,30 @@ searches for content based on the User ID. ## Example +### PHP + ``` php $query->query = new Criterion\UserId([14]); ``` + +### REST API + +=== "XML" + + ```xml + + + 14 + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "UserIdCriterion": "14" + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/userlogin_criterion.md b/docs/search/criteria_reference/userlogin_criterion.md index 451802b706..964decea74 100644 --- a/docs/search/criteria_reference/userlogin_criterion.md +++ b/docs/search/criteria_reference/userlogin_criterion.md @@ -14,6 +14,8 @@ Solr search engine and Elasticsearch support IN and EQ operators only. ## Example +### PHP + ``` php $query->query = new Criterion\UserLogin(['johndoe']); ``` @@ -21,3 +23,25 @@ $query->query = new Criterion\UserLogin(['johndoe']); ``` php $query->query = new Criterion\UserLogin('adm*', Criterion\Operator::LIKE); ``` + +### REST API + +=== "XML" + + ```xml + + + johndoe + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "UserLoginCriterion": "johndoe" + } + } + ``` \ No newline at end of file diff --git a/docs/search/criteria_reference/usermetadata_criterion.md b/docs/search/criteria_reference/usermetadata_criterion.md index d3abbb5c30..eccba988fc 100644 --- a/docs/search/criteria_reference/usermetadata_criterion.md +++ b/docs/search/criteria_reference/usermetadata_criterion.md @@ -11,13 +11,47 @@ searches for content based on its creator or modifier. ## Example +### PHP + ``` php $query->query = new Criterion\UserMetadata(Criterion\UserMetadata::GROUP, Criterion\Operator::EQ, 12); ``` +### REST API + +=== "XML" + + ```xml + + + + GROUP + EQ + 12 + + + + ``` + +=== "JSON" + + ```json + { + "Query": { + "Filter": { + "UserMetadataCriterion": { + "target": "GROUP", + "operator": "EQ", + "value": 12 + } + } + } + } + ``` + ## Use case -You can use the `UserMetadata` Criterion to search for blog posts created by the Contributor User Group: +You can use the `UserMetadata` Criterion to search for blog posts created by the Contributor user group: ``` php hl_lines="7" // ID of your custom Contributor User Group diff --git a/docs/search/criteria_reference/visibility_criterion.md b/docs/search/criteria_reference/visibility_criterion.md index 0222b88dfe..54a514f22b 100644 --- a/docs/search/criteria_reference/visibility_criterion.md +++ b/docs/search/criteria_reference/visibility_criterion.md @@ -15,6 +15,30 @@ Use Location Search to avoid this. ## Example +### PHP + ``` php $query->query = new Criterion\Visibility(Criterion\Visibility::HIDDEN); ``` + +### REST API + +=== "XML" + + ```xml + + + HIDDEN + + + ``` + +=== "JSON" + + ```json + "Query": { + "Filter": { + "ContentIdCriterion": "HIDDEN" + } + } + ``` \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index fcc05a2dd9..a7caf3c47f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -442,6 +442,7 @@ nav: - ObjectStateId: search/criteria_reference/objectstateid_criterion.md - ObjectStateIdentifier: search/criteria_reference/objectstateidentifier_criterion.md - ParentLocationId: search/criteria_reference/parentlocationid_criterion.md + - ParentLocationRemoteId: search/criteria_reference/parentlocationremoteId_criterion.md - Priority: search/criteria_reference/priority_criterion.md - RemoteId: search/criteria_reference/remoteid_criterion.md - SectionId: search/criteria_reference/sectionid_criterion.md @@ -459,6 +460,11 @@ nav: - LogicalOr Criterion: search/criteria_reference/logicalor_criterion.md - Product Search Criteria: - Product Search Criteria: search/criteria_reference/product_search_criteria.md + - AttributeName: search/criteria_reference/attributename_criterion.md + - AttributeGroupIdentifier: search/criteria_reference/attributegroupidentifier_criterion.md + - CatalogIdentifier: search/criteria_reference/catalogidentifier_criterion.md + - CatalogName: search/criteria_reference/catalogname_criterion.md + - CatalogStatus: search/criteria_reference/catalogstatus_criterion.md - BasePrice: search/criteria_reference/baseprice_criterion.md - CheckboxAttribute: search/criteria_reference/checkboxattribute_criterion.md - ColorAttribute: search/criteria_reference/colorattribute_criterion.md @@ -466,7 +472,9 @@ nav: - CreatedAtRange: search/criteria_reference/createdatrange_criterion.md - CustomPrice: search/criteria_reference/customprice_criterion.md - FloatAttribute: search/criteria_reference/floatattribute_criterion.md + - FloatAttributeRange: search/criteria_reference/floatattributerange_criterion.md - IntegerAttribute: search/criteria_reference/integerattribute_criterion.md + - IntegerAttributeRange: search/criteria_reference/integerattributerange_criterion.md - ProductAvailability: search/criteria_reference/productavailability_criterion.md - ProductStock: search/criteria_reference/productstock_criterion.md - ProductStockRange: search/criteria_reference/productstockrange_criterion.md