riot icon indicating copy to clipboard operation
riot copied to clipboard

How can I make my scoringFields persistent

Open sunface opened this issue 7 years ago • 2 comments

Hi, in the scoringFields example, you just mentioned that scoringFields can be persistent,but how? We are now using riot as our first level chioce, so please help us

sunface avatar Feb 04 '18 07:02 sunface

文档的 MyScoringFields 数据通过 riot.Engine 的 IndexDoc 函数传给排序器保存在内存中。然后通过 Search 函数的参数调用 MyScoringCriteria 进行查询。

当然,MyScoringCriteria的Score 函数也可以通过 docId 从硬盘或数据库读取更多文档数据用于打分,但速度要比从内存中直接读慢许多,请在内存和速度之间合适取舍。

sunface avatar Feb 04 '18 07:02 sunface

+1

suntong avatar Nov 15 '20 04:11 suntong