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

enable boolean_simplify by default #3058

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion api/sphinxapi.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ function __construct ()
$this->_fieldweights= array();
$this->_overrides = array();
$this->_select = "*";
$this->_query_flags = sphSetBit ( 0, 6, true ); // default idf=tfidf_normalized
$this->_query_flags = sphSetBit ( 0, 6, true ) | sphSetBit ( 0, 3, true ); // default idf=tfidf_normalized, boolean_simplify=true
$this->_predictedtime = 0;
$this->_outerorderby = "";
$this->_outeroffset = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/sphinx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11626,7 +11626,7 @@ Bson_t Explain ( ExplainQueryArgs_t & tArgs )
return EmptyBson ();
}

sphTransformExtendedQuery ( &tParsed.m_pRoot, *tArgs.m_pSettings, false, nullptr );
sphTransformExtendedQuery ( &tParsed.m_pRoot, *tArgs.m_pSettings, false ); // fixme! m.b. explain boolean-simplified?

bool bWordDict = tArgs.m_pDict->GetSettings().m_bWordDict;
int iExpandKeywords = ExpandKeywords ( tArgs.m_iExpandKeywords, QUERY_OPT_DEFAULT, *tArgs.m_pSettings, bWordDict );
Expand Down
2 changes: 1 addition & 1 deletion src/sphinx.h
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ struct CSphQuery

bool m_bSortKbuffer = false; ///< whether to use PQ or K-buffer sorting algorithm
bool m_bZSlist = false; ///< whether the ranker has to fetch the zonespanlist with this query
bool m_bSimplify = false; ///< whether to apply boolean simplification
bool m_bSimplify = true; ///< whether to apply boolean simplification
bool m_bPlainIDF = false; ///< whether to use PlainIDF=log(N/n) or NormalizedIDF=log((N-n+1)/n)
bool m_bGlobalIDF = false; ///< whether to use local indexes or a global idf file
bool m_bNormalizedTFIDF = true; ///< whether to scale IDFs by query word count, so that TF*IDF is normalized
Expand Down
2 changes: 1 addition & 1 deletion src/sphinxint.h
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ void SetExtNodeStackSize ( int iDelta, int iExtra );
// other positive: necessary free size of stack
int ConsiderStack ( const struct XQNode_t * pRoot, CSphString & sError );
int ConsiderStackAbsolute ( const struct XQNode_t* pRoot );
void sphTransformExtendedQuery ( XQNode_t ** ppNode, const CSphIndexSettings & tSettings, bool bHasBooleanOptimization, const ISphKeywordsStat * pKeywords );
void sphTransformExtendedQuery ( XQNode_t ** ppNode, const CSphIndexSettings & tSettings, bool bHasBooleanOptimization = true, const ISphKeywordsStat * pKeywords = nullptr);
void TransformAotFilter ( XQNode_t * pNode, const CSphWordforms * pWordforms, const CSphIndexSettings& tSettings );
int ExpandKeywords ( int iIndexOpt, QueryOption_e eQueryOpt, const CSphIndexSettings & tSettings, bool bWordDict );
bool ParseMorphFields ( const CSphString & sMorphology, const CSphString & sMorphFields, const CSphVector<CSphColumnInfo> & dFields, CSphBitvec & tMorphFields, CSphString & sError );
Expand Down
2 changes: 1 addition & 1 deletion src/sphinxpq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1827,7 +1827,7 @@ std::unique_ptr<StoredQuery_i> PercolateIndex_c::CreateQuery ( PercolateQueryArg
}

// FIXME!!! provide segments list instead index
sphTransformExtendedQuery ( &tParsed->m_pRoot, m_tSettings, false, nullptr );
sphTransformExtendedQuery ( &tParsed->m_pRoot, m_tSettings );

bool bWordDict = m_pDict->GetSettings().m_bWordDict;
if ( m_tMutableSettings.m_iExpandKeywords!=KWE_DISABLED )
Expand Down
7 changes: 4 additions & 3 deletions src/sphinxquery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2876,9 +2876,7 @@ class CSphTransformation : public ISphNoncopyable
CSphTransformation::CSphTransformation ( XQNode_t ** ppRoot, const ISphKeywordsStat * pKeywords )
: m_pKeywords ( pKeywords )
, m_ppRoot ( ppRoot )
{
assert ( m_pKeywords!=NULL );
}
{}



Expand Down Expand Up @@ -2920,6 +2918,9 @@ void CSphTransformation::SetCosts ( XQNode_t * pNode, const CSphVector<XQNode_t
{
assert ( pNode || dNodes.GetLength() );

if ( !m_pKeywords )
return;

CSphVector<XQNode_t*> dChildren ( dNodes.GetLength() + 1 );
dChildren[dNodes.GetLength()] = pNode;
ARRAY_FOREACH ( i, dNodes )
Expand Down
Loading