Giter Site home page Giter Site logo

allizad / relevant-search-book-bonsai Goto Github PK

View Code? Open in Web Editor NEW

This project forked from o19s/relevant-search-book

0.0 0.0 0.0 5.4 MB

Code and Examples for Relevant Search - with bonsai.io

Python 2.02% OpenEdge ABL 45.84% Jupyter Notebook 52.14%

relevant-search-book-bonsai's Introduction

Relevant Search

Code and Examples for Relevant Search by Doug Turnbull and John Berryman. Published by Manning Publications.

Relevant Search is all about leveraging Solr and Elasticsearch to build more intelligent search applications with intuitive results!

How to run

Install Python

Examples for this book are written in Python 2.7 and use iPython notebook. The first thing you'll need to do is install Python, pip (the Python package installer).

  1. Install Python for your platform here. For Windows we recommend the ActivePython distribution.
  2. Install pip, the Python installer, by simply running easy_install pip

Install Elasticsearch

The examples expect Elasticsearch to be hosted at localhost:9200. So you'll need to install Elasticsearch to work with the examples. There's two ways to install Elasticsearch

Recommended: Vagrant

Vagrant is a tool for installing and provisioning virtual machines locally for development purposes. If you've never used vagrant, you can follow the installation instructions here. OpenSource Connections maintains a basic Elasticsearch vagrant box here.

To use the vagrant box

  1. Install vagrant

  2. Clone the Elasticsearch vagrant box from Github locally

    git clone [email protected]:o19s/elasticsearch-vagrant.git
    
  3. Provision the Vagrant box (this install Elasticsearch and turns the box on)

    cd elasticsearch-vagrant
    vagrant up --provision
    
  4. Confirm Elasticsearch is running

curl -XGET http://localhost:9200

or visit this URL in your browser.

You should see JSON returned from the Elasticsearch instance. Something like:

   {
     "name" : "Mary Zero",
     "cluster_name" : "elasticsearch",
     "version" : {
       "number" : "2.0.0-rc1",
       "build_hash" : "4757962b01a4d837af282f90df9e1fbdb68b524e",
       "build_timestamp" : "2015-10-01T10:06:08Z",
       "build_snapshot" : false,
       "lucene_version" : "5.2.1"
     },
     "tagline" : "You Know, for Search"
   }
  1. When you're done working with examples, turn off the Vagrant box
vagrant halt

Locally on Your Machine

Follow Elasticsearch's instructions to install Elasticsearch on your machine.

Running The Python Examples

The examples are written in Python 2.7 in ipython notebooks depending only on a few basic libraries. The only external library needed is the requests HTTP library. Some of the external APIs require API keys (for example TMDB, you can obtain one here).

To run the IPython Notebook Examples

  1. First ensure you have git, python 2.7 and pip installed and in your PATH

  2. Then use the following commands to install the required dependencies

git clone [email protected]:o19s/relevant-search-book.git
cd relevant-search-book
pip install requests
pip install jupyter
cd ipython/
  1. Launch!

ipython notebook

  1. Play!

Switch to your default browser where the Ipython examples are ready for you to experiment with. Keep in mind many examples are order dependent, so you can't just jump to an interesting listing and run it. Indexing commands with certain settings and what not need to be run. Be sure to run the prior ipython notebook commands too!

Happy Searching!

relevant-search-book-bonsai's People

Contributors

softwaredoug avatar jnbrymn-eb avatar allizad 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.