lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pradeep Singh <pksing...@gmail.com>
Subject Re: I need to indexing the first character of a field in another field
Date Mon, 18 Oct 2010 21:56:11 GMT
You can use regular expression based template transformer without writing a
separate function. It's pretty easy to use.

On Mon, Oct 18, 2010 at 2:31 PM, Renato Wesenauer <
renato.wesenauer@gmail.com> wrote:

> Hello guys,
>
> I need to indexing the first character of the field "autor" in another
> field
> "inicialautor".
> Example:
>   autor = Mark Webber
>   inicialautor = M
>
> I did a javascript function in the dataimport, but the field  inicialautor
> indexing empty.
>
> The function:
>
>    function InicialAutor(linha) {
>        var aut = linha.get("autor");
>        if (aut != null) {
>          if (aut.length > 0) {
>              var ch = aut.charAt(0);
>              linha.put("inicialautor", ch);
>          }
>          else {
>              linha.put("inicialautor", '');
>          }
>        }
>        else {
>            linha.put("inicialautor", '');
>        }
>        return linha;
>    }
>
> What's wrong?
>
> Thank's,
>
> Renato Wesenauer
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message