tntsearch icon indicating copy to clipboard operation
tntsearch copied to clipboard

[Feature Request] Field importance

Open simshaun opened this issue 8 years ago • 3 comments

Forgive me if this already exists, but I couldn't find anything relating to it.

Using https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-boost.html as an example, it would be nice to be able to declare each field's importance.

Use case: If a result is matched by its title, it should be more relevant than another result matched by its body.

simshaun avatar Aug 24 '17 02:08 simshaun

Was totally searching for this too. I think for now I'll have to do it manually. But it could be great to have things like weights on fields, or weights on exact match or partial match, things like that :)

Thanks guys!

rkyoku avatar Apr 30 '18 12:04 rkyoku

I just repeated more important fields in the SQL query passed over for the index creation:

SELECT id, REPEAT(CONCAT(title, ' '), 5) as title, REPEAT(CONCAT(subtitle, ' '), 3) as subtitle, ...

Consequently, a match in the title leads to a higher document score than a match in the subtitle for instance. A bit ugly but it works so far...

RomanBoegli avatar Jan 02 '20 20:01 RomanBoegli

Linked issue #38

Tofandel avatar Mar 15 '24 18:03 Tofandel