Skip to content

Instantly share code, notes, and snippets.

@valencik
Created May 6, 2019 16:46
Show Gist options
  • Save valencik/d2717b09a399f87616f4bc179b6ef246 to your computer and use it in GitHub Desktop.
Save valencik/d2717b09a399f87616f4bc179b6ef246 to your computer and use it in GitHub Desktop.
# Previously Seen Queries
- can i cancel a refund
- how can i cancel an order
- cancel my account
- can i dropship using paypal
- paypal payments
- paypal providers
## Prefix search
Input: "can"
Output: ["cancel my account", "can i cancel a refund", "can i dropship using paypal"]
Input: "cancel"
Output: ["cancel my account"]
Input: "dropship"
Output: []
## Add black list
No 'paypal' queries allowed:
Input: "can"
Output: ["cancel my account", "can i cancel a refund"]
## Add keyword search
A keyword can appear anywhere in the query
Input: "cancel"
Output: ["cancel my account", "can i cancel a refund", "how can i cancel an order"]
Input: "can"
Output: ["can i cancel a refund", "how can i cancel an order"]
## Rank prefix matches higher
Both prefix and keyword search should be performed, with prefix ranking higher
Input: "cancel"
Output: ["cancel my account", "can i cancel a refund", "how can i cancel an order"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment