aviyelverse / Open-Source-Requests

A curation of paid and unpaid requests for the community to work on.
18 stars 4 forks source link

Ability to apply filters to overrides and pinned hits #50

Open ghost opened 2 years ago

ghost commented 2 years ago

This feature allows curated / pinned hits to only be triggered if the pinned hit satisfies the current filter_by query. Available in 0.23.0.rc45.

Example Usage:

curl "http://localhost:8108/collections/products/overrides/customize-apple" -X PUT -H "Content-Type: application/json" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" -d '{
  "rule": {
    "query": "apple",
    "match": "exact"
  },
  "includes": [
    {"id": "422", "position": 1},
    {"id": "54", "position": 2}
  ],
  "filter_curated_hits": true
}'
curl "http://localhost:8108/collections/products/documents/search?q=apple&query_by=name&pinned_hits=422:1&filter_curated_hits=true"