AOD Phone Number Search

Forgive me if this has been covered, I was unable to find an answer with the forum search.

How do I search on a partial phone number in AOD search?

In classic search it was as simple as prefacing the partial number with a %.

For example, searching %7103 would find all accounts with phone numbers ending in 7103.

Thanks

Hi,

This is currently a known bug in AOD - the default indexer wont index numbers. A workaround is detailed here AOD index numbers.

This will be addressed on a future version of AOD.

Thanks,
Jim

Thank you for your answer. I looked over the thread you pointed out. I do see that in AOD_Index.php most of the numeric fields are ignored at the end of the case statement. However, I see that the type of “phone” is with the other varchar fields, so this leads me to believe that phone fields should be indexed. Because of this, I am not sure what to do next to make “phone” field types searchable with AOD.

The phone fields will be indexed. However, by default Zend Lucene (which is the library that AOD uses) doesn’t index numbers. This means that if any field has numbers in it those numbers will not be indexed. The fix, detailed at the bottom of the linked thread is to add:

 Zend_Search_Lucene_Analysis_Analyzer::setDefault(new Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum());

This will tell Lucene to index numbers too.

Thanks,
Jim

1 Like