Hi David, I haven't worked on streaming expressions yet but I did a little bit of digging around. I think the ClassifyStream might be somewhat similar to learn from. It takes a stream of docs, not unlike what you want. And crucially it implements setStreamContext with an implementation which demonstrates how to get access to a SolrCore. From a core, you can get a SolrIndexSearcher.
For multi-shard, I suggest you keep discussion about that on the existing JIRA issue to provide context to any possible future development. There is no existing code for merging tagging. ~ David Smiley Apache Lucene/Solr Search Developer http://www.linkedin.com/in/davidwsmiley On Fri, Feb 21, 2020 at 8:05 AM David '-1' Schmid < [email protected]> wrote: > Hello dear developers! > > I've been wondering if I'd be able to adapt the current > TaggerRequestHandler for using it within the /stream request handler. > > Starting out is a tad confusing, which I expected since I have almost no > experience with the solr/lucene codebase. > > My goal is as follows: I want to use the result of a previous > select(coll1, ...) as input for adding tags to the result document. > > Possibly: > tag( > select(...), field_to_analyze_for_tags, > collection_with_tag_dict, tag_dict_field, > ... // remaining tagger configuration options > ) > > I'm currently stuck at some steps in writing a > 'public class TaggerStream extends TupleStream implements Expressible' > at two points: > > == Problem 1: Getting 'terms' == > > The TaggerRequestHandler gets a SolrIndexSearcher via the request > > > final SolrIndexSearcher searcher = req.getSearcher(); > > Which in turn is used to to acquire the terms > > > Terms terms = searcher.getSlowAtomicReader().terms(indexedField); > > which are used for tagging. > > I've tried finding something that will yield the equivalent, but as you > might have guessed: I didn't find anything so far. > > > == Problem 2: Multiple Shards == > > I guess, this might come up sooner or later, hence this is related to > SOLR-14190 (requesting the tagger to work across multiple shards). > I suspect (mind: I really don't know) that acquiring the terms will have > to do something with that, at least when we need to merge the results > from multiple shards, but I have not yet found any code that does that. > Might have been blinded by my confusion, tho. > > > I'd be thankful if someone can help with any pointers regarding this. > > best regards, > David > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
