ChiSao Posted April 27, 2010 Posted April 27, 2010 Hi, I need to script a search function. There are 3 tables: articles (12'000 records) categories --< keywords (one to many relation) Now the user could choose a category and then the script should perform a search on the articles table with the keywords from the relationship. Unfortunately I don't know how to do this thx for any ideas by ChiSao
ChiSao Posted April 28, 2010 Author Posted April 28, 2010 My idee was to get the portal records in to an array (variable) an then use this as a search string. Unfortunately I don't know how to get the portal records in to one variable.
ChiSao Posted April 28, 2010 Author Posted April 28, 2010 yeah that works, thxs but now I realize that I can't use it directly as a search string. I would like to do the following: $$searchstring= hand, shoulder, ellbow Search in table "articles" in field "keywords" for hand OR shoulder OR ellbow Is it possible without a loop?
comment Posted April 28, 2010 Posted April 28, 2010 No, you must have a loop to create a request for each keyword in the list - something like: Set Variable [ $searchValues ; List ( Keywords::Keyword ) ] # Go to Layout [ Articles ] Enter Find Mode [ ] Loop Set Field [ Articles::Keywords ; GetValue ( $searchValues ; Get ( RequestCount ) ) ] Exit Loop If [ Get ( RequestCount ) ≥ ValueCount ( $searchValues ) ] New Record/Request End Loop # Perform Find [ ]
ChiSao Posted April 28, 2010 Author Posted April 28, 2010 I don't know how to thank you! It works great. THANK YOU! by ChiSao
Recommended Posts
This topic is 5322 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now