Hi
am doing an advance search in which there are 8 search fields. for e.g surname, age, village, gender, occupation, city, education and all data is in the same table. so user can enter any number of fields and he can search. its an "or" condition so he can enter a minimum of one field and can search. i used the below code but it is not giving me the exact results
return '{"$or":[{"Surname":{"$regex":"'+value1+'", "$options":"i"}},{"village":{"$regex":"'+value4+'", "$options":"i"}},{"city":{"$regex":"'+value5+'", "$options":"i"}},{"Blood_Group":{"$regex":"'+value6+'", "$options":"i"}},{"occupation":{"$regex":"'+value7+'", "$options":"i"}},{"education":{"$regex":"'+value8+'", "$options":"i"}},{"Gender":{"$regex":"'+value9+'", "$options":"i"}}]}';
am struggling from many days but i am unable to find a solution for this so please help me.