Dallan Quass wrote:
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.
this may sound a bit too KISS - but another approach could be based on synonyms, i.e. if the number of abbreviation is limited and defined ("All US States"), you can simply define complete state name for each abbreviation, this way a "Chicago, IL" will be "translated" (...) in "Chicago, Illinois" during indexing and/or querying... but this may depend by the Tokenizer you use and how your index is defined (do a search for "Chicago, Illinois" on a field gives you a doc with "Chicago, Cook, Illinois" in some (other/same) field?)

have a look here: http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#head-2c461ac74b4ddd82e453dc68fcfc92da77358d46



Reply via email to