Re: New type of proximity/fuzzy search

2016-09-01 Thread Saar Carmi
Thanks Allison and Uwe. Yes, indeed the SpanNearQuery is probably a better starting point as it already considers the proximity. I see you have opened an issue to track it. Are you looking to add the functionality to the existing SpanNearQuery or subclass it? Anyway, looking at the issue created

RE: New type of proximity/fuzzy search

2016-09-01 Thread Allison, Timothy B.
https://issues.apache.org/jira/browse/LUCENE-7434 -Original Message- From: Allison, Timothy B. [mailto:talli...@mitre.org] Sent: Wednesday, August 31, 2016 3:41 PM To: java-user@lucene.apache.org Subject: RE: New type of proximity/fuzzy search Doh, sorry, Uwe, didn't see your response fi

Re: Lucene 6.1: number of hits per document

2016-09-01 Thread szzoli
I call IndexSearcher.search(Query, Collector) but it is void. Where can I obtain the Scorer object? collector.getTotalHits() seems to return the number of the documents. How can I tell it that it should count the hits in the approriate document? -- View this message in context: http://lucene.

Re: Lucene 6.1: number of hits per document

2016-09-01 Thread Adrien Grand
IndexSearcher will call LeafCollector.setScorer(Scorer) for you when you call IndexSearcher.search(Query, Collector). All you need to do is to keep a reference to this Scorer object and use it in the LeafCollector.collect(int) method. Le jeu. 1 sept. 2016 à 14:42, szzoli a écrit : > I created a

Re: Lucene 6.1: number of hits per document

2016-09-01 Thread szzoli
I created a collector with SimpleCollector collector = new TotalHitCountCollector(); but when I wanted to call collector.setScorer(scorer); the scorer has again several parameters: Scorer scorer = new ConstantScoreScorer(Weight, float, disi); Do I have to create these objects, too? -- View this

Re: Lucene 6.1: number of hits per document

2016-09-01 Thread Adrien Grand
Maybe you should clarify your use-case. For instance Uwe was assuming that you needed this information for debugging purposes while I was assuming that you needed it for your application logic. Le jeu. 1 sept. 2016 à 14:20, szzoli a écrit : > "If the Query is a TermQuery, you can get this number

Re: Lucene 6.1: number of hits per document

2016-09-01 Thread szzoli
Adrien: "If the Query is a TermQuery, you can get this number by calling Scorer.freq() on the Scorer that is passed to Collector.setScorer()." My problem is that I do not know how can one get Scorer.freq(). Scorer is an abstect class. It has many deived classes. I don't know wich one to use. The