Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-28783

As a Developer I want to search using REST FieldCriterion

    XMLWordPrintable

    Details

    • Sprint:
      [2.1] Sprint 3
    • Story Points:
      5

      Description

      The goal here is to be able to perform REST search (via POST /views) endpoint using custom FieldCriterion, so that means exposing PHP API
      eZ\Publish\API\Repository\Values\Content\Query\Criterion\Field to REST.

      Sample HTTP POST payload:

      POST /api/ezp/v2/views
      X-CSRF-Token: {{YOUR_CSRF_TOKEN}}
      Content-Type: application/vnd.ez.api.ViewInput+json; version=1.1
      
      {
         "ViewInput":{
            "identifier":"your-query-id",
            "public":false,
            "ContentQuery":{
               "Criteria":{
      
               },
               "FacetBuilders":{
      
               },
               "SortClauses":{
      
               },
               "Query":{
                  "Field": [{"name": "name", "operator": "CONTAINS", "value": "Welcome"}]
               },
               "limit":10,
               "offset":0
            }
         }
      }
      

      PoC PR was created some time ago here: https://github.com/ezsystems/ezpublish-kernel/pull/2179

      What is missing there is a use case when Field criterion is needed more than once, so either for multiple fields or the same field with different values.

      The open question is - should such case be wrapped in AND or OR expression?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              andrzej.longosz@ez.no Andrzej Longosz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: