Highlighting in full-text search

Chaim Solomon chaim at itcentralstation.com
Sun May 4 05:51:09 EDT 2014


Ok - figured it out.

I had to modify the schema:
   <field name="all_text" type="text_general" indexed="true" stored="true"
multiValued="true" termVectors="true" termPositions="true"
 termOffsets="true"/>

It is implicit in the table
http://docs.basho.com/riak/2.0.0beta1/dev/advanced/search-schema/#Field-Properties-By-Use-Case

But I would suggest adding explicit examples to the documentation - at
least for the features in the feature list.

Chaim Solomon



On Sun, May 4, 2014 at 9:07 AM, Chaim Solomon <chaim at itcentralstation.com>wrote:

> 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/ce3c7305/attachment.html>


More information about the riak-users mailing list