cancel
Showing results for 
Search instead for 
Did you mean: 

Autocomplete solr

Former Member
0 Kudos

Hi,

Is it possible to change the implementation of the auto complete as follows:?

  •  When inserting letters the autocomplete occurs only on the properties p1, p2 and p3.
    
    
  •  When inserting numbers the autocomplete occurs only on the properties p4, p5 and p6.
    
    

Knowing that p1, p2, p3, p4, p5 and p6 are properties of SolrIndexedType.

Best regards

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

This is possible with customisation.

  • Add to SolrIndexedProperty flag or enum identifying if its valid for alpha / numeric autocomplete
  • Somewhere in the request chain (probably a point cut or wrapper around ProductSearchAutocompleteService) you'll need to to inspect the query string and decided if its an Alpha/Numeric of Both. Store it in a ThreadLocal using the ThreadContextService.
  • Extend DefaultSolrAutoSuggestService and override checkIfIndexPropertyQualifies to inspect the ThreadContext to find out the type of request and then compare if the passed SolrIndexedProperty supports that type of autosuggest.
  • Replace the standard DefaultSolrAutoSuggestService with your overridden version using spring bean aliasing.
ian_matthias
Associate
Associate
0 Kudos

Could you perhaps provide an example of what you are trying to solve here?