It would help tremendously if you can give a specific code example showing
the problem.

On Thu, Jun 2, 2016 at 6:41 AM Sascha Janz <sascha.j...@gmx.net> wrote:

>
> we use highlighter to get textfragments for our hit list.
>
> the code is straight forward like this
>
>    Analyzer analyzer = new StandardAnalyzer(;
>    QueryParser parser = new QueryParser( "content", analyzer);
>    Highlighter highlighter = new Highlighter(new
> QueryScorer(parser.parse(pQuery)));
>    Fragmenter fragmenter = new SimpleFragmenter(fragmentsize);
>    highlighter.setTextFragmenter(fragmenter);
>    TokenStream stream = analyzer.tokenStream("content", new
> StringReader(value));
>    String text = highlighter.getBestFragments(stream , value, 3);
>
> in most cases this gives us good results.
>
> but sometime when we do a query over multiple words. we get only
> highlighted fragments for one word.
>
> e.g. a query with "aalen ringen" does only become highlighted fragments
> with "ringen", although the word "aalen" is also in the content.
>
> any tips for getting better results?
>
> regards
> Sascha
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-user-h...@lucene.apache.org
>
> --
Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
http://www.solrenterprisesearchserver.com

Reply via email to