Hi Rick, Thanks for your response. The reason that we do it like this is that the localities are also part of another indexed field that contains the entire address. We actually do the search over that field, and we are only using the highlighting on the problematic field so that we can tell which parts of the address that we matched to. We never search for wildcards like "*cannum*".
As an example, we might have an address that we index which is "19 some st cannum vic 3456". When we index the address, we actually index the text "19 some st lcx__balmoral__cannum__clear_lake__lower_norton vic 3456" into a Solr field that has our custom synonym filter. This then causes the synonyms for the locality "cannum" to be generated, and if we search for "19 some st balmoral" we will still get a match on the locality component of the address. Using this method, the searching for addresses is working fine. We have a requirement once we have a match to know which part of the address that we matched to, which is where the highlighting comes in. By loading just the locality part of the address into a separate field and applying the same synonym filter, through the highlighting we can see if we get a hit on the locality. We do this with the other components of the address, like the number, the street name, the street type, the post code etc. so that we can return to the caller what bits of their input matched to the address we are returning. I could load them as a multi-valued field for just the highlighting, but that means I need to extract them in a different format to what I am using for the whole address which I would like to avoid if possible. We are loading these addresses from a database table using the data import handler. Regards, David David Howe Java Domain Architect Postal Systems Level 16, 111 Bourke Street Melbourne VIC 3000 T 0391067904 M 0424036591 E david.h...@auspost.com.au W auspost.com.au W startrack.com.au Australia Post is committed to providing our customers with excellent service. If we can assist you in any way please telephone 13 13 18 or visit our website. The information contained in this email communication may be proprietary, confidential or legally professionally privileged. It is intended exclusively for the individual or entity to which it is addressed. You should only read, disclose, re-transmit, copy, distribute, act in reliance on or commercialise the information if you are authorised to do so. Australia Post does not represent, warrant or guarantee that the integrity of this email communication has been maintained nor that the communication is free of errors, virus or interference. If you are not the addressee or intended recipient please notify us by replying direct to the sender and then destroy any electronic or paper copy of this message. Any views expressed in this email communication are taken to be those of the individual sender, except where the sender specifically attributes those views to Australia Post and is authorised to do so. Please consider the environment before printing this email.