Does anyone have a good way to setup a search feature within a course? I know that the Files tab has a search feature, but I'm looking more for content pages than files. Here is the scenario. We have a curriculum course with hundreds of pages of resources organized by grade level and subject. A teacher can click through a series of buttons to browse to their desired resource, but the curriculum department wants teaches to be able to search for say "Poetry" and find all the pages on poetry. I know this is not a built in feature, and I know I can submit a feature request, but I'm looking for an external tool or some other work around/clever idea that would let me do this in the short term.
Ideas I have thought of:
-Create an index page that lists all pages in a table of contents and use the browser search command on that page to locate a page. (downside -- hard to keep up as pages are added over time).
-Make sure pages are named with a clear naming convention and open the pages tab and use the browser search command on that page to locate a page. (downside -- when many pages are present, not all appear until you scroll, so you would not be able to search the ones that do not yet appear on the page using the browser search).
I don't think either of these ideas are particularly good, so I'm hoping that someone out there has an amazing idea for how to do this!
Thanks in advance!
ANOTHER THOUGHT: Is it possible to use Google Site Search somehow? I googled this, but couldn't find an answer. 😉
Message was edited by: Michelle Lattke
Solved! Go to Solution.
@mlattke , no answer yet, but I've noticed that
@G_Petruzella , more to report:
1. CSE on my entire site also works.
2. Got CSE to work on one course
3. CSE still doesn't work on other courses
I have NO idea what is causing it to work on one course and not the other.....
-Did nothing different on the CSE setup
-Tried setting both courses up to have same public/privacy settings in Canvas
Here is a screenshot of one that works and one that doesn't.
CLASS THAT WORKED:
CLASS THAT DOESN'T WORK:
The code that is currently in my search.html file is:
<p style="color: grey;">All results will open in a new tab or window.</p>
var cx = 'your search engine ID goes here';
var gcse = document.createElement('script');
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script');
I hope you find this useful until we get search functionality in courses themselves. Just a note that only the pages and announcements areas appear to be searchable via GCS, or at least that is what I am finding, which totally makes sense. I also believe that your course has to be public for Google to crawl it, which also takes some time to occur on new pages. You can change the behavior of the custom search script through your GCS management console.
I love what you have done to embed the search. Your solution is perfect and I wanted to add "Search" to the sidebar using the Redirect. How were you able to get the redirect to open the search.html file you have uploaded to the course? I.e. how do I get the URL to enter into the Redirect plugin.
Thanks for the great solution!
It is a two step process after you have created the html file and uploaded it to your course files area.
If all is well with the world, your search link will show up in the left nav bar 🙂
Thanks Randy! That worked. Just for the record, I am adding this to a course I have on the Instructure hosted instance of Canvas. Initially my searches kept returning 'No results'. I then requested Google to search my course using this site and then it worked:
Also, Randy, I am not sure if you preferred to have your results open in a separate window or not. But I wanted to have the search result links open in the same window. I was able to get that by adding the linkTarget attribute in my search.html like so:
Glad it worked Naren! Thanks for the tip on the results, I hadn't even looked for a solution so you saved me some time 🙂
I'm not sure what the problem might be. I tried creating some general search engines (erau.instructure.com, .com/*, etc) and would get no results. I tried it before asking Google to search, and afterwards (thanks to Naren's idea). No difference.
I put the search.html into the Files of a course template, created a Module item, linked to search with FILE, and when I run the search it finds a lot of the "out there in the wide world" items (well, 15 of them with the word "network" in canvas pages, that is), but nothing in the course itself. IN FACT... the only site I see is canvas.uw.edu and subpages...
Could there be something that my school's site administrator has done that blocks this google search engine from looking internally?
Does your search work by itself? As in, if you ran your search.html without embedding in Canvas, does it work?
I am guessing it is not, because it sounds like you are having trouble with the indexing part where Google creates your custom search engine.
You may be right in thinking this may be an issue with the site admin settings. Also when I was trying this, it only works if the course was set to be public - Google can't see the lessons if there is a password.
Ultimately I gave up on this - our course needed a password, and also the way Google was doing this was a bit mysterious. I ended up writing my own search engine for the course.
Mike, if your search.html file is configured correctly and you have a Google Custom Search ID, your results should only contain items from your course. In the course that I shared when I created the scenario above, I just did a search for the term "Jing" and got 17 results. All results were from this course, with the obligatory ads at the top of the results list. As I pointed out and @naren_salem pointed out, the search only works if your course is public. If it isn't public Google can't crawl it and maybe we can get @naren_salem to tell us about the custom search tool he wrote for his course.