Filter by match_phrase, score by phrase frequency

Hi there!

I want to score document relevance by exact phrase frequency in a field. Some queries have multiple phrases for filtering. Is there any better way than scripting a custom score function?

UPD: My experiments with scripted score function and shingles http://lpaste.net/2853889383168212992. So far scripted solution works best. However I'm unsure about performance impact.

Thanks!

Do you always need to sort by phrase freq? If yes then I think you could just use a regular phrase query on a field that has norms disabled.

jpountz, all the time. Hence why I use similarity provider that returns 1 as IDF.