Highlighting in full-text search

Chaim Solomon chaim at itcentralstation.com
Sun May 4 02:07:02 EDT 2014


Thanks.
I am not getting a highlighting section - but the values are empty.
I am using the default schema - what do I need to change for the
highlighting to work?

Chaim Solomon



On Thu, May 1, 2014 at 11:19 PM, Hector Castro <hector at basho.com> wrote:

> Hi Chaim,
>
> In order to take advantage of the Riak Search/Solr highlighting
> capabilities from Python (right now), you're best bet may be to use a
> Python Solr client for queries. The Riak client for Python is still not
> 100% compatible with Riak 2.0 (although the master branch has some
> support). [0]
>
> Using the examples provided in the basic usage for search documentation
> [1], I was able to retrieve highlighting snippets via HTTP using the
> following set of query string parameters:
>
> $ curl -s
> "$RIAK_HOST/search/famous?wt=json&hl=true&hl.fl=name_s&q=name_s:Lion*" |
> python -mjson.tool | grep -A6 "highlighting"
>     "highlighting": {
>         "default_yzbucket_liono_54": {
>             "name_s": [
>                 "<em>Lion-o</em>"
>             ]
>         }
>     },
>
> (Note the <em> tags surrounding the term that matches the query.)
>
> --
> Hector
>
> [0] https://github.com/basho/riak-python-client
> [1] http://docs.basho.com/riak/2.0.0beta1/dev/using/search/
>
>
> On Thu, May 1, 2014 at 5:02 AM, Chaim Solomon <chaim at itcentralstation.com>
> wrote:
> > Hi,
> >
> > I am not able to figure out how to get the highlighting to work.
> > I am using 2.0.0beta1 which states that it supports highlighting - but it
> > seems not really documented besides the reference to the Solr
> documentation.
> > I am using the Python client.
> >
> > The documentation states that I need to set hl=true. But where?
> > It doesn't seem to be one of the parameters that the method search
> accepts
> > (looked in the source code).
> >
> > How do I get that parameter into the search?
> >
> > Can anyone provide an example?
> >
> > Chaim Solomon
> >
> >
> > _______________________________________________
> > riak-users mailing list
> > riak-users at lists.basho.com
> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20140504/a78a68f3/attachment.html>


More information about the riak-users mailing list