Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper search indexing in-page text #150

Open
harry-wood opened this issue Dec 10, 2013 · 5 comments
Open

Proper search indexing in-page text #150

harry-wood opened this issue Dec 10, 2013 · 5 comments
Labels

Comments

@harry-wood
Copy link
Contributor

Currently the search on LearnOSM.org is jquery Autocomplete with only the chapter headings loaded in (More info on this old issue) Not a massive priority, but maybe somebody fancies thinking about how this can improved to match on text within the chapters, which will involve implementing it completely differently.

For bonus points we should note that learnosm.org has "proper" content pages, and also a number of links to google docs at the moment. I guess ideally those might be indexed too.

We could run a proper indexed search system such as "lucene", but I don't know how easy it is to set-up or what would run better on this server.

Serverless solutions including embedding google search or the less evil duckduckgo

@CloCkWeRX
Copy link
Contributor

Elasticsearch is pretty easy to set up - for example; https://github.com/elasticsearch/cookbook-elasticsearch

http://www.elasticsearchtutorial.com/elasticsearch-in-5-minutes.html#Indexing is how you can use it.

Plugins like https://github.com/codelibs/elasticsearch-river-web make it easy to index sites.

As you say, the quickest solution may be embedded google though

@CloCkWeRX
Copy link
Contributor

Just made a google custom search engine; under these terms:
https://support.google.com/customsearch/answer/1714300

Embed code:

<script>
  (function() {
    var cx = '013113174346174561421:rf_zkfu3yv0';
    var gcse = document.createElement('script');
    gcse.type = 'text/javascript';
    gcse.async = true;
    gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
        '//www.google.com/cse/cse.js?cx=' + cx;
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(gcse, s);
  })();
</script>
<gcse:search></gcse:search>

Styling details:
https://developers.google.com/custom-search/docs/element

@CloCkWeRX
Copy link
Contributor

image

image

and results open in a new tab.

@bgirardot
Copy link
Contributor

One thing to note about search terms and using external 3rd party searching, especially google, is that our new stats software, piwik, might not get search terms information in that case.

@Nick-Tallguy
Copy link
Collaborator

Just a comment - current search uses the line from the header 'title' and searches on any words in that title:
title: Remote, Armchair or Mapathon editing
will get hits on any of the words remote, armchair or mapathon.
See also #315 which may have a solution outlined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants