@@ -49,6 +49,7 @@ typedef struct
4949{
5050QueryItem * * item ;
5151int16 nitem ;
52+ QueryItem * item_first ;
5253int32 keyn ;
5354uint8 wclass ;
5455int32 pos ;
@@ -711,7 +712,6 @@ get_docrep_addinfo(bool *check, QueryRepresentation *qr, int *map_item_operand,
711712Datum * addInfo ,bool * addInfoIsNull ,uint32 * doclen )
712713{
713714QueryItem * item = GETQUERY (qr -> query );
714- WordEntryPos post ;
715715int32 dimt ,
716716j ,
717717i ;
@@ -724,7 +724,8 @@ get_docrep_addinfo(bool *check, QueryRepresentation *qr, int *map_item_operand,
724724
725725for (i = 0 ;i < qr -> query -> size ;i ++ )
726726{
727- int keyN ;
727+ int keyN ;
728+ WordEntryPos post = 0 ;
728729
729730if (item [i ].type != QI_VAL )
730731continue ;
@@ -756,12 +757,10 @@ get_docrep_addinfo(bool *check, QueryRepresentation *qr, int *map_item_operand,
756757
757758for (j = 0 ;j < dimt ;j ++ )
758759{
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 );
763761
764762doc [cur ].item = NULL ;
763+ doc [cur ].item_first = item + i ;
765764doc [cur ].keyn = keyN ;
766765doc [cur ].pos = WEP_GETPOS (post );
767766doc [cur ].wclass = WEP_GETWEIGHT (post );
@@ -980,7 +979,10 @@ calc_score_docr(float4 *arrdata, DocRepresentation *doc, uint32 doclen,
980979InvSum += arrdata [ptr -> wclass ];
981980/* SK: Quick and dirty hash key. Hope collisions will be not too frequent. */
982981new_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 ;
984986ptr ++ ;
985987}
986988