lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: retrieve tokens
Date Wed, 22 Dec 2004 16:43:37 GMT
Martijn, have you seen the Highlighter in the Lucene Sandbox?
If you've stored your text in the Lucene index, there is no need to go
back to DB to pull out the blog, parse it, and highlight it - the
Highlighter in the Sandbox will do this for you.

Otis

--- "M. Smit" <lists@Gangkast.com> wrote:

> Hello list,
> 
> I'm not sure if this subject will cover my question, but here goes:
> 
> consider the following snippet:
> 
> is = new IndexSearcher((String)
> envContext.lookup("search_index_dir"));
> StopAnalyzer analyzer = new 
> StopAnalyzer(ArticleIndexer.SEARCH_STOP_WORDS_NL);
> 
> parser = new 
> NewMultiFieldQueryParser(ArticleIndexer.FIELDS_SEARCH_BASIC,
> analyzer);
> parser.setOperator(QueryParser.DEFAULT_OPERATOR_AND);
> query = parser.parse(searchForm.getCriteria());
> 
> hits = is.search(query);
> log.info("[execute] aantal Lucene hits: " + hits.length());
> 
> Perfect.. And when I present the results, I retrieve the original 
> document from the database through it guid which I get from the 
> doc.get(ArticleIndexer.FIELD_GUID). And besides some businesslogic I 
> have to take care of when I retrieve the original document, I would
> also 
> like to give a context snippet.
> 
> So I've written a class which takes care of this context 'snippeting
> and 
> highlighting' (perhaps somebody knows about a great project which I 
> haven't found last week while hunting for it). But I need to have the
> 
> original query.. And preferable the words assiociated with the fields
> in 
> (String[]) ArticleIndexer.FIELDS_SEARCH_BASIC. Because every field 
> correspond with a different text-blob in  my DB, so I have to know
> which 
> BufferedReader I have to parse for the associated words..
> 
> Thank you for your time,
> Martijn
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message