lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karthik N S" <kart...@controlnet.co.in>
Subject FW: org.apache.lucene.search.highlight.Highlighter
Date Tue, 25 May 2004 03:58:59 GMT


Hi
Lucene Developers

Using org.apache.lucene.search.highlight.Highlighter SRC for Search

The Package.html displays something like this

  String text = hits.doc(i).get(FIELD_NAME);
 TokenStream tokenStream=analyzer.tokenStream(FIELD_NAME,new
StringReader(text));

On using this SRC My Code raises an  "NullPointerException " [ The text on
hits.doc(i) is returning this exception ]
Why am I getting null for the text , Is it linked to type of field  type
during indexing process or .....

                                                    or  is it due to ...

a piece of code "(refrence from Orielly.com) CustomAnalyser " an being using
it
 other then org.apache.lucene.analysis.standard.StandardAnalyzer() ,

1) In the first case [using CustomAnalyzer()    ] the text returns me NULL
, the Hits return me     707.
2) In second  case [ using StandardAnalyzer() ] No hits are encountered   ,
the Hits return's me  0.
3) But on using a normal SearchFiles with StandardAnalyzer() from demo  (
org.apache.lucene.demo)  revels all the correct 707 hits probables.



Please somebody look into this........


Karthik





-----Original Message-----
From: markharw00d@yahoo.co.uk [mailto:markharw00d@yahoo.co.uk]
Sent: Saturday, May 22, 2004 12:34 AM
To: lucene-user@jakarta.apache.org
Subject: Re: org.apache.lucene.search.highlight.Highlighter


Hi Claude, that example code you provided is out of date.

For all concerned - the highlighter code was refactored about a month ago
and then moved into the Sandbox.

Want the latest version? - get the latest code from the sandbox CVS.
Want the latest docs? - Run javadoc on the above.

There is a basic example of highlighter use in the package-level javadocs
and more extensive examples
in the JUnit test that accompanies the source code.

Hope this helps clarify things.

Mark

ps Bruce, I know you were interested in providing an alternative Fragmenter
implementation
for the highlighter that detects sentence boundaries.
You may want to look at LingPipe which has "a heuristic sentence boundary
detector".
( http://threattracker.com:8080/lingpipe-demo/demo.html )
I took a quick look at it but it has its own tokenizer that would be
difficult to make work with
the tokenstream used to identify query terms. At least the code gives some
examples of the
heuristics involved in detecting sentence boundaries. For my own apps I find
the standard Fragmenter
implementation suffices.


---------------------------------------------------------------------
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