Interoperable interactive geometry for Europe
I forgot my login data

Report a bug

Fan club

Quick Intro Videos
click to start movie
Create A Simple
GeoGebra Resource (25Mb)
click to start movie
Filing a review
click to start movie
Find a Resource

This platform is brought to you by the intergeo project, funded under the eContent Plus programme of the European commission and by partners

import org.apache.lucene.queryParser.QueryParser; import; import org.curriki.xwiki.plugin.lucene.CurrikiAnalyzer import com.xpn.xwiki.api.XWiki; import com.xpn.xwiki.api.Context import import import import org.apache.lucene.index.Term import com.xpn.xwiki.plugin.lucene.I2GLuceneProfile;

public class QueryFactory {

public QueryFactory() {}

public Query queryParse(String qText, XWiki xwiki, Context context) {

Query q = new QueryParser("ft", CurrikiAnalyzer.getInstance(xwiki.getLanguagePreference() + ",en,x-all", context.context, I2GLuceneProfile.getInstance())).parse(qText); BooleanQuery bq; if(q instanceof BooleanQuery) bq = q; else { bq = new BooleanQuery(); bq.add(q,BooleanClause.Occur.MUST); } bq.add(new TermQuery(new Term("CurrikiCode.AssetClass.hidden_from_search","1")),BooleanClause.Occur.MUST_NOT) // TODO: add a non-hidden criterion return bq; } }