lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Hall <mh...@informatics.jax.org>
Subject Re: Highligheter fails using JapaneseAnalyzer
Date Tue, 30 Jun 2009 14:41:19 GMT
Does the same thing happen when you use SimpleAnalyzer, or StandardAnalyzer?

I have a sneaking suspicion that the : in your contents string is what's
causing your issue here, as : is a reserved character that denotes a
field specification. But I could be wrong.

Try swapping analyzers, if you no longer have the same issue with
Simple, try Standard. Assuming the same problem shows up there, I think
you might need to do something about the :.

Matt

k.sayama wrote:
> hello.
>
> i've tried to highlight string using Highligheter(2.4.1) and
> JapaneseAnalyzer
> but the following code extract show the problem
>
> String F = "f";
> String CONTENTS = "AAA :BBB CCC";
> JapaneseAnalyzer analyzer = new JapaneseAnalyzer();
> QueryParser qp = new QueryParser( F, analyzer );
> Query query = qp.parse( "BBB" );
> Highlighter h = new Highlighter( new QueryScorer( query, F ) );
>
> System.out.println( h.getBestFragment( analyzer, F, CONTENTS ) );
>
> The sytsem outputs
> <B>AAA</B> :BBB CCC
>
> When you change CONTENTS to "AAA _BBB CCC"
> the system outputs
>
> AAA _<B>BBB</B> CCC
>
> Are there any problems?
> Thanks in advance
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>


-- 
Matthew Hall
Software Engineer
Mouse Genome Informatics
mhall@informatics.jax.org
(207) 288-6012



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


Mime
View raw message