In solr which kind of searches are better (performance-wise) ? Autocomplete with EdgeNGram or wildcard searches?

StackOverflow https://stackoverflow.com/questions/15494012

  •  24-03-2022
  •  | 
  •  

Question

I have a data set of around 40k rows with each row having 4 fields. Now I want to use an autocomplete mechanism for these 4 fields in textbox (Have to concatenate the values in these 4 fields into one string before showing a suggestion). Which kind of queries would scale and perform better? Autocomplete on EdgeNGrams or wildcard searches on simple text indexes.

Was it helpful?

Solution

Now I want to use an autocomplete mechanism for these 4 fields in textbox
- Use copyfield to dump all the four fields into a single field and use that field for Autosuggest

Have to concatenate the values in these 4 fields into one string before showing a suggestion
- Keep the values as stored and the Concatenation can be done at client side.

Autocomplete on EdgeNGrams or wildcard searches on simple text indexes.
- EdgeNGrams is mostly index time and would provide faster search results, with an increased indexing time and index size
- Wildcards queries are slower, but would depend on the index size if its too small may not impact the performance much. Note - No Anaylsis is performed for wildcard queries.
- you can consider Solr terms for autosuggest. With Solr terms you would not get the original fields back but just the results but would be faster
- Also check Solr suggester

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top