Strange wildcard behavior

Rusty Klophaus rusty at basho.com
Fri Nov 11 13:04:25 EST 2011


Hi Elias,

I believe this issue is caused by interaction between the JSON extractor
and the noop analyzer.

The JSON extractor, when it sees multiple fields with the same value, it
merges them into a single value separated by a space. (This reflects
Search's view that documents are prose.)

Normally, the default analyzer would split on whitespace, but since your
schema overrides the field to use the noop analyzer, the value is left
untokenized.

Does that make sense?

Best,
Rusty

On Fri, Nov 11, 2011 at 2:21 AM, Elias Levy <fearsome.lucidity at gmail.com>wrote:

> I am seeing some strange someone behavior that maybe someone can explain.
>
> Using a modified default search schema, so that these fields are tokenized
> using the noop analyzer, if I index something like:
>
> {"i":{"bg":[{"dnm":"generic"},{"dnm":"onlinegamesfva"},{"dnm":"8ffa6"}]}}
>
>
> and I try searching for it with
>
> search-cmd search mybucket i_bg_dnm:'generic'
>
>
> it finds no matches.
>
> But if I search for:
>
> search-cmd search mybucket i_bg_dnm:'generic*'
>
>
> it finds the document.
>
> What gives?  Why does the specific match returns no matches but the wild
> card query does?
>
> Oddly, the output of search-cmd shows:
>
> index/id: mybucket/mykey2
> <<"i_bg_dnm">> -> <<"generic onlinegamesfva 8ffa6">>
>
>
> which appears to show that the values of key dnm in each dict in the array
> have been concatenated with spaces in between, which would explain the lack
> of a exact match, but matches with the wildcard.
>
> The example of indexing dict in an array that Rusty sent in reply to my
> message on that topic does not show this behavior.  Searching for a
> specific match returns a result, and searching with a wild card does not
> show the values of the matching fields in the dicts in the array being
> concatenated in this way:
>
> search-cmd search mybucket menu_popup_menuitem_value:'Ne*'
>
> index/id: mybucket/mykey1
> <<"menu_popup_menuitem_value">> -> <<"New">>
>
>
>
>
>
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>


-- 
Rusty Klophaus (@rustyio)
*Basho Technologies, Inc.*
www.basho.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20111111/76d0e557/attachment.html>


More information about the riak-users mailing list