For  java.sql.Types.BLOB, I use the builder.value(Object object) method in
XContentBuilder, with a byte array as parameter.

For java.sql.Types.CLOB/NCLOB, I use just a string as returned by JDBC in
Clob.getSubString

There are DBs which store blobs as java.sql.Types.BINARY, and this can be
passed as string or byte array to XContentBuilder (default is byte array).

Here, it is a NVARCHAR column of MS SQL, which is alway returned by JDBC as
string by the getNString() method.

Jörg

On Sun, Feb 22, 2015 at 6:14 PM, David Pilato <da...@pilato.fr> wrote:

> Hi Jörg
>
> A bit out of topic: I wonder if you are indexing blobs as base64 encoded
> fields in JDBC river?
> (I did not look at the doc)
>
> --
> David ;-)
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
>
> Le 22 févr. 2015 à 18:11, "joergpra...@gmail.com" <joergpra...@gmail.com>
> a écrit :
>
> Can you give some information about the mapper attachment setup you used
> successfully?
>
> There is no good reason why this should not be possible with JDBC river.
>
> Jörg
>
> On Sun, Feb 22, 2015 at 5:20 PM, Jiri Pik <jiri....@googlemail.com> wrote:
>
>> I need to index a HTML column (nvarchar(MAX)) in a MS SQL Server
>> database. I have set up a JDBC river
>> https://github.com/jprante/elasticsearch-river-jdbc and the database is
>> indexed.
>>
>> Using
>>
>>   "settings":{
>>
>>     "analysis":{
>>
>>       "analyzer":{
>>
>>         "default":{
>>
>>           "type":"custom",
>>
>>           "tokenizer":"standard",
>>
>>           "filter":[ "standard", "lowercase" ],
>>
>>           "char_filter" : ["html_strip"]
>>
>>         }
>>
>>       }
>>
>>     }
>>
>>   }
>>
>> is good for searching but not for the highlighter as that returns
>> sometimes trimmed unpaired html tags.
>>
>> I have played with the Mapper Attachments with HTML attachments and then
>> the highlighter works well - all original html tags are gone - but I am
>> unable to get the river push the column directly to the Mapper Attachments.
>>
>> Questions:
>>
>> 1. what is the best practice for indexing HTML columns? I am aware of the
>> possibility of a manual removal of HTML tags using Agility Pack but do not
>> like that as it's too much extra maintenance.
>>
>> 2. is there any better highlighter for html data which doesn't cut off
>> any original html tags?
>>
>> 3. How to plug in the JDBC river to Mapper Attachments?
>>
>> 4. Any better ideas how to achieve my goals?
>>
>>
>> Thanks!
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "elasticsearch" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to elasticsearch+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/elasticsearch/f175734b-0889-40a9-96d1-d46702e56666%40googlegroups.com
>> <https://groups.google.com/d/msgid/elasticsearch/f175734b-0889-40a9-96d1-d46702e56666%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "elasticsearch" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elasticsearch+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/CAKdsXoH6Ei%2B23bRKrL0Z7WkQALengfhaZeJRBq5gK1F22yxJfg%40mail.gmail.com
> <https://groups.google.com/d/msgid/elasticsearch/CAKdsXoH6Ei%2B23bRKrL0Z7WkQALengfhaZeJRBq5gK1F22yxJfg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "elasticsearch" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elasticsearch+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/09317C08-E397-4044-91F2-072A5FA4A3DF%40pilato.fr
> <https://groups.google.com/d/msgid/elasticsearch/09317C08-E397-4044-91F2-072A5FA4A3DF%40pilato.fr?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEJ2NTzZThKsHmjKbw%2BLu0HWEw0UrUPsqE3wJtCMMGNpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to