You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Haroon Anwar Padhyar <ha...@gmail.com> on 2012/05/29 20:35:34 UTC

how to use Lucene Highlighter with LARQ query

hi,

can any one guide me, how to use Lucene Highlighter with LARQ query. (how
to highlight LARQ searched result. )

thanks

Haroon.

Re: how to use Lucene Highlighter with LARQ query

Posted by Paolo Castagna <ca...@googlemail.com>.
Hi Haroon,
LARQ itself does not gives you back the necessary information to highlight keywords you have searched for in the literals you get back as results.
However, even if not terribly efficient, if you present your users with a limited number of results you could use Lucene and re-run your query against the literals you got back, just to highlight your
keywords.

LARQ's aim is to extend SPARQL with free text queries and you have a property function you can use for that, for example:

{
    ?lit pf:textMatch '+text' .
    ?doc ?p ?lit
}

How would you provide the necessary information to highlight keywords in the text within SPARQL syntax? I don't see a sensible way.

Perhaps, another alternative is to try to use the Lucene index used by LARQ directly, so that you have the full Lucene feature set. However, I've not done this and, therefore, I am not 100% sure it's
possible.

Paolo

Haroon Anwar Padhyar wrote:
> hi,
> 
> can any one guide me, how to use Lucene Highlighter with LARQ query. (how
> to highlight LARQ searched result. )
> 
> thanks
> 
> Haroon.
>