GithubHelp home page GithubHelp logo

wikiindex's Introduction

wikiindex

A simple Clojure webservice for searching Wikimedia XML abstracts.

Try it online at https://wikiindex.herokuapp.com

The problem

WikiMedia publishes an XML abstract of their articles at: http://dumps.wikimedia.org/enwiki/latest/enwiki-latest-abstract23.xml

We want to be able to search on the <title> and <abstract> from each abstract in the XML dump.

This search is exposed over an endpoint at: http://localhost:5000/search?q=SearchTerm

The search results will contain the <title>, <abstract> and <url>:

{
 "q":"manchester",
 "results":[
 {
 "title":"Wikipedia: Manchester City",
 "url":"http:\/\/en.wikipedia.org\/wiki\/Manchester_City",
 "abstract":"City in north west England"
 }
 ]
}

Constraints:

  • Search on single word
  • Any doc without a title and abstract can be rejected
  • Return an empty string if the url is missing
  • There is no need to index the additional links and sublinks in the XML data

Usage

To run locally:

lein run
open http://localhost:5000

You can optionally set the port and search results limit:

PORT=5001 SEARCH_RESULTS_LIMIT=2 lein run
open http://localhost:5001

Contributing

To start the app in dev mode run the develop.sh script.

Our architectural decisions have been recorded

CI and automatic deployment by Snap-CI: https://snap-ci.com/joejag/wikiindex/branch/master

wikiindex's People

Contributors

joejag avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.