|
|
@@ -2017,7 +2017,7 @@ protected:
|
|
|
BYTE * GetTokenSyn ();
|
|
|
bool BlendAdjust ( BYTE * pPosition );
|
|
|
BYTE * GetBlendedVariant ();
|
|
|
- int CodepointArbitration ( int iCodepoint, bool bWasEscaped, bool bSpaceAhead );
|
|
|
+ int CodepointArbitration ( int iCodepoint, bool bWasEscaped, BYTE uNextByte );
|
|
|
|
|
|
typedef CSphOrderedHash <int, int, IdentityHash_fn, 4096> CSphSynonymHash;
|
|
|
bool LoadSynonym ( char * sBuffer, const char * szFilename, int iLine, CSphSynonymHash & tHash, CSphString & sError );
|
|
|
@@ -2568,7 +2568,7 @@ bool CSphCharsetDefinitionParser::AddRange ( const CSphRemapRange & tRange, CSph
|
|
|
}
|
|
|
|
|
|
CSphString sError;
|
|
|
- sError.SetSprintf ( "dest range (U+0x%x) below U+0x20, not allowed", tRange.m_iRemapStart );
|
|
|
+ sError.SetSprintf ( "dest range (U+%x) below U+20, not allowed", tRange.m_iRemapStart );
|
|
|
Error ( sError.cstr() );
|
|
|
return false;
|
|
|
}
|
|
|
@@ -3021,6 +3021,38 @@ bool ISphTokenizer::SetCaseFolding ( const char * sConfig, CSphString & sError )
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ const int MIN_CODE = 0x21;
|
|
|
+ ARRAY_FOREACH ( i, dRemaps )
|
|
|
+ {
|
|
|
+ CSphRemapRange & tMap = dRemaps[i];
|
|
|
+
|
|
|
+ if ( tMap.m_iStart<MIN_CODE || tMap.m_iStart>=m_tLC.MAX_CODE )
|
|
|
+ {
|
|
|
+ sphWarning ( "wrong character mapping start specified: U+%x, should be between U+%x and U+%x (inclusive); CLAMPED", tMap.m_iStart, MIN_CODE, m_tLC.MAX_CODE-1 );
|
|
|
+ tMap.m_iStart = Min ( Max ( tMap.m_iStart, MIN_CODE ), m_tLC.MAX_CODE-1 );
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( tMap.m_iEnd<MIN_CODE || tMap.m_iEnd>=m_tLC.MAX_CODE )
|
|
|
+ {
|
|
|
+ sphWarning ( "wrong character mapping end specified: U+%x, should be between U+%x and U+%x (inclusive); CLAMPED", tMap.m_iEnd, MIN_CODE, m_tLC.MAX_CODE-1 );
|
|
|
+ tMap.m_iEnd = Min ( Max ( tMap.m_iEnd, MIN_CODE ), m_tLC.MAX_CODE-1 );
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( tMap.m_iRemapStart<MIN_CODE || tMap.m_iRemapStart>=m_tLC.MAX_CODE )
|
|
|
+ {
|
|
|
+ sphWarning ( "wrong character remapping start specified: U+%x, should be between U+%x and U+%x (inclusive); CLAMPED", tMap.m_iRemapStart, MIN_CODE, m_tLC.MAX_CODE-1 );
|
|
|
+ tMap.m_iRemapStart = Min ( Max ( tMap.m_iRemapStart, MIN_CODE ), m_tLC.MAX_CODE-1 );
|
|
|
+ }
|
|
|
+
|
|
|
+ int iRemapEnd = tMap.m_iRemapStart+tMap.m_iEnd-tMap.m_iStart;
|
|
|
+ if ( iRemapEnd<MIN_CODE || iRemapEnd>=m_tLC.MAX_CODE )
|
|
|
+ {
|
|
|
+ sphWarning ( "wrong character remapping end specified: U+%x, should be between U+%x and U+%x (inclusive); IGNORED", iRemapEnd, MIN_CODE, m_tLC.MAX_CODE-1 );
|
|
|
+ dRemaps.Remove(i);
|
|
|
+ i--;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
m_tLC.Reset ();
|
|
|
m_tLC.AddRemaps ( dRemaps, 0 );
|
|
|
return true;
|
|
|
@@ -3695,20 +3727,34 @@ BYTE * CSphTokenizerTraits<IS_UTF8>::GetBlendedVariant ()
|
|
|
}
|
|
|
|
|
|
|
|
|
-static inline bool IsModifier ( int iSymbol )
|
|
|
+static inline bool IsCapital ( int iCh )
|
|
|
{
|
|
|
- return iSymbol=='^' || iSymbol=='$' || iSymbol=='=' || iSymbol=='*';
|
|
|
+ return iCh>='A' && iCh<='Z';
|
|
|
}
|
|
|
|
|
|
|
|
|
-static inline bool IsCapital ( int iCh )
|
|
|
+static inline bool IsWhitespace ( BYTE c )
|
|
|
{
|
|
|
- return iCh>='A' && iCh<='Z';
|
|
|
+ return ( c=='\0' || c==' ' || c=='\t' || c=='\r' || c=='\n' );
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+static inline bool IsWhitespace ( int c )
|
|
|
+{
|
|
|
+ return ( c=='\0' || c==' ' || c=='\t' || c=='\r' || c=='\n' );
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+static inline bool IsBoundary ( BYTE c, bool bPhrase )
|
|
|
+{
|
|
|
+ // FIXME? sorta intersects with specials
|
|
|
+ // then again, a shortened-down list (more strict syntax) is reasonble here too
|
|
|
+ return IsWhitespace(c) || c=='"' || ( !bPhrase && ( c=='(' || c==')' || c=='|' ) );
|
|
|
}
|
|
|
|
|
|
|
|
|
template < bool IS_UTF8 >
|
|
|
-int CSphTokenizerTraits<IS_UTF8>::CodepointArbitration ( int iCode, bool bWasEscaped, bool bSpaceAhead )
|
|
|
+int CSphTokenizerTraits<IS_UTF8>::CodepointArbitration ( int iCode, bool bWasEscaped, BYTE uNextByte )
|
|
|
{
|
|
|
/////////////////////////////
|
|
|
// indexing time arbitration
|
|
|
@@ -3809,7 +3855,7 @@ int CSphTokenizerTraits<IS_UTF8>::CodepointArbitration ( int iCode, bool bWasEsc
|
|
|
{
|
|
|
bool bBlend =
|
|
|
bWasEscaped || // escaped characters should always act as blended
|
|
|
- ( m_bPhrase && !IsModifier ( iSymbol ) ) || // non-modifier special inside phrase
|
|
|
+ ( m_bPhrase && !sphIsModifier ( iSymbol ) ) || // non-modifier special inside phrase
|
|
|
( m_iAccum && ( iSymbol=='@' || iSymbol=='/' || iSymbol=='-' ) ); // some specials in the middle of a token
|
|
|
|
|
|
// clear special or blend flags
|
|
|
@@ -3821,12 +3867,12 @@ int CSphTokenizerTraits<IS_UTF8>::CodepointArbitration ( int iCode, bool bWasEsc
|
|
|
// escaped specials are not special
|
|
|
// dash and dollar inside the word are not special (however, single opening modifier is not a word!)
|
|
|
// non-modifier specials within phrase are not special
|
|
|
- bool bDashInside = ( m_iAccum && iSymbol=='-' && !( m_iAccum==1 && IsModifier ( m_sAccum[0] ) ));
|
|
|
+ bool bDashInside = ( m_iAccum && iSymbol=='-' && !( m_iAccum==1 && sphIsModifier ( m_sAccum[0] ) ));
|
|
|
if ( iCode & FLAG_CODEPOINT_SPECIAL )
|
|
|
if ( bWasEscaped
|
|
|
|| bDashInside
|
|
|
- || ( m_iAccum && iSymbol=='$' && !bSpaceAhead )
|
|
|
- || ( m_bPhrase && iSymbol!='"' && !IsModifier ( iSymbol ) ) )
|
|
|
+ || ( m_iAccum && iSymbol=='$' && !IsBoundary ( uNextByte, m_bPhrase ) )
|
|
|
+ || ( m_bPhrase && iSymbol!='"' && !sphIsModifier ( iSymbol ) ) )
|
|
|
{
|
|
|
if ( iCode & FLAG_CODEPOINT_DUAL )
|
|
|
iCode &= ~( FLAG_CODEPOINT_SPECIAL | FLAG_CODEPOINT_DUAL );
|
|
|
@@ -3930,16 +3976,6 @@ static inline bool Special2Simple ( int & iCodepoint )
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
-static inline bool IsWhitespace ( BYTE c )
|
|
|
-{
|
|
|
- return ( c=='\0' || c==' ' || c=='\t' || c=='\r' || c=='\n' );
|
|
|
-}
|
|
|
-
|
|
|
-static inline bool IsWhitespace ( int c )
|
|
|
-{
|
|
|
- return ( c=='\0' || c==' ' || c=='\t' || c=='\r' || c=='\n' );
|
|
|
-}
|
|
|
-
|
|
|
template < bool IS_UTF8 >
|
|
|
BYTE * CSphTokenizerTraits<IS_UTF8>::GetTokenSyn ()
|
|
|
{
|
|
|
@@ -4015,7 +4051,7 @@ BYTE * CSphTokenizerTraits<IS_UTF8>::GetTokenSyn ()
|
|
|
iLastCodepoint = iCode;
|
|
|
}
|
|
|
|
|
|
- iFolded = CodepointArbitration ( iFolded, false, IsWhitespace ( *m_pCur ) );
|
|
|
+ iFolded = CodepointArbitration ( iFolded, false, *m_pCur );
|
|
|
|
|
|
iLastFolded = iFolded;
|
|
|
|
|
|
@@ -4260,7 +4296,7 @@ BYTE * CSphTokenizerTraits<IS_UTF8>::GetTokenSyn ()
|
|
|
iLast = iCode;
|
|
|
}
|
|
|
|
|
|
- iFolded = CodepointArbitration ( iFolded, false, IsWhitespace ( *m_pCur ) );
|
|
|
+ iFolded = CodepointArbitration ( iFolded, false, *m_pCur );
|
|
|
|
|
|
if ( IsSeparator ( iFolded, false ) )
|
|
|
{
|
|
|
@@ -4528,7 +4564,7 @@ BYTE * CSphTokenizer_SBCS::GetToken ()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- iCode = CodepointArbitration ( iCode, bWasEscaped, IsWhitespace ( *m_pCur ) );
|
|
|
+ iCode = CodepointArbitration ( iCode, bWasEscaped, *m_pCur );
|
|
|
|
|
|
// handle ignored chars
|
|
|
if ( iCode & FLAG_CODEPOINT_IGNORE )
|
|
|
@@ -4654,7 +4690,7 @@ BYTE * CSphTokenizer_SBCS::GetToken ()
|
|
|
// tricky bit
|
|
|
// heading modifiers must not (!) affected blended status
|
|
|
// eg. we want stuff like '=-' (w/o apostrophes) thrown away when pure_blend is on
|
|
|
- if (!( m_bQueryMode && !m_iAccum && IsModifier(iCode) ) )
|
|
|
+ if (!( m_bQueryMode && !m_iAccum && sphIsModifier(iCode) ) )
|
|
|
m_bNonBlended = m_bNonBlended || bNoBlend;
|
|
|
m_sAccum[m_iAccum++] = (BYTE)iCode;
|
|
|
}
|
|
|
@@ -4768,7 +4804,7 @@ BYTE * CSphTokenizer_UTF8::GetToken ()
|
|
|
}
|
|
|
|
|
|
// handle all the flags..
|
|
|
- iCode = CodepointArbitration ( iCode, bWasEscaped, IsWhitespace ( *m_pCur ) );
|
|
|
+ iCode = CodepointArbitration ( iCode, bWasEscaped, *m_pCur );
|
|
|
|
|
|
// handle ignored chars
|
|
|
if ( iCode & FLAG_CODEPOINT_IGNORE )
|
|
|
@@ -4882,7 +4918,7 @@ BYTE * CSphTokenizer_UTF8::GetToken ()
|
|
|
// tricky bit
|
|
|
// heading modifiers must not (!) affected blended status
|
|
|
// eg. we want stuff like '=-' (w/o apostrophes) thrown away when pure_blend is on
|
|
|
- if (!( m_bQueryMode && !m_iAccum && IsModifier ( iCode & MASK_CODEPOINT ) ) )
|
|
|
+ if (!( m_bQueryMode && !m_iAccum && sphIsModifier ( iCode & MASK_CODEPOINT ) ) )
|
|
|
m_bNonBlended = m_bNonBlended || !( iCode & FLAG_CODEPOINT_BLEND );
|
|
|
|
|
|
// just accumulate
|
|
|
@@ -5161,8 +5197,8 @@ void CSphMultiformTokenizer::SetBuffer ( BYTE * sBuffer, int iLength )
|
|
|
CSphFilterSettings::CSphFilterSettings ()
|
|
|
: m_sAttrName ( "" )
|
|
|
, m_bExclude ( false )
|
|
|
- , m_uMinValue ( 0 )
|
|
|
- , m_uMaxValue ( UINT_MAX )
|
|
|
+ , m_iMinValue ( LLONG_MIN )
|
|
|
+ , m_iMaxValue ( LLONG_MAX )
|
|
|
, m_pValues ( NULL )
|
|
|
, m_nValues ( 0 )
|
|
|
{}
|
|
|
@@ -5191,7 +5227,10 @@ bool CSphFilterSettings::operator == ( const CSphFilterSettings & rhs ) const
|
|
|
switch ( m_eType )
|
|
|
{
|
|
|
case SPH_FILTER_RANGE:
|
|
|
- return m_uMinValue==rhs.m_uMinValue && m_uMaxValue==rhs.m_uMaxValue;
|
|
|
+ return m_iMinValue==rhs.m_iMinValue && m_iMaxValue==rhs.m_iMaxValue;
|
|
|
+
|
|
|
+ case SPH_FILTER_FLOATRANGE:
|
|
|
+ return m_fMinValue==rhs.m_fMinValue && m_fMaxValue==rhs.m_fMaxValue;
|
|
|
|
|
|
case SPH_FILTER_VALUES:
|
|
|
if ( m_dValues.GetLength()!=rhs.m_dValues.GetLength() )
|
|
|
@@ -7718,7 +7757,7 @@ int CSphIndex_VLN::UpdateAttributes ( const CSphAttrUpdate & tUpd, int iIndex, C
|
|
|
// forbid updates on non-int columns
|
|
|
const CSphColumnInfo & tCol = m_tSchema.GetAttr(iIndex);
|
|
|
if (!( tCol.m_eAttrType==SPH_ATTR_BOOL || tCol.m_eAttrType==SPH_ATTR_INTEGER || tCol.m_eAttrType==SPH_ATTR_TIMESTAMP
|
|
|
- || tCol.m_eAttrType==SPH_ATTR_UINT32SET || tCol.m_eAttrType==SPH_ATTR_UINT64SET
|
|
|
+ || tCol.m_eAttrType==SPH_ATTR_UINT32SET || tCol.m_eAttrType==SPH_ATTR_INT64SET
|
|
|
|| tCol.m_eAttrType==SPH_ATTR_BIGINT || tCol.m_eAttrType==SPH_ATTR_FLOAT ))
|
|
|
{
|
|
|
sError.SetSprintf ( "attribute '%s' can not be updated (must be boolean, integer, bigint, float, timestamp, or MVA)", tUpd.m_dAttrs[i].m_sName.cstr() );
|
|
|
@@ -7726,28 +7765,28 @@ int CSphIndex_VLN::UpdateAttributes ( const CSphAttrUpdate & tUpd, int iIndex, C
|
|
|
}
|
|
|
|
|
|
// forbid updates on MVA columns if there's no arena
|
|
|
- if ( ( tCol.m_eAttrType==SPH_ATTR_UINT32SET || tCol.m_eAttrType==SPH_ATTR_UINT64SET ) && !g_pMvaArena )
|
|
|
+ if ( ( tCol.m_eAttrType==SPH_ATTR_UINT32SET || tCol.m_eAttrType==SPH_ATTR_INT64SET ) && !g_pMvaArena )
|
|
|
{
|
|
|
sError.SetSprintf ( "MVA attribute '%s' can not be updated (MVA arena not initialized)", tCol.m_sName.cstr() );
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
- bool bSrcMva = ( tCol.m_eAttrType==SPH_ATTR_UINT32SET || tCol.m_eAttrType==SPH_ATTR_UINT64SET );
|
|
|
- bool bDstMva = ( tUpd.m_dAttrs[i].m_eAttrType==SPH_ATTR_UINT32SET || tUpd.m_dAttrs[i].m_eAttrType==SPH_ATTR_UINT64SET );
|
|
|
+ bool bSrcMva = ( tCol.m_eAttrType==SPH_ATTR_UINT32SET || tCol.m_eAttrType==SPH_ATTR_INT64SET );
|
|
|
+ bool bDstMva = ( tUpd.m_dAttrs[i].m_eAttrType==SPH_ATTR_UINT32SET || tUpd.m_dAttrs[i].m_eAttrType==SPH_ATTR_INT64SET );
|
|
|
if ( bSrcMva!=bDstMva )
|
|
|
{
|
|
|
sError.SetSprintf ( "attribute '%s' MVA flag mismatch", tUpd.m_dAttrs[i].m_sName.cstr() );
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
- if ( tCol.m_eAttrType==SPH_ATTR_UINT32SET && tUpd.m_dAttrs[i].m_eAttrType==SPH_ATTR_UINT64SET )
|
|
|
+ if ( tCol.m_eAttrType==SPH_ATTR_UINT32SET && tUpd.m_dAttrs[i].m_eAttrType==SPH_ATTR_INT64SET )
|
|
|
{
|
|
|
sError.SetSprintf ( "attribute '%s' MVA bits (dst=%d, src=%d) mismatch", tUpd.m_dAttrs[i].m_sName.cstr(),
|
|
|
tCol.m_eAttrType, tUpd.m_dAttrs[i].m_eAttrType );
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
- if ( tCol.m_eAttrType==SPH_ATTR_UINT64SET )
|
|
|
+ if ( tCol.m_eAttrType==SPH_ATTR_INT64SET )
|
|
|
uDst64 |= ( U64C(1)<<i );
|
|
|
|
|
|
dFloats.Add ( tCol.m_eAttrType==SPH_ATTR_FLOAT );
|
|
|
@@ -7775,7 +7814,7 @@ int CSphIndex_VLN::UpdateAttributes ( const CSphAttrUpdate & tUpd, int iIndex, C
|
|
|
// storage upfront to avoid suddenly having to rollback if allocation fails later
|
|
|
int iNumMVA = 0;
|
|
|
ARRAY_FOREACH ( i, tUpd.m_dAttrs )
|
|
|
- if ( dIndexes[i]>=0 && ( tUpd.m_dAttrs[i].m_eAttrType==SPH_ATTR_UINT32SET || tUpd.m_dAttrs[i].m_eAttrType==SPH_ATTR_UINT64SET ) )
|
|
|
+ if ( dIndexes[i]>=0 && ( tUpd.m_dAttrs[i].m_eAttrType==SPH_ATTR_UINT32SET || tUpd.m_dAttrs[i].m_eAttrType==SPH_ATTR_INT64SET ) )
|
|
|
iNumMVA++;
|
|
|
|
|
|
// OPTIMIZE! execute the code below conditionally
|
|
|
@@ -7799,7 +7838,7 @@ int CSphIndex_VLN::UpdateAttributes ( const CSphAttrUpdate & tUpd, int iIndex, C
|
|
|
ARRAY_FOREACH_COND ( iCol, tUpd.m_dAttrs, !bFailed )
|
|
|
{
|
|
|
bool bSrcMva32 = ( tUpd.m_dAttrs[iCol].m_eAttrType==SPH_ATTR_UINT32SET );
|
|
|
- bool bSrcMva64 = ( tUpd.m_dAttrs[iCol].m_eAttrType==SPH_ATTR_UINT64SET );
|
|
|
+ bool bSrcMva64 = ( tUpd.m_dAttrs[iCol].m_eAttrType==SPH_ATTR_INT64SET );
|
|
|
if (!( bSrcMva32 || bSrcMva64 )) // FIXME! optimize using a prebuilt dword mask?
|
|
|
{
|
|
|
iPoolPos++;
|
|
|
@@ -7867,7 +7906,7 @@ int CSphIndex_VLN::UpdateAttributes ( const CSphAttrUpdate & tUpd, int iIndex, C
|
|
|
ARRAY_FOREACH ( iCol, tUpd.m_dAttrs )
|
|
|
{
|
|
|
bool bSrcMva32 = ( tUpd.m_dAttrs[iCol].m_eAttrType==SPH_ATTR_UINT32SET );
|
|
|
- bool bSrcMva64 = ( tUpd.m_dAttrs[iCol].m_eAttrType==SPH_ATTR_UINT64SET );
|
|
|
+ bool bSrcMva64 = ( tUpd.m_dAttrs[iCol].m_eAttrType==SPH_ATTR_INT64SET );
|
|
|
if (!( bSrcMva32 || bSrcMva64 )) // FIXME! optimize using a prebuilt dword mask?
|
|
|
{
|
|
|
// plain update
|
|
|
@@ -7914,7 +7953,7 @@ int CSphIndex_VLN::UpdateAttributes ( const CSphAttrUpdate & tUpd, int iIndex, C
|
|
|
iPos += uNew;
|
|
|
if ( dIndexes[iCol]>=0 )
|
|
|
{
|
|
|
- uint64_t uNewMin = LLONG_MAX, uNewMax = 0;
|
|
|
+ int64_t iNewMin = LLONG_MAX, iNewMax = LLONG_MIN;
|
|
|
int iNewIndex = dMvaPtrs[iMvaPtr++];
|
|
|
|
|
|
SphDocID_t* pDocid = (SphDocID_t*)(g_pMvaArena + iNewIndex);
|
|
|
@@ -7937,9 +7976,9 @@ int CSphIndex_VLN::UpdateAttributes ( const CSphAttrUpdate & tUpd, int iIndex, C
|
|
|
{
|
|
|
while ( iLen )
|
|
|
{
|
|
|
- uint64_t uValue = MVA_UPSIZE ( pSrc );
|
|
|
- uNewMin = Min ( uNewMin, uValue );
|
|
|
- uNewMax = Max ( uNewMax, uValue );
|
|
|
+ int64_t uValue = MVA_UPSIZE ( pSrc );
|
|
|
+ iNewMin = Min ( iNewMin, uValue );
|
|
|
+ iNewMax = Max ( iNewMax, uValue );
|
|
|
*pDst++ = *pSrc++;
|
|
|
*pDst++ = *pSrc++;
|
|
|
iLen -= 2;
|
|
|
@@ -7951,8 +7990,8 @@ int CSphIndex_VLN::UpdateAttributes ( const CSphAttrUpdate & tUpd, int iIndex, C
|
|
|
DWORD uValue = *pSrc;
|
|
|
pSrc += 2;
|
|
|
*pDst++ = uValue;
|
|
|
- uNewMin = Min ( uNewMin, uValue );
|
|
|
- uNewMax = Max ( uNewMax, uValue );
|
|
|
+ iNewMin = Min ( iNewMin, uValue );
|
|
|
+ iNewMax = Max ( iNewMax, uValue );
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -7965,12 +8004,12 @@ int CSphIndex_VLN::UpdateAttributes ( const CSphAttrUpdate & tUpd, int iIndex, C
|
|
|
for ( int i=0; i<2; i++ )
|
|
|
{
|
|
|
DWORD * pBlock = i ? pBlockRanges : pIndexRanges;
|
|
|
- uint64_t uMin = sphGetRowAttr ( DOCINFO2ATTRS ( pBlock ), dLocators[iCol] );
|
|
|
- uint64_t uMax = sphGetRowAttr ( DOCINFO2ATTRS ( pBlock+iRowStride ), dLocators[iCol] );
|
|
|
- if ( uNewMin<uMin || uNewMax>uMax )
|
|
|
+ int64_t iMin = sphGetRowAttr ( DOCINFO2ATTRS ( pBlock ), dLocators[iCol] );
|
|
|
+ int64_t iMax = sphGetRowAttr ( DOCINFO2ATTRS ( pBlock+iRowStride ), dLocators[iCol] );
|
|
|
+ if ( iNewMin<iMin || iNewMax>iMax )
|
|
|
{
|
|
|
- sphSetRowAttr ( DOCINFO2ATTRS ( pBlock ), dLocators[iCol], Min ( uMin, uNewMin ) );
|
|
|
- sphSetRowAttr ( DOCINFO2ATTRS ( pBlock+iRowStride ), dLocators[iCol], Max ( uMax, uNewMax ) );
|
|
|
+ sphSetRowAttr ( DOCINFO2ATTRS ( pBlock ), dLocators[iCol], Min ( iMin, iNewMin ) );
|
|
|
+ sphSetRowAttr ( DOCINFO2ATTRS ( pBlock+iRowStride ), dLocators[iCol], Max ( iMax, iNewMax ) );
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -8033,7 +8072,7 @@ bool CSphIndex_VLN::LoadPersistentMVA ( CSphString & sError )
|
|
|
for ( int i=0; i<m_tSchema.GetAttrsCount(); i++ )
|
|
|
{
|
|
|
const CSphColumnInfo & tAttr = m_tSchema.GetAttr(i);
|
|
|
- if ( tAttr.m_eAttrType==SPH_ATTR_UINT64SET )
|
|
|
+ if ( tAttr.m_eAttrType==SPH_ATTR_INT64SET )
|
|
|
dMvaLocators.Add ( tAttr.m_tLocator );
|
|
|
}
|
|
|
assert ( dMvaLocators.GetLength()!=0 );
|
|
|
@@ -8221,7 +8260,7 @@ bool CSphIndex_VLN::SaveAttributes ( CSphString & sError ) const
|
|
|
for ( int i=0; i<m_tSchema.GetAttrsCount(); i++ )
|
|
|
{
|
|
|
const CSphColumnInfo & tAttr = m_tSchema.GetAttr(i);
|
|
|
- if ( tAttr.m_eAttrType==SPH_ATTR_UINT64SET )
|
|
|
+ if ( tAttr.m_eAttrType==SPH_ATTR_INT64SET )
|
|
|
dMvaLocators.Add ( tAttr.m_tLocator );
|
|
|
}
|
|
|
assert ( dMvaLocators.GetLength()!=0 );
|
|
|
@@ -9345,13 +9384,13 @@ struct MvaEntry_t
|
|
|
{
|
|
|
SphDocID_t m_uDocID;
|
|
|
int m_iAttr;
|
|
|
- uint64_t m_uValue;
|
|
|
+ int64_t m_iValue;
|
|
|
|
|
|
inline bool operator < ( const MvaEntry_t & rhs ) const
|
|
|
{
|
|
|
if ( m_uDocID!=rhs.m_uDocID ) return m_uDocID<rhs.m_uDocID;
|
|
|
if ( m_iAttr!=rhs.m_iAttr ) return m_iAttr<rhs.m_iAttr;
|
|
|
- return m_uValue<rhs.m_uValue;
|
|
|
+ return m_iValue<rhs.m_iValue;
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -9398,7 +9437,7 @@ bool CSphIndex_VLN::BuildMVA ( const CSphVector<CSphSource*> & dSources,
|
|
|
for ( int i=0; i<m_tSchema.GetAttrsCount(); i++ )
|
|
|
{
|
|
|
const CSphColumnInfo & tAttr = m_tSchema.GetAttr(i);
|
|
|
- if ( tAttr.m_eAttrType==SPH_ATTR_UINT64SET )
|
|
|
+ if ( tAttr.m_eAttrType==SPH_ATTR_INT64SET )
|
|
|
{
|
|
|
dMvaIndexes.Add ( i );
|
|
|
if ( tAttr.m_eSrc!=SPH_ATTRSRC_FIELD )
|
|
|
@@ -9453,10 +9492,10 @@ bool CSphIndex_VLN::BuildMVA ( const CSphVector<CSphSource*> & dSources,
|
|
|
pMva->m_iAttr = i;
|
|
|
if ( tAttr.m_eAttrType==SPH_ATTR_UINT32SET )
|
|
|
{
|
|
|
- pMva->m_uValue = pSource->m_dMva[0];
|
|
|
+ pMva->m_iValue = pSource->m_dMva[0];
|
|
|
} else
|
|
|
{
|
|
|
- pMva->m_uValue = MVA_UPSIZE ( pSource->m_dMva.Begin() );
|
|
|
+ pMva->m_iValue = MVA_UPSIZE ( pSource->m_dMva.Begin() );
|
|
|
}
|
|
|
|
|
|
if ( ++pMva>=pMvaMax )
|
|
|
@@ -9558,7 +9597,7 @@ bool CSphIndex_VLN::BuildMVA ( const CSphVector<CSphSource*> & dSources,
|
|
|
// values-list := values-count, value [ values-count ]
|
|
|
// note that mva32 come first then mva64
|
|
|
SphDocID_t uCurID = 0;
|
|
|
- CSphVector < CSphVector<uint64_t> > dCurInfo;
|
|
|
+ CSphVector < CSphVector<int64_t> > dCurInfo;
|
|
|
dCurInfo.Resize ( dMvaIndexes.GetLength() );
|
|
|
|
|
|
for ( ;; )
|
|
|
@@ -9575,7 +9614,7 @@ bool CSphIndex_VLN::BuildMVA ( const CSphVector<CSphSource*> & dSources,
|
|
|
if ( i>=iMva64 )
|
|
|
{
|
|
|
wrMva.PutDword ( iLen*2 );
|
|
|
- wrMva.PutBytes ( dCurInfo[i].Begin(), sizeof(uint64_t)*iLen );
|
|
|
+ wrMva.PutBytes ( dCurInfo[i].Begin(), sizeof(int64_t)*iLen );
|
|
|
} else
|
|
|
{
|
|
|
wrMva.PutDword ( iLen );
|
|
|
@@ -9598,9 +9637,9 @@ bool CSphIndex_VLN::BuildMVA ( const CSphVector<CSphSource*> & dSources,
|
|
|
// accumulate this entry
|
|
|
#if PARANOID
|
|
|
assert ( dCurInfo [ qMva.Root().m_iAttr ].GetLength()==0
|
|
|
- || dCurInfo [ qMva.Root().m_iAttr ].Last()<=qMva.Root().m_uValue );
|
|
|
+ || dCurInfo [ qMva.Root().m_iAttr ].Last()<=qMva.Root().m_iValue );
|
|
|
#endif
|
|
|
- dCurInfo [ qMva.Root().m_iAttr ].AddUnique ( qMva.Root().m_uValue );
|
|
|
+ dCurInfo [ qMva.Root().m_iAttr ].AddUnique ( qMva.Root().m_iValue );
|
|
|
|
|
|
// get next entry
|
|
|
int iBin = qMva.Root().m_iTag;
|
|
|
@@ -10216,7 +10255,7 @@ int CSphIndex_VLN::Build ( const CSphVector<CSphSource*> & dSources, int iMemory
|
|
|
{
|
|
|
const CSphColumnInfo & tCol = m_tSchema.GetAttr(i);
|
|
|
ESphAttr eAttrType = tCol.m_eAttrType;
|
|
|
- if ( eAttrType==SPH_ATTR_UINT64SET )
|
|
|
+ if ( eAttrType==SPH_ATTR_INT64SET )
|
|
|
{
|
|
|
if ( tCol.m_eSrc==SPH_ATTRSRC_FIELD )
|
|
|
bHaveFieldMVAs = true;
|
|
|
@@ -10442,7 +10481,7 @@ int CSphIndex_VLN::Build ( const CSphVector<CSphSource*> & dSources, int iMemory
|
|
|
tRedirect.m_tLocator = tCol.m_tLocator;
|
|
|
tRedirect.m_iAttr = iAttr;
|
|
|
tRedirect.m_iMVAAttr = i;
|
|
|
- tRedirect.m_bMva64 = ( tCol.m_eAttrType==SPH_ATTR_UINT64SET );
|
|
|
+ tRedirect.m_bMva64 = ( tCol.m_eAttrType==SPH_ATTR_INT64SET );
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -10507,10 +10546,10 @@ int CSphIndex_VLN::Build ( const CSphVector<CSphSource*> & dSources, int iMemory
|
|
|
tMva.m_iAttr = iMVA;
|
|
|
if ( bMva64 )
|
|
|
{
|
|
|
- tMva.m_uValue = MVA_UPSIZE ( pSource->m_dMva.Begin() + i );
|
|
|
+ tMva.m_iValue = MVA_UPSIZE ( pSource->m_dMva.Begin() + i );
|
|
|
} else
|
|
|
{
|
|
|
- tMva.m_uValue = pSource->m_dMva[i];
|
|
|
+ tMva.m_iValue = pSource->m_dMva[i];
|
|
|
}
|
|
|
|
|
|
int iLength = dFieldMVAs.GetLength ();
|
|
|
@@ -12153,8 +12192,8 @@ bool CSphIndex_VLN::Merge ( CSphIndex * pSource, const CSphVector<CSphFilterSett
|
|
|
|
|
|
tKillListFilter.m_bExclude = true;
|
|
|
tKillListFilter.m_eType = SPH_FILTER_VALUES;
|
|
|
- tKillListFilter.m_uMinValue = pKillList[0];
|
|
|
- tKillListFilter.m_uMaxValue = pKillList[nKillListSize -1];
|
|
|
+ tKillListFilter.m_iMinValue = pKillList[0];
|
|
|
+ tKillListFilter.m_iMaxValue = pKillList[nKillListSize -1];
|
|
|
tKillListFilter.m_sAttrName = "@id";
|
|
|
tKillListFilter.SetExternalValues ( pKillList, nKillListSize );
|
|
|
|
|
|
@@ -12226,7 +12265,7 @@ bool CSphIndex_VLN::DoMerge ( const CSphIndex_VLN * pDstIndex, const CSphIndex_V
|
|
|
for ( int i=0; i<tDstSchema.GetAttrsCount(); i++ )
|
|
|
{
|
|
|
const CSphColumnInfo & tInfo = tDstSchema.GetAttr(i);
|
|
|
- if ( tInfo.m_eAttrType==SPH_ATTR_UINT64SET )
|
|
|
+ if ( tInfo.m_eAttrType==SPH_ATTR_INT64SET )
|
|
|
dMvaLocators.Add ( tInfo.m_tLocator );
|
|
|
}
|
|
|
|
|
|
@@ -12373,8 +12412,8 @@ bool CSphIndex_VLN::DoMerge ( const CSphIndex_VLN * pDstIndex, const CSphIndex_V
|
|
|
CSphFilterSettings tKLF;
|
|
|
tKLF.m_bExclude = true;
|
|
|
tKLF.m_eType = SPH_FILTER_VALUES;
|
|
|
- tKLF.m_uMinValue = dPhantomKiller[0];
|
|
|
- tKLF.m_uMaxValue = dPhantomKiller.Last();
|
|
|
+ tKLF.m_iMinValue = dPhantomKiller[0];
|
|
|
+ tKLF.m_iMaxValue = dPhantomKiller.Last();
|
|
|
tKLF.m_sAttrName = "@id";
|
|
|
tKLF.SetExternalValues ( &dPhantomKiller[0], dPhantomKiller.GetLength() );
|
|
|
ISphFilter * pSpaFilter = sphCreateFilter ( tKLF, pDstIndex->m_tSchema, pDstIndex->GetMVAPool(), sError );
|
|
|
@@ -13621,7 +13660,7 @@ void CSphIndex_VLN::DebugDumpHeader ( FILE * fp, const char * sHeaderName, bool
|
|
|
const CSphColumnInfo & tAttr = m_tSchema.GetAttr(i);
|
|
|
if ( tAttr.m_eAttrType==SPH_ATTR_UINT32SET )
|
|
|
fprintf ( fp, "\tsql_attr_multi = uint %s from field\n", tAttr.m_sName.cstr() );
|
|
|
- else if ( tAttr.m_eAttrType==SPH_ATTR_UINT64SET )
|
|
|
+ else if ( tAttr.m_eAttrType==SPH_ATTR_INT64SET )
|
|
|
fprintf ( fp, "\tsql_attr_multi = bigint %s from field\n", tAttr.m_sName.cstr() );
|
|
|
else if ( tAttr.m_eAttrType==SPH_ATTR_INTEGER && tAttr.m_tLocator.IsBitfield() )
|
|
|
fprintf ( fp, "\tsql_attr_uint = %s:%d\n", tAttr.m_sName.cstr(), tAttr.m_tLocator.m_iBitCount );
|
|
|
@@ -14346,7 +14385,7 @@ bool CSphIndex_VLN::Preread ()
|
|
|
for ( int i=0; i<m_tSchema.GetAttrsCount(); i++ )
|
|
|
{
|
|
|
const CSphColumnInfo & tCol = m_tSchema.GetAttr(i);
|
|
|
- if ( tCol.m_eAttrType==SPH_ATTR_UINT64SET )
|
|
|
+ if ( tCol.m_eAttrType==SPH_ATTR_INT64SET )
|
|
|
dMvaRowitem.Add ( tCol.m_tLocator.m_iBitOffset/ROWITEM_BITS );
|
|
|
}
|
|
|
|
|
|
@@ -14774,6 +14813,16 @@ bool CSphIndex_VLN::DoGetKeywords ( CSphVector <CSphKeywordInfo> & dKeywords, co
|
|
|
#endif
|
|
|
|
|
|
|
|
|
+static bool IsWeightColumn ( const CSphString & sAttr, const CSphSchema & tSchema )
|
|
|
+{
|
|
|
+ if ( sAttr=="@weight" )
|
|
|
+ return true;
|
|
|
+
|
|
|
+ const CSphColumnInfo * pCol = tSchema.GetAttr ( sAttr.cstr() );
|
|
|
+ return ( pCol && pCol->m_bWeight );
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
bool CSphQueryContext::CreateFilters ( bool bFullscan, const CSphVector<CSphFilterSettings> * pdFilters, const CSphSchema & tSchema, const DWORD * pMvaPool, CSphString & sError )
|
|
|
{
|
|
|
if ( !pdFilters )
|
|
|
@@ -14784,14 +14833,16 @@ bool CSphQueryContext::CreateFilters ( bool bFullscan, const CSphVector<CSphFilt
|
|
|
if ( tFilter.m_sAttrName.IsEmpty() )
|
|
|
continue;
|
|
|
|
|
|
- if ( bFullscan && tFilter.m_sAttrName=="@weight" )
|
|
|
+ bool bWeight = IsWeightColumn ( tFilter.m_sAttrName, tSchema );
|
|
|
+
|
|
|
+ if ( bFullscan && bWeight )
|
|
|
continue; // @weight is not avaiable in fullscan mode
|
|
|
|
|
|
ISphFilter * pFilter = sphCreateFilter ( tFilter, tSchema, pMvaPool, sError );
|
|
|
if ( !pFilter )
|
|
|
return false;
|
|
|
|
|
|
- ISphFilter ** pGroup = tFilter.m_sAttrName=="@weight" ? &m_pWeightFilter : &m_pFilter;
|
|
|
+ ISphFilter ** pGroup = bWeight ? &m_pWeightFilter : &m_pFilter;
|
|
|
*pGroup = sphJoinFilters ( *pGroup, pFilter );
|
|
|
}
|
|
|
if ( m_pFilter )
|
|
|
@@ -16381,7 +16432,7 @@ int CSphIndex_VLN::DebugCheck ( FILE * fp )
|
|
|
for ( int i=0; i<m_tSchema.GetAttrsCount(); i++ )
|
|
|
{
|
|
|
const CSphColumnInfo & tAttr = m_tSchema.GetAttr(i);
|
|
|
- if ( tAttr.m_eAttrType==SPH_ATTR_UINT32SET || tAttr.m_eAttrType==SPH_ATTR_UINT64SET )
|
|
|
+ if ( tAttr.m_eAttrType==SPH_ATTR_UINT32SET || tAttr.m_eAttrType==SPH_ATTR_INT64SET )
|
|
|
{
|
|
|
if ( tAttr.m_tLocator.m_iBitCount!=ROWITEM_BITS )
|
|
|
{
|
|
|
@@ -16406,7 +16457,7 @@ int CSphIndex_VLN::DebugCheck ( FILE * fp )
|
|
|
for ( int i=0; i<m_tSchema.GetAttrsCount(); i++ )
|
|
|
{
|
|
|
const CSphColumnInfo & tAttr = m_tSchema.GetAttr(i);
|
|
|
- if ( tAttr.m_eAttrType==SPH_ATTR_UINT64SET )
|
|
|
+ if ( tAttr.m_eAttrType==SPH_ATTR_INT64SET )
|
|
|
dMvaItems.Add ( tAttr.m_tLocator.m_iBitOffset/ROWITEM_BITS );
|
|
|
}
|
|
|
|
|
|
@@ -16540,23 +16591,23 @@ int CSphIndex_VLN::DebugCheck ( FILE * fp )
|
|
|
// check that values are ascending
|
|
|
for ( DWORD uVal=(iItem>=iMva64 ? 2 : 1); uVal<uValues && bIsMvaCorrect; )
|
|
|
{
|
|
|
- uint64_t uPrev, uCur;
|
|
|
+ int64_t iPrev, iCur;
|
|
|
if ( iItem>=iMva64 )
|
|
|
{
|
|
|
- uPrev = MVA_UPSIZE ( pMva+uVal-2 );
|
|
|
- uCur = MVA_UPSIZE ( pMva+uVal );
|
|
|
+ iPrev = MVA_UPSIZE ( pMva+uVal-2 );
|
|
|
+ iCur = MVA_UPSIZE ( pMva+uVal );
|
|
|
uVal += 2;
|
|
|
} else
|
|
|
{
|
|
|
- uPrev = pMva[uVal-1];
|
|
|
- uCur = pMva[uVal];
|
|
|
+ iPrev = pMva[uVal-1];
|
|
|
+ iCur = pMva[uVal];
|
|
|
uVal++;
|
|
|
}
|
|
|
|
|
|
- if ( uCur<=uPrev )
|
|
|
+ if ( iCur<=iPrev )
|
|
|
{
|
|
|
LOC_FAIL(( fp, "unsorted MVA values (row=%u, mvaattr=%d, docid expected="DOCID_FMT", got="DOCID_FMT", val[%u]=%u, val[%u]=%u)",
|
|
|
- uRow, iItem, uLastID, uMvaID, ( iItem>=iMva64 ? uVal-2 : uVal-1 ), (unsigned int)uPrev, uVal, (unsigned int)uCur ));
|
|
|
+ uRow, iItem, uLastID, uMvaID, ( iItem>=iMva64 ? uVal-2 : uVal-1 ), (unsigned int)iPrev, uVal, (unsigned int)iCur ));
|
|
|
bIsMvaCorrect = false;
|
|
|
}
|
|
|
|
|
|
@@ -22194,12 +22245,12 @@ SphRange_t CSphSource_Document::IterateFieldMVAStart ( int iAttr )
|
|
|
}
|
|
|
|
|
|
|
|
|
-static int sphAddMva64 ( CSphVector<DWORD> & dStorage, uint64_t uVal )
|
|
|
+static int sphAddMva64 ( CSphVector<DWORD> & dStorage, int64_t iVal )
|
|
|
{
|
|
|
int uOff = dStorage.GetLength();
|
|
|
dStorage.Resize ( uOff+2 );
|
|
|
- dStorage[uOff] = MVA_DOWNSIZE ( uVal );
|
|
|
- dStorage[uOff+1] = MVA_DOWNSIZE ( ( uVal>>32 ) & 0xffffffff );
|
|
|
+ dStorage[uOff] = MVA_DOWNSIZE ( iVal );
|
|
|
+ dStorage[uOff+1] = MVA_DOWNSIZE ( ( iVal>>32 ) & 0xffffffff );
|
|
|
return uOff;
|
|
|
}
|
|
|
|
|
|
@@ -22220,7 +22271,7 @@ int CSphSource_Document::ParseFieldMVA ( CSphVector < DWORD > & dMva, const char
|
|
|
|
|
|
while ( *pPtr )
|
|
|
{
|
|
|
- if ( *pPtr>='0' && *pPtr<='9' )
|
|
|
+ if ( ( *pPtr>='0' && *pPtr<='9' ) || ( bMva64 && *pPtr=='-' ) )
|
|
|
{
|
|
|
if ( !pDigit )
|
|
|
pDigit = pPtr;
|
|
|
@@ -22235,7 +22286,7 @@ int CSphSource_Document::ParseFieldMVA ( CSphVector < DWORD > & dMva, const char
|
|
|
if ( !bMva64 )
|
|
|
dMva.Add ( sphToDword ( szBuf ) );
|
|
|
else
|
|
|
- sphAddMva64 ( dMva, sphToUint64 ( szBuf ) );
|
|
|
+ sphAddMva64 ( dMva, sphToInt64 ( szBuf ) );
|
|
|
}
|
|
|
|
|
|
pDigit = NULL;
|
|
|
@@ -22250,7 +22301,7 @@ int CSphSource_Document::ParseFieldMVA ( CSphVector < DWORD > & dMva, const char
|
|
|
if ( !bMva64 )
|
|
|
dMva.Add ( sphToDword ( pDigit ) );
|
|
|
else
|
|
|
- sphAddMva64 ( dMva, sphToUint64 ( pDigit ) );
|
|
|
+ sphAddMva64 ( dMva, sphToInt64 ( pDigit ) );
|
|
|
}
|
|
|
|
|
|
int iCount = dMva.GetLength()-uOff-1;
|
|
|
@@ -22606,7 +22657,7 @@ bool CSphSource_SQL::IterateStart ( CSphString & sError )
|
|
|
tCol.m_eAttrType = tAttr.m_eAttrType;
|
|
|
assert ( tCol.m_eAttrType!=SPH_ATTR_NONE );
|
|
|
|
|
|
- if ( ( tAttr.m_eAttrType==SPH_ATTR_UINT32SET || tAttr.m_eAttrType==SPH_ATTR_UINT64SET ) && tAttr.m_eSrc!=SPH_ATTRSRC_FIELD )
|
|
|
+ if ( ( tAttr.m_eAttrType==SPH_ATTR_UINT32SET || tAttr.m_eAttrType==SPH_ATTR_INT64SET ) && tAttr.m_eSrc!=SPH_ATTRSRC_FIELD )
|
|
|
LOC_ERROR ( "multi-valued attribute '%s' of wrong source-type found in query; must be 'field'", tAttr.m_sName.cstr() );
|
|
|
|
|
|
tCol = tAttr;
|
|
|
@@ -22655,7 +22706,7 @@ bool CSphSource_SQL::IterateStart ( CSphString & sError )
|
|
|
ARRAY_FOREACH ( i, m_tParams.m_dAttrs )
|
|
|
{
|
|
|
const CSphColumnInfo & tAttr = m_tParams.m_dAttrs[i];
|
|
|
- if ( ( tAttr.m_eAttrType==SPH_ATTR_UINT32SET || tAttr.m_eAttrType==SPH_ATTR_UINT64SET ) && tAttr.m_eSrc!=SPH_ATTRSRC_FIELD )
|
|
|
+ if ( ( tAttr.m_eAttrType==SPH_ATTR_UINT32SET || tAttr.m_eAttrType==SPH_ATTR_INT64SET ) && tAttr.m_eSrc!=SPH_ATTRSRC_FIELD )
|
|
|
{
|
|
|
m_tSchema.AddAttr ( tAttr, true ); // all attributes are dynamic at indexing time
|
|
|
dFound[i] = true;
|
|
|
@@ -22828,12 +22879,12 @@ BYTE ** CSphSource_SQL::NextDocument ( CSphString & sError )
|
|
|
{
|
|
|
const CSphColumnInfo & tAttr = m_tSchema.GetAttr(i); // shortcut
|
|
|
|
|
|
- if ( tAttr.m_eAttrType==SPH_ATTR_UINT32SET || tAttr.m_eAttrType==SPH_ATTR_UINT64SET )
|
|
|
+ if ( tAttr.m_eAttrType==SPH_ATTR_UINT32SET || tAttr.m_eAttrType==SPH_ATTR_INT64SET )
|
|
|
{
|
|
|
int uOff = 0;
|
|
|
if ( tAttr.m_eSrc==SPH_ATTRSRC_FIELD )
|
|
|
{
|
|
|
- uOff = ParseFieldMVA ( m_dMva, SqlColumn ( tAttr.m_iIndex ), tAttr.m_eAttrType==SPH_ATTR_UINT64SET );
|
|
|
+ uOff = ParseFieldMVA ( m_dMva, SqlColumn ( tAttr.m_iIndex ), tAttr.m_eAttrType==SPH_ATTR_INT64SET );
|
|
|
}
|
|
|
m_tDocInfo.SetAttr ( tAttr.m_tLocator, uOff );
|
|
|
continue;
|
|
|
@@ -22931,7 +22982,7 @@ bool CSphSource_SQL::IterateMultivaluedStart ( int iAttr, CSphString & sError )
|
|
|
m_iMultiAttr = iAttr;
|
|
|
const CSphColumnInfo & tAttr = m_tSchema.GetAttr(iAttr);
|
|
|
|
|
|
- if ( !(tAttr.m_eAttrType==SPH_ATTR_UINT32SET || tAttr.m_eAttrType==SPH_ATTR_UINT64SET ) )
|
|
|
+ if ( !(tAttr.m_eAttrType==SPH_ATTR_UINT32SET || tAttr.m_eAttrType==SPH_ATTR_INT64SET ) )
|
|
|
return false;
|
|
|
|
|
|
CSphString sPrefix;
|
|
|
@@ -22985,7 +23036,7 @@ bool CSphSource_SQL::IterateMultivaluedNext ()
|
|
|
const CSphColumnInfo & tAttr = m_tSchema.GetAttr ( m_iMultiAttr );
|
|
|
|
|
|
assert ( m_bSqlConnected );
|
|
|
- assert ( tAttr.m_eAttrType==SPH_ATTR_UINT32SET || tAttr.m_eAttrType==SPH_ATTR_UINT64SET );
|
|
|
+ assert ( tAttr.m_eAttrType==SPH_ATTR_UINT32SET || tAttr.m_eAttrType==SPH_ATTR_INT64SET );
|
|
|
|
|
|
// fetch next row
|
|
|
bool bGotRow = SqlFetchRow ();
|
|
|
@@ -23011,7 +23062,7 @@ bool CSphSource_SQL::IterateMultivaluedNext ()
|
|
|
if ( tAttr.m_eAttrType==SPH_ATTR_UINT32SET )
|
|
|
m_dMva.Add ( sphToDword ( SqlColumn(1) ) );
|
|
|
else
|
|
|
- sphAddMva64 ( m_dMva, sphToUint64 ( SqlColumn(1) ) );
|
|
|
+ sphAddMva64 ( m_dMva, sphToInt64 ( SqlColumn(1) ) );
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
@@ -24579,7 +24630,7 @@ void CSphSource_XMLPipe2::ConfigureAttrs ( const CSphVariant * pHead, ESphAttr e
|
|
|
|
|
|
tCol.m_iIndex = m_tSchema.GetAttrsCount ();
|
|
|
|
|
|
- if ( eAttrType==SPH_ATTR_UINT32SET || eAttrType==SPH_ATTR_UINT64SET )
|
|
|
+ if ( eAttrType==SPH_ATTR_UINT32SET || eAttrType==SPH_ATTR_INT64SET )
|
|
|
{
|
|
|
tCol.m_eAttrType = eAttrType;
|
|
|
tCol.m_eSrc = SPH_ATTRSRC_FIELD;
|
|
|
@@ -24623,7 +24674,7 @@ bool CSphSource_XMLPipe2::Setup ( FILE * pPipe, const CSphConfigSection & hSourc
|
|
|
ConfigureAttrs ( hSource("xmlpipe_attr_float"), SPH_ATTR_FLOAT );
|
|
|
ConfigureAttrs ( hSource("xmlpipe_attr_bigint"), SPH_ATTR_BIGINT );
|
|
|
ConfigureAttrs ( hSource("xmlpipe_attr_multi"), SPH_ATTR_UINT32SET );
|
|
|
- ConfigureAttrs ( hSource("xmlpipe_attr_multi_64"), SPH_ATTR_UINT64SET );
|
|
|
+ ConfigureAttrs ( hSource("xmlpipe_attr_multi_64"), SPH_ATTR_INT64SET );
|
|
|
ConfigureAttrs ( hSource("xmlpipe_attr_string"), SPH_ATTR_STRING );
|
|
|
ConfigureAttrs ( hSource("xmlpipe_attr_wordcount"), SPH_ATTR_WORDCOUNT );
|
|
|
ConfigureAttrs ( hSource("xmlpipe_field_string"), SPH_ATTR_STRING );
|
|
|
@@ -24733,7 +24784,7 @@ bool CSphSource_XMLPipe2::Connect ( CSphString & sError )
|
|
|
for ( int i = 0; i < m_tSchema.GetAttrsCount (); i++ )
|
|
|
{
|
|
|
const CSphColumnInfo & tCol = m_tSchema.GetAttr ( i );
|
|
|
- if ( ( tCol.m_eAttrType==SPH_ATTR_UINT32SET || tCol.m_eAttrType==SPH_ATTR_UINT64SET ) && tCol.m_eSrc==SPH_ATTRSRC_FIELD )
|
|
|
+ if ( ( tCol.m_eAttrType==SPH_ATTR_UINT32SET || tCol.m_eAttrType==SPH_ATTR_INT64SET ) && tCol.m_eSrc==SPH_ATTRSRC_FIELD )
|
|
|
m_dAttrToMVA.Add ( iFieldMVA++ );
|
|
|
else
|
|
|
m_dAttrToMVA.Add ( -1 );
|
|
|
@@ -24947,9 +24998,9 @@ BYTE ** CSphSource_XMLPipe2::NextDocument ( CSphString & sError )
|
|
|
const CSphString & sAttrValue = pDocument->m_dAttrs[i].IsEmpty () && m_dDefaultAttrs.GetLength () ? m_dDefaultAttrs[i] : pDocument->m_dAttrs[i];
|
|
|
const CSphColumnInfo & tAttr = m_tSchema.GetAttr ( i );
|
|
|
|
|
|
- if ( tAttr.m_eAttrType==SPH_ATTR_UINT32SET || tAttr.m_eAttrType==SPH_ATTR_UINT64SET )
|
|
|
+ if ( tAttr.m_eAttrType==SPH_ATTR_UINT32SET || tAttr.m_eAttrType==SPH_ATTR_INT64SET )
|
|
|
{
|
|
|
- m_tDocInfo.SetAttr ( tAttr.m_tLocator, ParseFieldMVA ( m_dMva, sAttrValue.cstr (), tAttr.m_eAttrType==SPH_ATTR_UINT64SET ) );
|
|
|
+ m_tDocInfo.SetAttr ( tAttr.m_tLocator, ParseFieldMVA ( m_dMva, sAttrValue.cstr (), tAttr.m_eAttrType==SPH_ATTR_INT64SET ) );
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
@@ -25130,7 +25181,7 @@ void CSphSource_XMLPipe2::StartElement ( const char * szName, const char ** pAtt
|
|
|
Info.m_eSrc = SPH_ATTRSRC_FIELD;
|
|
|
} else if ( !strcmp ( szType, "multi_64" ) )
|
|
|
{
|
|
|
- Info.m_eAttrType = SPH_ATTR_UINT64SET;
|
|
|
+ Info.m_eAttrType = SPH_ATTR_INT64SET;
|
|
|
Info.m_eSrc = SPH_ATTRSRC_FIELD;
|
|
|
} else
|
|
|
{
|