Skip to content

Adding document based scoring #51

@AliFlux

Description

@AliFlux

Hi,

Is there a way to score some documents higher than others? Something like weight in whoosh?

For example:
In an ecommerce site, we can have a popularity field for each items. And when user searches for something, the popular documents appear on top.

This is already implemented in tantivy core repo:
https://docs.rs/tantivy/0.10.3/tantivy/collector/struct.TopDocs.html#example

I understand that bringing the callback from rust to python may make it slower. Therefore the python interface should be pretty simple. E.g. searcher.search(query, weight_by='popularity')

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestfeature-parityFeature parity with upstream tantivyhelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions