Ok, so here's the deal: Lucene does the weirdes things to me. Everything is indexed properly, everything works, everything's fast etc etc.
So I search for a category in English. Hundreds of results pop out.
So I search for a country in English. Hundred of results pop out.
So I search for a category AND a country in English. A combination that I KNOW is valid. I get jack. Nothing. Zip.... Why?
Zend_Search_Lucene_Analysis_Analyzer::setDefault(new Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum_CaseInsensitive());
$index = Library_Search_Lucene::open(SearchIndexer::getIndexDirectory());
$query = new Zend_Search_Lucene_Search_Query_Boolean();
$queryString = new Zend_Search_Lucene_Search_Query_MultiTerm();
$queryString->addTerm(new Zend_Search_Lucene_Index_Term('lang' . $language, 'langSite'));
$query->addSubquery($queryString, true);
if (isset($idCategory)) {
$queryCategory = new Zend_Search_Lucene_Search_Query_MultiTerm();
$queryCategory->addTerm(new Zend_Search_Lucene_Index_Term($idCategory, 'idCategory'));
$query->addSubquery($queryCategory, true);
}
if (isset($country)) {
$queryLocation = new Zend_Search_Lucene_Search_Query_MultiTerm();
$queryLocation->addTerm(new Zend_Search_Lucene_Index_Term($country, 'locationsClean'));
$query->addSubquery($queryLocation, true);
}
$hits = $index->find($query);
$query->getQueryTerms() returns a valid array of terms. There are no errors. What the hell am I doing wrong?