so solr query implemented in 2 parts,first query exact search if there no results found exact goes second query fuzzy search. every things works fine in situations like-->a user enters "burg +" in exact search no records come,so second query called fuzzy search.now comes problem fuzzy query not understand special characters +,-* throws , error.if dont pass special characters works fine. in real world user can put characters search,which throw error. iam stuck in , dont know how resolve issue. how exact search query looks like
$query1="(business_name:$data*^100 or city_name:$data*^1 or locality_name:$data*^6 or business_search_tag_name:$data*^8 or type_name:$data*^7) , (business_active_flag:1) , (business_visible_flag:1) , (delete_status_businessmasters:0)";
this how fuzzy query looks like
$query2='(_query_:%20"{!complexphrase%20qf=business_name^100+type_name^0.4+locality_name^6%27}%20'.$url_new.')and(business_active_flag:1)and(business_point:[1.5 2.0])&q.op=and&wt=json&indent=true';
this error iam getting
cannot parse ' must~1 *~n': '*' or '?' not allowed first character in wildcardquery
iam new solr , dont know how tackle situation.
details of iam using
solrphpclient
php
solr 4.9
ok see using solrphpclient.you need make changes in service.php file these special characters replaced either blank or ever want. take care of problem facing
$params=str_replace("%", "", $params); $params=str_replace("*", "", $params); $params=str_replace("&", "", $params);
you need put in search function or inside custom function assume using fuzzy query
Comments
Post a Comment