Monday, May 14, 2012

Map field to greater than field in Solr

I'm about to add a feature to my project that will allow users to place a Solr query like...



immigration law citations:50


...which would yield legal documents containing 'immigration' AND 'law' AND a citation count greater than 50.



Internally, I can parse out strings like citations:50 and convert them to citations:[50 TO *], but post-processing the query parser is best avoided if possible.



Seems like there ought to be a way in the schema to say, "When people search on this field, always look for the value the find anything greater."



Anything like that or ideas for how to do this elegantly? I hate query postprocessing in my app. Nasty stuff.





No comments:

Post a Comment