1) Perhaps the the query you tried does not match anything in your index? What release are you using? [prefix*] works fine for me.

2) The Highlighter should not care if you have more than one field with the same name in a document. The Highlighter does not deal with documents. It takes a TokenStream of field:value pairs and then compares those to the field:value pairs in the query. If you pass a field name, only field matches are scored over 0, if you pass null for the field name, fields are ignored and only values are compared. This is all very separate from storing fields in a document. Are you doing something weird with your TokenStream?


- Mark

Lukas Vlcek wrote:
Hi,

I have two questions:

1) Is it possible to get some highlighted text when using wildcard query? (I
am using query rewrite)
I found that it works for queries like [prefix*suffix] or [prefix?suffix]
but I was not able to get results for queries like [prefix*]

2) What kind of problems I should expect when trying to get highlighted
fragment(s) from multi-filed document? (I mean when the document has more
fields of the same name).
So far I am often experiencing StringIndexOutOfBoundsException (see example
below):

SEVERE: String index out of range: 17
java.lang.StringIndexOutOfBoundsException: String index out of range: 17
       at java.lang.String.substring(String.java:1765)
       at
org.apache.lucene.search.highlight.Highlighter.getBestTextFragments(
Highlighter.java:235)
at org.apache.lucene.search.highlight.Highlighter.getBestFragments(
Highlighter.java:175)
       at org.apache.lucene.search.highlight.Highlighter.getBestFragment(
Highlighter.java:101)
       at
org.compass.core.lucene.engine.LuceneSearchEngineHighlighter.collectionFragment
(LuceneSearchEngineHighlighter.java:204)
       at
org.compass.core.lucene.engine.LuceneSearchEngineHighlighter.collectionFragment
(LuceneSearchEngineHighlighter.java:189)
       at
org.compass.core.impl.DefaultCompassHighlighter.collectionFragment(
DefaultCompassHighlighter.java:127)
... [truncated]
... [also you can notice that I am using Compass above Lucene but to me this seems like Lucene related problem because index seems to be OK (via Luke)]

I am using Lucene-2.2.0.

Regards,
Lukas


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to