<@U01NZ4D0LDD> during upsert method ranking feild ...
# community-help
a
@Jason Bosco during upsert method ranking feild is removed why , ranking is passed only form analytics rule
f
Hey @Akash Kumar, could you explain the pipeline you're using?
a
basically ranking ,sales_score,cart_score feild is added in schema and these are updated by only analytics rules which is already set and working prefectly , but when we are using uperst method for updating other feild detail ranking feild is removed for that particular document
f
By removed, are you saying that it goes to null / 0 or is it just ignored when indexing?
a
"document": { "author": "jmdi", "availBookType": [ "2" ], "binding": "paperback", "bookCondition": [ "BrandNew" ], "bookId": 1737208, "bookThumb": "medium/61_9788195586295_t1_1753985322.jpg", "bookType": 2, "cashbackPercent": 25.0, "category": [ "312" ], "categoryPathId": [ "303|University Books", "304|Engineering", "312|Marine" ], "description": "<h3><strong>Comprehensive Description of IMU CET Exam Preparation Book – Your Gateway to Success</strong></h3><p>If you're gearing up for the <i>IMU CET exam</i> and seeking the ultimate resource to e...", "discountPercent": 20.0, "iDate": 1774875494, "id": "1737208", "imageUrl": "

https://d25xohcupqd66a.cloudfront.net/medium/61_9788195586295_t1_1753985322.jpg▾

", "isMostLoved": 1, "isOutOfStock": "N", "isbn": "9788195586295", "language": "english", "mrp": 1999, "num_is_out_of_stack": 78, "parentCategory": [ "304", "303" ], "price": 1999, "productUrl": "https://www.mypustak.com/product/crack-imu-cet-entrance-exam?1737208", "publication": "aflatoon publishers", "qty": 3590, "searchKeywordRank": 0, "slug": "crack-imu-cet-entrance-exam", "soldQty": 13587, "title": "CRACK IMU-CET Entrance Exam", "uDate": 1774875494 },
ranking feild is removed
f
Your payload does not include
ranking
. Upserting is doing an idempotent full document replacement here, not a partial merge. Since your payload omits it, it will override it. If you want just a partial merge of the documents, you can use a document update by using the
update
action.
a
we are using upsert due to if document not create it will create
f
Then somewhere, you've overridden the analytics-generated one with one of your own, since Typesense won't automatically try to remove it from the index, it handles it as a special auto-generated field
a
yes initally we add ranking value for first time
f
If you want "create if missing" and "partial update if exists", use the
emplace
action. If you continue using upsert, you must include ranking/sales_score/cart_score in every payload.