DEV Community

tackme
tackme

Posted on

2 2

Azure Searchで取得したファセットのカウント数が実際のドキュメント数と異なる場合の対処法

Azure Searchで取得したファセットのカウント数と実際のドキュメントの数が異なっている現象に遭遇しました。

Azure Searchではシャーディングアーキテクチャが原因で不正確な値を返すことがあるようです。ファセット取得クエリで以下のようにcountに大きな値を渡すことで正確な値を取得できるようになります。

&facet=color,count:100
Enter fullscreen mode Exit fullscreen mode

ただしドキュメント数が多い場合はパフォーマンスが低下する可能性があるため注意が必要です。

参考

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay