Riak Search Field Aliases

Brian Hodgen brian.hodgen at gmail.com
Sun Oct 28 16:54:24 EDT 2012


Can somebody explain in more detail how the aliases parameter on the search
schema definition works? The documentation says it lets me
index multiple fields into one, so I tried to setup some schemas to let me
search on Name, that is actually the combined data of FirstName, LastName,
& MiddleName. I've got the search working for the properties by themselves,
but I can't seem to make the aliases work, so I'm either doing something
wrong or I misunderstood how they are supposed to work.


Schema Example:

I would really like this to work...but querying on Name never returns any
results.

{
    schema,
    [
        {version, "1.1"},
        {n_val, 3},
        {default_field, "Name"},
        {analyzer_factory, {erlang, text_analyzers, noop_analyzer_factory}}
    ],
    [
{field, [
    {name, "FirstName"},
    {analyzer_factory, {erlang, text_analyzers, standard_analyzer_factory}}
]},
{field, [
    {name, "MiddleName"},
    {analyzer_factory, {erlang, text_analyzers, standard_analyzer_factory}}
]},
{field, [
    {name, "LastName"},
    {analyzer_factory, {erlang, text_analyzers, standard_analyzer_factory}}
]},
{field, [
    {name, "Name"},
    {analyzer_factory, {erlang, text_analyzers, standard_analyzer_factory}},
    {aliases, ["LastName","FirstName","MiddleName"]}
]},
{dynamic_field, [
            {name, "*"},
    {skip, true}
]}
    ]
}.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20121028/fe6a613e/attachment.html>


More information about the riak-users mailing list