Remove IDF and custom scoring

There is a recipes website. If the recipe has “healthy” 3 times, it should have a score of 1.5. If “healthy” appears 5 times, it should have a score of 2. Is there a possibility to get this done? (Ideally removing IDF and scoring based on occurence)

Yes, I think what you want is a custom similarity: Similarity module | Elasticsearch Guide [7.10] | Elastic

More goodies on that topic here: Search Relevance - Solr & Elasticsearch Similarities - sematext.com