Re: highlighting - fuzzy search

2006-04-07 Thread Fisheye
yes, this might be a way, but in my case it would not work: The probles is, that I have to return an exceprt (snippet) and the words to be highlighted as two separate strings. So now I use highlighter and getBestFragment to extract the excerpt, then I remove the inserted html tags and return the

Re: highlighting - fuzzy search

2006-04-06 Thread Daniel Noll
Fisheye wrote: HashSet terms = new HashSet(); query.rewrite(reader).extractTerms(terms); Ok, but this delivers every term, not just a list of words the Levenshtein algorithm produced with similarity. I asked a similar thing in the past about term highlighting in general, and

Re: highlighting - fuzzy search

2006-04-06 Thread Fisheye
HashSet terms = new HashSet(); query.rewrite(reader).extractTerms(terms); Ok, but this delivers every term, not just a list of words the Levenshtein algorithm produced with similarity. Regarding to the posts here in my opened thread, you guis seem to be experienced programmers so

Re: highlighting - fuzzy search

2006-04-05 Thread Daniel Noll
mark harwood wrote: Isn't that what Query.extractTerms is for? Isn't it implimented by all primitive Queries?.. As of last week, yes. I changed the SpanQueries to implement this method and then refactored the Highlighter package's QueryTermExtractor to make use of this (it radically simplified

Re: highlighting - fuzzy search

2006-04-05 Thread mark harwood
>Isn't that what Query.extractTerms is for? Isn't it >implimented by all primitive Queries?.. As of last week, yes. I changed the SpanQueries to implement this method and then refactored the Highlighter package's QueryTermExtractor to make use of this (it radically simplified the code in there).

Re: highlighting - fuzzy search

2006-04-04 Thread Chris Hostetter
: > Well, a roundabout way is to simply create a FuzzyQuery, rewrite it, : > cast it to a BooleanQuery and use the BooleanQuery API to extract the : > TermQuery objects and the Term within the TermQuery has what you're ... : We take an approach somewhere down the middle... ... :

Re: highlighting - fuzzy search

2006-04-04 Thread Daniel Noll
Erik Hatcher wrote: On Apr 4, 2006, at 11:23 AM, Fisheye wrote: Probably, do you know if there is a possibility to get the similar words generated by the algorithm when doing fuzzy search? Well, a roundabout way is to simply create a FuzzyQuery, rewrite it, cast it to a BooleanQuery and use

Re: highlighting - fuzzy search

2006-04-04 Thread Erik Hatcher
On Apr 4, 2006, at 11:23 AM, Fisheye wrote: Probably, do you know if there is a possibility to get the similar words generated by the algorithm when doing fuzzy search? Well, a roundabout way is to simply create a FuzzyQuery, rewrite it, cast it to a BooleanQuery and use the BooleanQuery A

Re: highlighting - fuzzy search

2006-04-04 Thread Fisheye
ok, thank Erik, now it works :-) Probably, do you know if there is a possibility to get the similar words generated by the algorithm when doing fuzzy search? Cheers Simon Dietschi -- View this message in context: http://www.nabble.com/highlighting---fuzzy-search-t1392775.html#a3746483 Sent fro

Re: highlighting - fuzzy search

2006-04-04 Thread Erik Hatcher
So, just like I said call Query.rewrite() and pass the returned Query to the Highlighter, not the original FuzzyQuery. I believe the javadocs for Highlighter even mention this? Or at least its an FAQ that hopefully is on the wiki or easily findable somehow. Erik On Apr 4, 2

Re: highlighting - fuzzy search

2006-04-04 Thread Fisheye
Ok, thanks Erik. So probably my code may explain it: --- public void searchQuery(String q, float rel, String indexDir){ String excerpt = "";

Re: highlighting - fuzzy search

2006-04-04 Thread Erik Hatcher
On Apr 4, 2006, at 8:30 AM, Fisheye wrote: Is it possible to get back a highlighted text "snippet" when using fuzzy search? I mean where does lucene stores the similar words to the search query? If I know where these words are, I can use one of these words to highlight. You mean using a