I have a situation where it would be beneficial to issue queries in a filter that is called during analysis. In a nutshell, I have an index of places that includes possible abbreviations. And I want to query this index during analysis to convert user-entered places to "standardized" places. So if someone enters "Chicago, IL" into a "place" field, I want to write a filter that first issues a query on "IL" to find that the standardized name for IL is Illinois, and then issues a query on places named "Chicago" located in "Illinois" to find that the standardized name is "Chicago, Cook, Illinois", and then returns this string in a token.
I've tried having the filter factory implement SolrCoreAware, but that isn't allowed for filter factories. I've considered calling SolrCore.getSolrCore(), but this function has been deprecated with a comment that "if you are using multiple cores, this is not a function to use", and I'd like to use multiple cores someday. I looked at MultiCore.java but couldn't find a way to return a specific core. Any ideas? I could issue the queries to standardize the place fields in each document before indexing it, and then send SOLR documents with pre-standardized place fields, but it would sure be more convenient (and probably better-performing) to issue the queries during analysis. I'd appreciate suggestions! --dallan