Faceted Searching with Lucene.net and LION

by Jon Davis 6. May 2008 21:06

Two or three months ago I noted that I was planning on adding a nifty new QueryBuilder object as well as add new faceted searching support.


Um, well, we got sidetracked. But the need continued to haunt us, and a co-worker stumbled upon this:


.. which included a sample source file (SimpleFacets.cs) that proved to be a workable solution for us. (Wow. That was easy.)

I have reached the next major milestone for our project for

  • my pretty QueryBuilder object
  • faceted searching on a particular set of fields (my query can optionally specify specific values for facet counting rather than rely on the top scrape)
  • faceted searching on a named subquery (likely very slow [untested] but very powerful)

.. and that milestone is writing the code and making sure that the old application code still runs! I haven't even tested it yet. No, I didn't do TDD, shame, shame, shame!! Problem is, there's just so much code already that is not already bound to TDD unit tests that to refactor for NUnit or VSTS I'll have to really dedicate some time to make it worthwhile to form up a pattern .. and time is something I'm short on here. Then again, I don't have enough time NOT to write tests before writing code, so I'm feeling pretty lame right now.

That said, I did ask my boss a couple months ago if it was okay with him if I could open source LION (Lucene Indexing On .NET), he doesn't have a problem with it, and I'd like more hands in the pot. Everyone at the office is just too dang busy, and when they see it all they can say is, "Wow, that's a lot of code, I thought it was just Lucene.net API calls, you have WCF providers and query wrappers and document structure base classes and everything..." They don't exactly say that with appreciation; they want small chunks of throw-away code scattered everywhere. I have tried to make LION support that, too, but I don't write my implementation code that way so that's not what they see when I show it to them.

Anyway, now that faceting is partially implemented (fully written but untested, bleah) after I write some tests up and debug and everything works as it should I'm going to fork off the core projects and refactor and rename things and then open-source the whole thing. I'm trying to go in the direction of Lucene Solr on this in terms of front-end feature set, but there's a lot of re-thinking and refactoring to do on the service side to ever call it "enterprise class", our needs have been mostly met but others might be able to contribute to the project to help it meet their own custom needs (and hopefully with minimal tweaks).

Currently rated 1.2 by 5 people

  • Currently 1.2/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , ,

Add comment

(Will show your Gravatar icon)  

  Country flag

  • Comment
  • Preview


Powered by BlogEngine.NET
Theme by Mads Kristensen

About the author

Jon Davis (aka "stimpy77") has been a programmer, developer, and consultant for web and Windows software solutions professionally since 1997, with experience ranging from OS and hardware support to DHTML programming to IIS/ASP web apps to Java network programming to Visual Basic applications to C# desktop apps.
Software in all forms is also his sole hobby, whether playing PC games or tinkering with programming them. "I was playing Defender on the Commodore 64," he reminisces, "when I decided at the age of 12 or so that I want to be a computer programmer when I grow up."

Jon was previously employed as a senior .NET developer at a very well-known Internet services company whom you're more likely than not to have directly done business with. However, this blog and all of jondavis.net have no affiliation with, and are not representative of, his former employer in any way.

Contact Me 

Tag cloud


<<  May 2021  >>

View posts in large calendar