lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Frankowski <>
Subject Re: Search result snippets?
Date Fri, 06 Jan 2006 22:59:49 GMT

Thanks, I have signed up for the wiki and will put in the answer when I 
fully understand it.


So, I downloaded the Highlighter code with

svn checkout

Then I tried to compile it with lucene.jar, version 1.4.3. I get 
compile-time errors (attached at the bottom of this message) for missing 
classes. One of them is org.apache.lucene.index.TermVectorOffsetInfo. 
For example,
% jar tvf lib/lucene.jar | grep TermVectorOffset
<nothing ...>
% jar xvf ../work/jspwiki/JSPWiki/lib/lucene.jar  META-INF/MANIFEST.MF
dfrankow@gibson (~/windows/tmp) % cat META-INF/MANIFEST.MF
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.1
Created-By: Apache Jakarta

Name: org/apache/lucene
Specification-Title: Lucene Search Engine
Specification-Version: 1.4.3
Specification-Vendor: Lucene
Implementation-Title: org.apache.lucene
Implementation-Version: build 2004-11-29 15:13:05
Implementation-Vemdpr: Lucene

I looked for TermVectorOffsetInfo in jar version 1.4.3, 1.4, 1.3, and 
1.2, and could not find it.

Someone asked about this on March 11 

You said to check out the trunk of Lucene, but I have to work with 
Lucene 1.4.3 in an existing project. I can't work with a version from SVN.

Suggestions? Is there a version of Highlighter that works with 1.4.3? If 
it compiles for you, where do you get TermVectorOffsetInfo, and is that 
in 1.4.3?

Thanks in advance.


Chris Hostetter wrote:

>: Thanks for this tip! This should be in the FAQ. Is there a way to get it
>: in there? I can't edit the wiki, I think.
>1) People who create a Wiki account can edit the FAQ.
>2) the FAQ already includes a refrence to Highlighter, I think it's the
>FAQ entry you mentioned...
>   Is there a way to get a text summary of an indexed document with Lucene?
>   You could store the documents summary in the index and then use the
>   Highlighter from the sandbox.
>...feel free to add to the FAQ whatever information you think would have
>made the answer more useful to you when you first found it.
>: >How would you implement "snippets" with Lucene? A snippet is some text
>: >around parts of the text that caused a match, with the search matches in
>: >bold. For example, the supporting text in Google searches. A snippet is
>: >NOT a document summary, which has a FAQ entry and someone answered about
>: >on this email list.
>To unsubscribe, e-mail:
>For additional commands, e-mail:


cannot find symbol
    [javac] symbol  : class TermVectorOffsetInfo
    [javac] location: package org.apache.lucene.index
    [javac] import org.apache.lucene.index.TermVectorOffsetInfo;
    [javac]                                ^
cannot find symbol
    [javac] symbol  : class TermVectorOffsetInfo
    [javac] location: class
    [javac]             TermVectorOffsetInfo[] offsets=tpv.getOffsets(t);
    [javac]             ^
cannot find symbol
    [javac] symbol  : method getOffsets(int)
    [javac] location: interface org.apache.lucene.index.TermPositionVector
    [javac]             TermVectorOffsetInfo[] offsets=tpv.getOffsets(t);
    [javac]                                               ^
internal error; cannot instantiate Token(java.lang.String,int,int) at 
org.apache.lucene.analysis.Token to ()
    [javac]                     unsortedTokens.add(new Token(terms[t],
    [javac]                                        ^
internal error; cannot instantiate Token(java.lang.String,int,int) at 
org.apache.lucene.analysis.Token to ()
    [javac]                     tokensInOriginalOrder[pos[tp]]=new 
    [javac]                                                    ^
    [javac] 5 errors

.../JSPWiki/build.xml:216: Compile failed; see the compiler error output 
for details.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message