Re: SpanQuery and BoostingTermQuery oddities

2009-08-16 Thread Eran Sevi
I've managed to create some sort of solution to this problem - The result is that we can get an equal score for a SpanOrQuery as a regular BooleanQuery with only SHOULD clauses. We can also get an equal score for a SpanNotQuery as a regular BooleanQuery with only MUST clauses. The good is that th

Re: SpanQuery and BoostingTermQuery oddities

2009-08-12 Thread Michael McCandless
All Span*Query seem to rely on the SpanQuery.createWeight (which returns SpanWeight/SpanScorer) to make their weight/scorer. SpanScorer in turn simply enumerates all spans summing up their "sloppy freq" and always scoring with that, regardless of the sub queries. So SpanNearQuery (or any composite

Re: SpanQuery and BoostingTermQuery oddities

2009-08-05 Thread Mark Miller
If we end up keeping Weight, I don't think the Changes entry on back compat says enough? If you overrode protected Weight createWeight(Query query) throws IOException, its not called anymore so you are dead in the water? And just overall, it appears to be a break, but the instructions don't t

Re: SpanQuery and BoostingTermQuery oddities

2009-08-05 Thread Mark Miller
This is a little different than what Grant was talking about. For the old variants to work, I think you have to call the Searcher methods that take an old style weight. Its not an ideal break, I know. I think we might consider just dropping Weight? If we make the issue with 1771 a compile tim

Re: SpanQuery and BoostingTermQuery oddities

2009-08-05 Thread Peter Keegan
I got it to work by adding new overrides: public QueryWeight createQueryWeight(Searcher searcher) throws IOException public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException But, it seems like it should still work with the old overrides: prote

Re: SpanQuery and BoostingTermQuery oddities

2009-08-05 Thread Peter Keegan
I ran into the same problem trying to update the BoostingNearQuery patch in *LUCENE-1341 . *The scorer never gets called. This used to work in 2.3.2 Peter On Wed, Aug 5, 2009 at 11:01 AM, Mark Miller wrote: > Grant Ingersoll wrote: > >> >> On A

Re: SpanQuery and BoostingTermQuery oddities

2009-08-05 Thread Mark Miller
Grant Ingersoll wrote: On Aug 5, 2009, at 10:07 AM, Mark Miller wrote: Yeah - SpanQuery's don't use the boosts from subspans - it just uses the idf for the query terms and the span length I believe - and the boost for the top level Query. Is that the right way to go? I guess Doug seemed to t

Re: SpanQuery and BoostingTermQuery oddities

2009-08-05 Thread Grant Ingersoll
On Aug 5, 2009, at 10:07 AM, Mark Miller wrote: Yeah - SpanQuery's don't use the boosts from subspans - it just uses the idf for the query terms and the span length I believe - and the boost for the top level Query. Is that the right way to go? I guess Doug seemed to think so? I don't kno

Re: SpanQuery and BoostingTermQuery oddities

2009-08-05 Thread Mark Miller
Grant Ingersoll wrote: A BoostingTermQuery (BTQ) is a SpanQuery. If I run: IndexSearcher searcher = new IndexSearcher(dir, true); searcher.setSimilarity(payloadSimilarity);//set the similarity. Very important BoostingTermQuery btq = new BoostingTermQuery(new Term("body", "fox"));