typesense / typesense

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences

Home Page:https://typesense.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Optimizing Query Suggestions

aliml92 opened this issue · comments

Description

I have a use case for optimizing query suggestions for a Typesense UI implementation, as outlined in the documentation Query Suggesstions:

If you still have a requirement to implement drop-down-style query suggestions, you can still do this with Typesense. You can send the search queries to your primary collection that has all your data, but when displaying the results in the UI, you can pick one field from your document to show users in a dropdown format. So this would primarily be a UI treatment.

Let's say, for example, I'm currently retrieving highlighted results for the product_name field from my products collection, like this:

"NEW Tie Dye Girls <mark>Hood</mark>ed <mark>Hood</mark>ie Long Sleeve Thin Sweat Shirt"

However, I aim to provide more concise and user-friendly query suggestions in the UI, like Hooded Hoodie Shirt or Hoodie Sweat Shirt. It seems like a Natural Language Processing (NLP) model could help extract key phrases from these longer texts to achieve this goal.

I'm looking for suggestions and guidance on how to implement an NLP-based solution to extract relevant key phrases from the product_name field to generate shorter and more effective query suggestions for the Typesense UI. Any insights or recommendations would be greatly appreciated!

Metadata

Version: 0.25.1

OS: Ubuntu 22.04

You can just prompt an LLM like ChatGPT to do this. A prompt like this might work:

Given the following product title, suggest 3 queries that a user might make when searching for this product on a ecommerce app:

NEW Tie Dye Girls <mark>Hood</mark>ed <mark>Hood</mark>ie Long Sleeve Thin Sweat Shirt

You've to tweak the prompt to suite your requirements.