Giter Club home page Giter Club logo

clojure-lucene-demo's Introduction

Clojure Lucene Demo

The original reason for writing this code was to create a quick proof-of-concept demonstrating a problem I was having with filters in Lucene. When I added a filter my query returned zero results. As Uwe Schindler pointed out this happened because my code told Lucene to analyze the field, while filters expect a literal value unless you customize them with an analyzer on the query side. Thanks, Uwe!

Now I took the time to write this abstract example of how I use Lucene with Clojure, I'm planning to keep it up as reference for others. That way, the code will serve some purpose now the problem is solved. Of course, any errors or non-idiomatic usage should be fixed by that point. Keep in mind that this is the first Clojure code I'm releasing, only two weeks after first picking up the language, so there might be a few non-idiomatic gotchas lurking around!

Running the code is easy (assuming you have Leiningen installed):

git clone https://github.com/fmw/clojure-lucene-demo.git
cd clojure-lucene-demo
lein test

Check Mark Triggs' Mailindex repository for another example of Lucene code in Clojure. Also, make sure to look at the unit tests, because they provide the best documentation to the code. Feel free to contact me using the email address below in case you have any questions or suggestions.

Copyright 2011, F.M. (Filip) de Waard <[email protected]>. Distributed under the Apache License, version 2 (see the LICENSE file).

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.