Quick Sanity check, take there is no more efficient way of doing something like this?
SELECT COUNT(*) FROM sample WHERE MATCH('@tags keyword');
SELECT COUNT(*) FROM sample WHERE MATCH('@title keyword');
SELECT COUNT(*) FROM sample WHERE MATCH('@comment keyword');
SELECT COUNT(*) FROM sample WHERE MATCH('@realname keyword');
(actually have over 10 fields to check! - complicated by the fact sample is a distributed index)
… CALL KEYWORDS() of course can be used for global matches, but don’t think a similar method for field matches exist? (though if a multi word or phrase match etc, will of course need to use MATCH() anyway )
you could enumerate all matched fields with fieldmask ranker or field_mask factor
select id, weight() as w from fld where match ( '( @(title,body) w1 w2 )' ) group by w option ranker='fieldmask';
then hard to keep the uint weight with particular bitset into separate groups.
Maybe use bitdot operator to move particular bit into its own group or recent added Functions > Arrays and conditions functions | Manticore Search Manual HISTOGRAM expression. However I doubt it as we can not map the single value into multiple groups
Will need to reaggregate by ‘bit’ in the weight, so need the count
the issue that the field mask for fields 1,2 could be 1,2,3 and after you get the field_mask as w and counter for these it is hard to figure out from the w=3 what counter relates to field 1 and what relates to field 2, ie hard to decompose summed counters back into particular fields, ie
w, count
1, 5
2, 10
3, 3
could be
w, count
1, 7
2, 11
or
w, count
1, 6
2, 12
need something like mva grouper that enumerate all values at the the single document and produces multiple groups
field_mask ranker > weight > field_list(uint) > [field_index_x, field_index_y, …] > grouper_like_mva
but we lack of the operators for single value > multiple values