Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch MVAs in the same connection as the main query to respect sql_query_pre #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/sphinx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11338,6 +11338,7 @@ int CSphIndex_VLN::Build ( const CSphVector<CSphSource*> & dSources, int iMemory
}

bool bHaveFieldMVAs = false;
bool bOnlyFieldMVAs = true;
int iFieldLens = m_tSchema.GetAttrId_FirstFieldLen();
CSphVector<int> dMvaIndexes;
CSphVector<CSphAttrLocator> dMvaLocators;
Expand All @@ -11361,6 +11362,8 @@ int CSphIndex_VLN::Build ( const CSphVector<CSphSource*> & dSources, int iMemory
case SPH_ATTR_UINT32SET:
if ( tCol.m_eSrc==SPH_ATTRSRC_FIELD )
bHaveFieldMVAs = true;
else
bOnlyFieldMVAs = false;
dMvaIndexes.Add ( i );
dMvaLocators.Add ( tCol.m_tLocator );
break;
Expand All @@ -11385,6 +11388,8 @@ int CSphIndex_VLN::Build ( const CSphVector<CSphSource*> & dSources, int iMemory
continue;
if ( tCol.m_eSrc==SPH_ATTRSRC_FIELD )
bHaveFieldMVAs = true;
else
bOnlyFieldMVAs = false;
dMvaIndexes.Add ( i );
dMvaLocators.Add ( tCol.m_tLocator );
}
Expand Down Expand Up @@ -12120,7 +12125,8 @@ int CSphIndex_VLN::Build ( const CSphVector<CSphSource*> & dSources, int iMemory
}

// this source is over, disconnect and update stats
pSource->Disconnect ();
if ( bOnlyFieldMVAs )
pSource->Disconnect ();

m_tStats.m_iTotalDocuments += pSource->GetStats().m_iTotalDocuments;
m_tStats.m_iTotalBytes += pSource->GetStats().m_iTotalBytes;
Expand Down