lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shalin Shekhar Mangar <>
Subject Re: Rules engine and Solr
Date Mon, 04 Jan 2010 11:41:01 GMT
On Mon, Jan 4, 2010 at 10:24 AM, Avlesh Singh <> 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

Shalin Shekhar Mangar.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message