Antonio, The reason the lowercase search doesn't work is because the default analyzer (whitespace analyzer) is case sensitive [1]. You could use the "standard" analyzer which will lowercase all terms but beware it's based off the standard Lucene analyzer which is really meant for full text search. Another option, if you are comfortable with Erlang, is to augment the whitespace analyzer to normalize all terms and add that module to your code path. Otherwise, your best bet is to probably normalize in your application.
Looking at your data it seems like you may be using Search as a secondary index method. You should know that in 1.0 Riak now has native secondary index support which may fit your problem better. -Ryan [1]: http://wiki.basho.com/Riak-Search---Schema.html#Analyzers 2011/9/15 Antonio Fernández Vara <[email protected]> > Hi all, > > I'm performing queries to an index using riak client, indexing data from > models for a new Rails app. Making the first tests on the search I have > found that those queries must match the case that was used. > > Is there some option for make the queries indiferent of the case? Or, must > I take care of case indexing? (just downcase them or whatever) I saw at the > source code for search and just the options are for format of answer, sort, > start row and number of rows. > > > Just a sample I'm telling: > > ruby-1.9.2-p136 :049 > client.search("users", "name:ant*") > => {"responseHeader"=>{"status"=>0, "QTime"=>6, > "params"=>{"q"=>"name:ant*", "q.op"=>"or", "filter"=>"", "wt"=>"json"}}, > "response"=>{"numFound"=>0, "start"=>0, "maxScore"=>"0.0", "docs"=>[]}} > ruby-1.9.2-p136 :050 > client.search("users", "name:Ant*") > => {"responseHeader"=>{"status"=>0, "QTime"=>6, > "params"=>{"q"=>"name:Ant*", "q.op"=>"or", "filter"=>"", "df"=>"value", > "wt"=>"json", "version"=>"1.1", "rows"=>1}}, "response"=>{"numFound"=>1, > "start"=>0, "maxScore"=>"0.00000e+0", "docs"=>[{"id"=>"1326d69a3bb001001", > "index"=>"users", "fields"=>{"name"=>"Antonio Fernández", > "slug"=>"antonio-fernandez"}, "props"=>{}}]}} > ruby-1.9.2-p136 :051 > > > > Also there is another question, since look for keys in buckets is just a > mistake, it could be nice to be able to query all the objects from an index, > just I could using 2 letters and * as minimum. (I used sunspot gem that > works with solr and without any query term it allows you to get all the > results. not sure is there is an option for that here) > > Thank you in advance, > > Antonio > > _______________________________________________ > riak-users mailing list > [email protected] > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > >
_______________________________________________ riak-users mailing list [email protected] http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
