@@ -49,6 +49,7 @@ typedef struct
49
49
{
50
50
QueryItem * * item ;
51
51
int16 nitem ;
52
+ QueryItem * item_first ;
52
53
int32 keyn ;
53
54
uint8 wclass ;
54
55
int32 pos ;
@@ -711,7 +712,6 @@ get_docrep_addinfo(bool *check, QueryRepresentation *qr, int *map_item_operand,
711
712
Datum * addInfo , bool * addInfoIsNull , uint32 * doclen )
712
713
{
713
714
QueryItem * item = GETQUERY (qr -> query );
714
- WordEntryPos post ;
715
715
int32 dimt ,
716
716
j ,
717
717
i ;
@@ -724,7 +724,8 @@ get_docrep_addinfo(bool *check, QueryRepresentation *qr, int *map_item_operand,
724
724
725
725
for (i = 0 ; i < qr -> query -> size ; i ++ )
726
726
{
727
- int keyN ;
727
+ int keyN ;
728
+ WordEntryPos post = 0 ;
728
729
729
730
if (item [i ].type != QI_VAL )
730
731
continue ;
@@ -756,12 +757,10 @@ get_docrep_addinfo(bool *check, QueryRepresentation *qr, int *map_item_operand,
756
757
757
758
for (j = 0 ; j < dimt ; j ++ )
758
759
{
759
- if (ptrt == (char * ) POSNULL .pos )
760
- post = POSNULL .pos [0 ];
761
- else
762
- ptrt = decompress_pos (ptrt , & post );
760
+ ptrt = decompress_pos (ptrt , & post );
763
761
764
762
doc [cur ].item = NULL ;
763
+ doc [cur ].item_first = item + i ;
765
764
doc [cur ].keyn = keyN ;
766
765
doc [cur ].pos = WEP_GETPOS (post );
767
766
doc [cur ].wclass = WEP_GETWEIGHT (post );
@@ -980,7 +979,10 @@ calc_score_docr(float4 *arrdata, DocRepresentation *doc, uint32 doclen,
980
979
InvSum += arrdata [ptr -> wclass ];
981
980
/* SK: Quick and dirty hash key. Hope collisions will be not too frequent. */
982
981
new_cover_key = new_cover_key << 1 ;
983
- new_cover_key += (int )(uintptr_t )ptr -> item ;
982
+ if (ptr -> item != NULL )
983
+ new_cover_key += (int )(uintptr_t )ptr -> item ;
984
+ else
985
+ new_cover_key += (int )(uintptr_t )ptr -> item_first ;
984
986
ptr ++ ;
985
987
}
986
988
0 commit comments