Custom sorting of search results

You have at least two ways of doing this that I can think of off-hand.

  • You could do two searches, one for words starting with b and one for words containing a b but not starting with b, and then iterate through them. (Or use union, or join the lists, or any variant of these.)

  • You could use a conditional expression to add an additional value to the query to represent whether or not the word starts with b, and then sort based on that additional value.

1 Like