How to make suggest.json return phrase in results rather than just single words?

I am using the suggest.json endpoint to return “auto complete” keywords. For example when I search on “int”, it successfully returns:

  • “internal”,
  • “interruption”,
  • “international”,
  • “interruptions” etc

What I want it to also return

  • “internal”,
  • “interruption”,
  • “international”,
  • “interruptions”,
  • “internal communications”,
  • “international buyer opportunities” etc

How can I make it return more than 1 word ? Is it even possible using the suggest.json endpoint or do I have to switch to the search.html endpoint?

I am using FB version 16

1 Like

If you are using spelling based auto-completion you can use the auto-completion.alpha setting to adjust the bias between length and relevancy as shorter suggestions are preferenced.

Configuring this value will depend on how your auto-completion Javascript is called. You may be able to set this as a configuration key in your results page configuration, but only if your Javascript reads this from configuration.

If it doesn’t you can set the alpha value directly in your Javascript configuration for auto-completion: see: Configuring auto-completion :: Squiz DXP Help Center

Hi @plevan

Thanks for your reply. It made some difference but not much.

Results with alpha 0.5 for term "inter:

[
“internal”,
“interruption”,
“international”,
“interruptions”,
“interest”,
“interests”,
“interventions”,
“intervention”,
“internationally”,
“interviews”
]

Results with alpha 1.0 for term "inter:

[
“internal”,
“interruption”,
“international”,
“interruptions”,
“interest”,
“interests”,
“interventions”,
“interested”,
“internationally”,
“interdisciplinary”
]

I am not using any client side code here, all requests are routed through server via the suggest.json endpoint, due to privacy reasons.

https://xxxxxxxx/suggest.json?profile=search&collection=mycollection&partial_query=inter

Also, the documentation needs to be updated.

Documentation says, “alpha” only works when auto-completion.sort=3 but it doesn’t accept a value greater than 2. See “Error” in screenshot above.