I can think of two ways to get your hands on this information, simplest one beeing you creating a filter with the documents that mached your original query and then place new queries on the index with slop, non slop, et c to find out whats what. This will of couse be very expensive and is thus only an interesting solution for you if the response time is good enough.
The second and cleaner solution is to create your custom Query(ies) or hack the Weight of the queries you are currently using and have them store this information when matching. A good implementation of this would probably be a welcomed contribution to the project. karl Edwin Lee skrev: > Hi Karl, > > Thanks for the response. i have looked at the Highlighter. Unfortunately, > when i feed it with a PhraseQuery, it seems to break up the query into it's > individual terms first, so does not yield the result that i would like. i > have not looked at Searcher.explain yert though. > > It's like this. Two types of searches are required: single term with > wildcard, and phrase query with non-zero slop. But either could return large > number of results, some of which are not what is wanted. So there needs to be > an intermediate filter screen like this: > apples and oranges 25 hits found > oranges and apples 70 hits found > and apples oranges 5 hits found > ... > > so that we can choose to not to display results which correspond to the found > phrases that we are not interested in, and when we get to the display screen, > it's just the results we want. > > > > Thanks, > Edwin > > > > ---------------------------------------- >> Date: Sat, 19 Apr 2008 22:01:17 +0200 >> From: [EMAIL PROTECTED] >> To: java-user@lucene.apache.org >> Subject: Re: How to Retrieve Found Term? >> >> Edwin Lee skrev: >>> Hi all, >>> >>> i'm using Lucene 2.3.1. What i'm trying to do seems straightforward enough >>> (to me), but i just can't find the method to do so. >>> >>> Let's say i'm doing a PhraseQuery of the phrase "apples and oranges" with a >>> non-zero slop value, and it returns, e.g., 20 Hits. Because i'm using >>> non-zero slop value, the phrase that actually gets found could be something >>> like "oranges and apples" instead. i would like to find out, for each of >>> the Hit returned, what is the actual term from the document that was found. >>> How can i do that? > >> There is no built in support in Lucene for that. You can take a look at >> what Searcher.explain and the Highlighter does. >> >> If you tell us why you want to do this perhaps we can come up with an >> alternative solution. >> >> karl >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > > _________________________________________________________________ > Publish your photos to your Space easily with Photo Gallery. > http://www.get.live.com/wl/all > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]