Thanks for the response, Shalin. I am still in two minds over doing it "inside" Solr versus "outside". I'll get back with more questions, if any.
Cheers Avlesh On Mon, Jan 4, 2010 at 5:11 PM, Shalin Shekhar Mangar < shalinman...@gmail.com> wrote: > On Mon, Jan 4, 2010 at 10:24 AM, Avlesh Singh <avl...@gmail.com> wrote: > > > I have a Solr (version 1.3) powered search server running in production. > > Search is keyword driven is supported using custom fields and tokenizers. > > > > I am planning to build a rules engine on top search. The rules are > database > > driven and can't be stored inside solr indexes. These rules would > > ultimately > > two do things - > > > > 1. Change the order of Lucene hits. > > > > A Lucene FieldComparator is what you'd need. The QueryElevationComponent > uses this technique. > > > > 2. Add/remove some results to/from the Lucene hits. > > > > > This is a bit more tricky. If you will always have a very limited number of > docs to add or remove, it may be best to change the query itself to include > or exclude them (i.e. add fq). Otherwise you'd need to write a custom > Collector (see DocSetCollector) and change SolrIndexSearcher to use it. We > are planning to modify SolrIndexSearcher to allow custom collectors soon > for > field collapsing but for now you will have to modify it. > > > > What should be my starting point? Custom search handler? > > > > > A custom SearchComponent which extends/overrides QueryComponent will do the > job. > > -- > Regards, > Shalin Shekhar Mangar. >