This may be more of a lucene question but I was hoping some H-Search experts might be able to help out.
My problem is best explained with an example. Let's say I have a Movie entity with title and description that I'm doing a text search on. But this entity has a collection of name/value pair attributes like this:
genre: mystery
minutesLength: 120
yearMade: 2001
And the code is something like this:
Code:
public class Movie {
String title;
String description
List<Attr> attrs
...
}
public class Attr {
String name;
String value;
...
}
So, let's say I run a search on movies with the word "war" in the title, but I want to sort by the length of the movie. The problem is, the length value is stored in a collection and in a field that also has other values both text and numeric. So, if I try to sort on the lucene field attrs.value I'm not sure what will happen since, for the given document, attrs.value would have values of "mystery", "120" and "2001".
Is it even possible to sort on a collection like this? Is there some kind of advanced indexing I can do to "manufacture" a sort field based on the structure above?
I appreciate any guidance.
-JF