Hi,

I'm porting/upgrading a project from Lucene to Solr.

In Lucene, I was using the user-provided Lucene query string, and I did
complete it to implement access restriction, based on fields saved in the
index:

Query userQ=... // query from user
Query restrictQ=.. // implement restrictions
Query finalQ=new BooleanQuery();
finalQ.add(userQ,BooleanClause.Occur.MUST);
finalQ.add(restrictQ,BooleanClause.Occur.MUST);

Searching on 'finalQ' gives only the results which can be shown to the user.


Since Solr doesn't have programmatically build queries, how can I do
something equivalent?

Do we always have to build strings to make a query in SolR? Is there really
no equivalent to the Lucene API to build a query, using BooleanQuery,
TermQuery,... ?

Thanks for your help!

Reply via email to