No results provided by Riak search, another !

Dan Reverri dan at basho.com
Tue Jul 5 12:27:35 EDT 2011


Hi Germain,

It looks like your document has nested fields which means the schema you
have defined won't match the fields produced by the pre-commit hook. The
pre-commit hook flattens JSON documents using an underscore ("_") between
nested fields (e.g. fans_**data_nsid); your schema should be using the
flattened field name.

Thanks,
Dan

Daniel Reverri
Developer Advocate
Basho Technologies, Inc.
dan at basho.com


On Tue, Jul 5, 2011 at 7:05 AM, Germain Maurice <
germain.maurice at linkfluence.net> wrote:

> Hello everybody,
>
> I have a problem with Riak Search. I tried to find the solution by my own,
> i tried all the solutions i found and no results.
>
> Firstly, i tried to use it with the default schema, it works but it indexes
> too much data.
> So, i set my own schema as this :
> {
>    schema,
>    [
>        {version, "1.1"},
>        {n_val, 1},
>        {default_field, "nsid"},
>        {analyzer_factory, {erlang, text_analyzers,
> standard_analyzer_factory}}
>    ],
>    [
>        {field, [
>            {name, "favedate"},
>            {type, string},
>            {analyzer_factory, {erlang, text_analyzers,
> standard_analyzer_factory}}
>        ]},
>
>        {field, [
>            {name, "date_faved"},
>            {type, string},
>            {analyzer_factory, {erlang, text_analyzers,
> standard_analyzer_factory}}
>        ]},
>
>        %% Everything else is skipped
>        {dynamic_field, [
>            {name, "*"},
>            {skip, true}
>        ]}
>    ]
> }.
>
> Hook on precommit of my buckets are ok.
> I set the schema for each of my buckets as this : "search-cmd set-schema
> photostest My.schema"
> Did a "search-cmd clear-schema-cache" command.
>
> I re-indexed all of my documents of the bucket however, these documents are
> not indexed.
> An example :
>
> { "fans":{
>    "data":[{"nsid":"83786678 at N00"**,
>            "favedate":"1309539453"}
>              ,{"nsid":"33233619 at N02",
>               "favedate":"1309539169"}]
>  , ...
> Here is the answer of the index :
> {"responseHeader":{"status":0,**"QTime":2,"params":{"q":"fans_**
> data_nsid:83786678 at N00","q.op"**:"or","filter":"","wt":"
> json"}},"response":{"numFound"**:0,"start":0,"maxScore":"0.0",**
> "docs":[]}}
>
>
> thank you !
>
> --
> Germain Maurice
> Administrateur Système/Réseau
> Tel : +33.(0)1.42.43.54.33
>
> http://www.linkfluence.net
>
>
> ______________________________**_________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/**mailman/listinfo/riak-users_**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/20110705/cfb3d56d/attachment.html>


More information about the riak-users mailing list