I have a search use case that requires that I use the results of search from
IndexA and apply them as a query component of a second search to IndexB.
(The nature of the data doesn't allow me to combine these indexes).
At present, this is handled at the client level: search one index, get the
results, apply them to a search against another index.
I can't change the two-query fundamentals, but I'd like to hide the
implementation from the client. If I wanted to concentrate this logic at
the server, should I be considering a custom request handler?
The request handler would:
- accept the query parameters
- use a subset of parameters to build a query against another search index
- execute that query, gather the results
- use those results as new parameters in another query
- execute the second query
I'm sure this isn't atypical, how are others accomplishing this?
: I can't change the two-query fundamentals, but I'd like to hide the
: implementation from the client. If I wanted to concentrate this logic at
: the server, should I be considering a custom request handler?
i do this, there's nthing wrong with teh appraoch ... but in my case i'm
wuerying the same internal Solr index both times -- the irst query is to
get metadata documents relating to the inpupt, and htose metdata documents
define rules about how the rest of hte input should be interpreted -- but
it's still one index, it's just that not all the documents have all the
if you really want to query a completley seeperate index, then some
questions are raised about where this index is and how you'll query it ...
but RequestHandlers are just java classess -- you cna do anything you want
in them and get data from anywhere you want, so go wild.
(MoreLikeThis actually works this exact same way by they way ... you can
specify a query, which is used to generate a list of documents, and then
those documents are used to build the queris for a second search.)