Re: Anti-Pattern in lucent-join jar?

2014-12-08 Thread Michael Sokolov
Right - allowing Solr to manage these queries (SOLR-6234) seems like the way to go ... OP == original poster (I lost track of who started the discussion) -Mike On 12/08/2014 10:19 AM, Mikhail Khludnev wrote: On Mon, Dec 8, 2014 at 5:38 PM, Michael Sokolov < msoko...@safaribooksonline.com>

Re: Anti-Pattern in lucent-join jar?

2014-12-08 Thread Darin Amos
Hi Mikhail, I was merely posing a thought in an effort to continue to learn and educate myself. Your point about Weight.scorer() being called per segment helps my understanding. I am in the middle of building a POC for a customer of mine that I pointed out in this thread on Dec 5th (shortly aft

Re: Anti-Pattern in lucent-join jar?

2014-12-08 Thread Mikhail Khludnev
On Mon, Dec 8, 2014 at 5:38 PM, Michael Sokolov < msoko...@safaribooksonline.com> wrote: > I get the impression there was a concern that the caller could hold on to > the query generated by JoinUtil for too long - eg across requests in Solr. Michael, if you still bother, SOLR-6234

Re: Anti-Pattern in lucent-join jar?

2014-12-08 Thread Michael Sokolov
I get the impression there was a concern that the caller could hold on to the query generated by JoinUtil for too long - eg across requests in Solr. I'm not sure why the OP thinks that would happen, though. -Mike On 12/08/2014 04:57 AM, Mikhail Khludnev wrote: On Fri, Dec 5, 2014 at 10:44 PM,

Re: Anti-Pattern in lucent-join jar?

2014-12-08 Thread Mikhail Khludnev
On Fri, Dec 5, 2014 at 10:44 PM, Darin Amos wrote: > public Scorer scorer(){ > TermsWithScoreCollector collector = new > TermsWithScoreCollector(); > JoinQuery.this.s.search(JoinQuery.this.q, > collector); > >

Re: Anti-Pattern in lucent-join jar?

2014-12-05 Thread Darin Amos
In this case I was thinking about something like the following.. if you changed the Query implementation or created your own similar query: If you consider this query: q={!scorejoin from=parent to=id}type:child public class ScoreJoinQuery extends Query(){ private Query q = null;

Re: Anti-Pattern in lucent-join jar?

2014-12-05 Thread Roman Chyla
Not sure I understand. It is the searcher which executes the query, how would you 'convince' it to pass the query? First the Weight is created, weight instance creates scorer - you would have to change the API to do the passing (or maybe not...?) In my case, the relationships were across index segm

Re: Anti-Pattern in lucent-join jar?

2014-12-05 Thread Darin Amos
Couldn’t you just keep passing the wrapped query and searcher down to Weight.scorer()? This would allow you to wait until the query is executed to do term collection. If you want to protect against creating and executing the query with different searchers, you would have to make the query facto

Re: Anti-Pattern in lucent-join jar?

2014-12-05 Thread Roman Chyla
Hi Mikhail, I think you are right, it won't be problem for SOLR, but it is likely an antipattern inside a lucene component. Because custom components may create join queries, hold to them and then execute much later against a different searcher. One approach would be to postpone term collection unt

Re: Anti-Pattern in lucent-join jar?

2014-12-05 Thread Darin Amos
Thanks for the information! The reason I ask is I am doing a POC on building a custom Query+QueryParser+Facet Component customization. I have had some issues finding exactly what I am looking for OOTB and I believe I need something custom. (its also a really good learning exercise) I do ecomm

Re: Anti-Pattern in lucent-join jar?

2014-12-05 Thread Mikhail Khludnev
Thanks Roman! Let's expand it for the sake of completeness. Such issue is not possible in Solr, because caches are associated with the searcher. While you follow this design (see Solr userCache), and don't update what's cached once, there is no chance to shoot the foot. There were few caches inside

Re: Anti-Pattern in lucent-join jar?

2014-12-04 Thread Roman Chyla
+1, additionally (as it follows from your observation) the query can get out of sync with the index, if eg it was saved for later use and ran against newly opened searcher Roman On 4 Dec 2014 10:51, "Darin Amos" wrote: > Hello All, > > I have been doing a lot of research in building some custom

Re: Anti-Pattern in lucent-join jar?

2014-12-04 Thread Mikhail Khludnev
Hello, I wonder if you see https://issues.apache.org/jira/browse/SOLR-6234 which solves such problem. QueryResult Cache are useless for join, because they carry cropped results. Potentially you can hit filter cache wrapping fromQuery into this monster bridge new FilteredQuery(new MatchAllDocsQuery

Anti-Pattern in lucent-join jar?

2014-12-04 Thread Darin Amos
Hello All, I have been doing a lot of research in building some custom queries and I have been looking at the Lucene Join library as a reference. I noticed something that I believe could actually have a negative side effect. Specifically I was looking at the JoinUtil.createJoinQuery(…) method a