Giter Site home page Giter Site logo

autocomplete's Introduction

####
#### Licensed to the Apache Software Foundation (ASF)
#### http://www.apache.org/licenses/LICENSE-2.0
#### See http://www.cominvent.com/?p=576 for instructions
####

AutoComplete example core
=========================
This is an example of how to do advanced super-flexible AutoComplete using a
dedicated Solr core. A blog post detailing the autocomplete technique is found 
at http://www.cominvent.com/?p=576

This code is intended as a template for you to get started. Normally you will copy
the "ac" folder, holding the configuration of the autocomplete core, into your own
multi core SolrHome, but for this simple example we assume that you run it
stand-alone in the provided solr-home.

We assume Linux/Mac/Cygwin, feel free to contribute start script for Windows :)

Quick start
===========
1. Set environment variable JETTY_HOME to your solr/example folder (solr3.x)
   export JETTY_HOME=/home/john/solr-3.5.0/solr/example
2. Start Solr using solr-home
   ./run-solr.sh
3. In another SHELL window, feed the example data (you need curl)
   ./feed-ac.sh
4. Goto http://localhost:8983/solr/ac/browse and start typing.
   The example data is country names and names of large cities from Geonames, and
   they are boosted by population so if you type 'c' you'll see China on top..

Using your own data
===================
Of course you want suggestions for your own data. The easiest is to start with the
exampledata/ac-example.csv file, keep the first line and enter your own data below.
Here is a short description of the columns and how they are configured to work in
Solr's schema.xml:
 id            : Unique id
 textsuggest   : Main text for matching and display
 subtext       : Extra text not being searched but displayed in ()
 extrasearch   : Extra text not being displayed but searched (full words only)
 extradisplay  : Extra text not being searched, for additional display
 type          : You may choose your own types, e.g. Country, City.
                 Each type will be suggested in its own section in the result
 action        : Optional field to give a hint to Ajax comp about what to do
                 when suggestion is clicked, e.g. search, jump-to-url etc
 value         : Optional field to give details about how to execute action
 popularity    : This number gets boosted into the score for relevancy tuning
 thumbnail_url : Example of extra data field to be able to display an image
 phonetic      : If filled, this suggestion will also be matched phonetically

To learn more about how the autoSuggester is built and how to tune further, read 
the blog post at http://www.cominvent.com/?p=576



About the data set
==================
We've used data from Geonames dataset, adapted for this example
Licensed under Creative Commons http://creativecommons.org/licenses/by/3.0/

Country names:
Deducted from http://download.geonames.org/export/dump/countryInfo.txt
We use country ISO code for extra search, Capital city as sub-text, population as
popularity

City names:
Deducted from http://download.geonames.org/export/dump/cities15000.zip, filtered
to cities with population above 100.000
We use the country as sub-text and
population as popularity

Flags:
Flags used in /browse GUI links to http://flags.blogpotato.de/ and are CC-by-sa
licensed

autocomplete's People

Contributors

janhoy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autocomplete's Issues

Missing "/select" requestHandler

Prefix: I'm not a Solr or Java guy - so apologies if this issue turns out to be a non-issue :)

After following the README.txt instructions, I was able to navigate to /solr/ac/browse but the jquery auto-complete plugin wasn't firing. Checking the browser's console log, I could see the problem was that requests to /solr/ac/select kept returning a 404 error.

Adding a "/select" request handler to solr-home/ac/conf/solrconfig.xml solved the problem (note: I am running solr v3.6.0).

Code for request handler is here: http://www.hastebin.com/mivocolebi.xml [ can't work out how to embed it within this comment ]

Compatibility with last SOLR version

This code is crated for SOLR 3.5, but at the moment the actual SOLR version is 6.3. It would be good to have the compatibility with new version of SOLR.

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.