Alex, Here's what you asked in your original email, and why I mentioned OR: "Can it be done all at once in just 1 search query? or should I compile results from 3 queries?"
These documents indicate that the default sort is descending relevancy score: * https://wiki.apache.org/solr/SolrRelevancyFAQ#Why_are_search_results_returned_in_the_order_they_are.3F * https://wiki.apache.org/solr/CommonQueryParameters#sort The relevancy FAQ link I provided has useful information and links to other documents that should be able to give you more information about what kinds of sorting you can do. -- Luke Bakken Engineer lbak...@basho.com On Wed, May 25, 2016 at 9:33 AM, Alex De la rosa <alex.rosa....@gmail.com> wrote: > Hi Luke, > > That was not the question... I know that I can use ORs, etc... I wanted to > know how to sort them by relevancy or higher equality score. > > Thanks, > Alex > > On Wed, May 25, 2016 at 8:08 PM, Luke Bakken <lbak...@basho.com> wrote: >> >> Hi Alex, >> >> You can use the HTTP search endpoint to see what information Riak >> returns for Solr queries as well as to try out queries: >> https://docs.basho.com/riak/kv/2.1.4/developing/usage/search/#querying >> >> Since you're indexing first and last name, I'm not sure what indexing >> a full name buys you on top of that. >> >> It should be possible to combine your queries using OR. >> >> More info about Solr ranking can be found online (such as >> https://wiki.apache.org/solr/SolrRelevancyFAQ). >> >> -- >> Luke Bakken >> Engineer >> lbak...@basho.com >> >> >> On Wed, May 18, 2016 at 10:07 AM, Alex De la rosa >> <alex.rosa....@gmail.com> wrote: >> > Hi all, >> > >> > I would like to perform a search on Riak/Solr of people given an input >> > containing its full name (or part of it), like when searching for >> > members in >> > Facebook's search bar. >> > >> > search input [ alex garcia ] >> > >> > results = client.fulltext_search('people', 'firstname_register:*alex* OR >> > lastname_register:*garcia*') >> > >> > this would give me members like: >> > >> > alex garcia >> > alexis garcia >> > alex fernandez >> > jose garcia >> > >> > Is there any way to get these results ranked/ordered by the most precise >> > search? "alex garcia" would be the most relevant because matches equally >> > to >> > the search input... "alexis garcia" may come second as even not an exact >> > match is very similar pattern, the other two would come after as they >> > match >> > only 1 of the 2 search parameters. >> > >> > Would it be convenient to index also fullname_register:alex garcia in >> > order >> > to find exact matches too? >> > >> > Can it be done all at once in just 1 search query? or should I compile >> > results from 3 queries? >> > >> > result_1 = client.fulltext_search('people', 'fullname_register:alex >> > garcia') >> > result_2 = client.fulltext_search('people', 'firstname_register:*alex* >> > AND >> > lastname_register:*garcia*') >> > result_3 = client.fulltext_search('people', 'firstname_register:*alex* >> > OR >> > lastname_register:*garcia*') >> > >> > Thanks and Best Regards, >> > Alex >> > >> > _______________________________________________ >> > riak-users mailing list >> > riak-users@lists.basho.com >> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com >> > > > _______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com