|
| 1 | +Collection: |
| 2 | + type: object |
| 3 | + properties: |
| 4 | + id: |
| 5 | + type: string |
| 6 | + example: '5db3039e-04b5-4ed6-a00e-ba3304032c5a' |
| 7 | + name: |
| 8 | + type: string |
| 9 | + example: 'Summer Deals' |
| 10 | + indexName: |
| 11 | + type: string |
| 12 | + example: 'prod_products_EN' |
| 13 | + createdAt: |
| 14 | + type: string |
| 15 | + format: date-time |
| 16 | + example: '2024-10-07T00:00:00Z' |
| 17 | + updatedAt: |
| 18 | + type: string |
| 19 | + format: date-time |
| 20 | + example: '2024-10-07T00:00:00Z' |
| 21 | + status: |
| 22 | + $ref: '#/CollectionStatus' |
| 23 | + conditions: |
| 24 | + $ref: '#/Conditions' |
| 25 | + records: |
| 26 | + type: array |
| 27 | + items: |
| 28 | + type: string |
| 29 | + |
| 30 | +CollectionStatus: |
| 31 | + type: string |
| 32 | + description: | |
| 33 | + Collection commit status. |
| 34 | + Only returned if the request API key has write ACLs. |
| 35 | + enum: |
| 36 | + - COMMITTED |
| 37 | + - COMMITTING |
| 38 | + - TO_COMMIT |
| 39 | + |
| 40 | +CollectionUpsert: |
| 41 | + type: object |
| 42 | + description: API request body for upserting a Collection. |
| 43 | + properties: |
| 44 | + id: |
| 45 | + type: string |
| 46 | + indexName: |
| 47 | + type: string |
| 48 | + name: |
| 49 | + type: string |
| 50 | + description: |
| 51 | + type: string |
| 52 | + add: |
| 53 | + type: array |
| 54 | + description: a list of objectIDs. |
| 55 | + minItems: 0 |
| 56 | + items: |
| 57 | + type: string |
| 58 | + remove: |
| 59 | + type: array |
| 60 | + description: a list of objectIDs. |
| 61 | + minItems: 0 |
| 62 | + items: |
| 63 | + type: string |
| 64 | + conditions: |
| 65 | + $ref: '#/Conditions' |
| 66 | + required: |
| 67 | + - indexName |
| 68 | + - name |
| 69 | + |
| 70 | +Conditions: |
| 71 | + type: object |
| 72 | + description: conditions to filter records. |
| 73 | + properties: |
| 74 | + facetFilters: |
| 75 | + type: array |
| 76 | + description: one-level nested array. A nesting indicates OR, filters combined with AND top-level. |
| 77 | + items: |
| 78 | + $ref: '#/FacetFilter' |
| 79 | + numericFilters: |
| 80 | + type: array |
| 81 | + description: one-level nested array. A nesting indicates OR, filters combined with AND top-level. |
| 82 | + items: |
| 83 | + $ref: '#/NumericFilter' |
| 84 | + |
| 85 | +# TODO: Check for common schema? |
| 86 | +FacetFilter: |
| 87 | + oneOf: |
| 88 | + - type: string |
| 89 | + pattern: '/^[^:]+[^\\]*:.+$/' |
| 90 | + example: 'brand:Apple' |
| 91 | + # FIXME: Not recognized here |
| 92 | + # examples: |
| 93 | + # normal: |
| 94 | + # value: 'brand:Apple' |
| 95 | + # summary: include Apple in the results |
| 96 | + # negated: |
| 97 | + # value: 'brand:-Apple' |
| 98 | + # summary: exclude Apple from the results |
| 99 | + # escaped: |
| 100 | + # value: 'discount:\-50%' |
| 101 | + # summary: include "-50%" in the results |
| 102 | + - type: array |
| 103 | + items: |
| 104 | + type: string |
| 105 | + pattern: '/^[^:]+[^\\]*:.+$/' |
| 106 | + example: 'brand:Samsung' |
| 107 | + |
| 108 | +# TODO: Check for common schema? |
| 109 | +NumericFilter: |
| 110 | + oneOf: |
| 111 | + - type: string |
| 112 | + pattern: '/(^[^:]+[^\\]*:\d*\.?\d* TO \d*\.?\d*$)|(^[^:]+[^\\]*(<|<=|=|>=|>)\d*\.?\d*$)/' |
| 113 | + example: 'price:5 TO 10' |
| 114 | + - type: array |
| 115 | + items: |
| 116 | + type: string |
| 117 | + pattern: '/(^[^:]+[^\\]*:\d*\.?\d* TO \d*\.?\d*$)|(^[^:]+[^\\]*(<|<=|=|>=|>)\d*\.?\d*$)/' |
| 118 | + example: 'rating<=4.3' |
0 commit comments