Reputation:
I need to build solr queries programmatically based on user selections. e.g. if the user select a checkbox I add a clause, if they choose a dropdown I add another clause etc.
As I understand it solr simply accepts a string for the "q" param so I was thinking to use lucene's query builder to build the query then call toString(). It seems like a hack but I can't think of a better solution. Has anyone else done this before? Is there a better approach?
Upvotes: 0
Views: 360
Reputation: 435
ok, you don't need use lucene to assemble some caluse , it also can use solrj to achieve to goal .
there are a simple codes:
hope it can be help you !
Upvotes: 1