I'm new with Lucene and am having some issues with making a string field searchable within a range.
So, I have a document that consists of a couple of string fields. One of which is a version which ca have the forms
1.0, 1.1, 1.0-RC1... i.e. Major.Minor(-RCX)
The version strings have a backing java class (Version) which implements Comparable.
My analyzer is a Analyzer wrapper which is a LowerCase and WhiteSpace analyzer, similar to the built in ones. I do searches with the classic query parser. Searches on exact terms work fine.
What I want to be able to do is this:
query: "version:[1.0-RC1 TO 1.5]" - list all document matching versions between and including the two values
and
psuedoquery: "someField:value AND version:latest" - list all document with someField = value having the latest version
What I tried to do is to convert my version string to an int before indexing, but the query input needs to be converted somehow, so that version string becomes and int before searching.I also experimented with IntPoint with three dimensions but came nowhere with it.
It looks like I have to implement a custom analyzer for the version field, but I'm having problems finding similar examples.
If anyone could point me in the right direction that would be great!
Thanks!