Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Course Queries Syllabus Queries 2 years ago
Posted on 16 Aug 2022, this text provides information on Syllabus Queries related to Course Queries. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
I am new with Elastic Search, but have been sitting with this problem for a while now:
What I am trying to achieve is a filtered search with plenty of grouped checkboxes (that are dynamically extracted), such as a group for:
The code I currently have (not all fields included yet):
$query = Contribute::searchByQuery(["query"=> ["query_string"=> ["query"=> "(grade=>'12' OR '10') AND (syllabus=>'IEB') AND (meta_data=>'1')"]]], null, null, $paginate, $page);
The problem I am having, however, is that this would, for example, match a row with the following values:
The solution (which is not feasible, since meta data may expand to thousands of unique ID's) is adding NOT to all other existing terms:
$query = Contribute::searchByQuery(["query"=> ["query_string"=> ["query"=> "(grade=>'12' OR '10' NOT '8' NOT '9' NOT '11') AND (syllabus=>'IEB' NOT 'DOE') AND (meta_data=>'1' NOT '2' NOT '3' NOT '4' etc etc etc.)"]]], null, null, $paginate, $page);
So the question is, how do I exclude any terms, NOT specified, by default? Currently they just include themselves. In a simpler way than the second piece of code where I have to explicitly add what I don't want.
Btw, I build these queries from the user selection, so it is not as static as in these examples. Also, I find it pointless to do a database checkup to see what terms were not included, to be added to the query. Isn't the point of Elastic search to avoid doing db queries?
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Course Queries 4 Answers
Course Queries 5 Answers
Course Queries 1 Answers
Course Queries 3 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.