Hi there,
I have a problem understanding how ACCUM works. We are using a text index over XML documents and want to apply a very simple relevance weighting based on occurences within a certain tag. For example, if TAG1 has a weight of 10, each occurrence in TAG1 should add 10 to the score. We have 13 Tags that should be weighted and multiple occurences in different tags should be cumulated. So 3 occurences in TAG1 (weight 10) and one occurence in TAG2 (weight 7) should result in a score of 37.
Just searching in TAG1 works as expected:
( DEFINESCORE( foo, OCCURRENCE ) WITHIN TAG1 ) * 10
Three occurences score 30.
Just searching in TAG2 works also as expected. One occurence scores 7. However, when I combine both searches
(( DEFINESCORE( foo, OCCURRENCE ) WITHIN TAG1 ) * 10) ACCUM (( DEFINESCORE( foo, OCCURRENCE ) WITHIN TAG2 ) * 7)
the score is 61 instead of 37. More interestingly, including all 13 tags (of which most do not contain the search word) lowers the score again.
I ended up with searches where two documents containing completely different occurrences of a search word got exactly the same score.