Dictionary based stemming#2062
Conversation
|
@krunal1313 @kishorenc thanks, it is really valuable feature for our use case. I see that POST endpoint works as "upsert", but in case I need to not only add new word to the list, but remove as well, what is the process? |
|
Is there a reason you can't call |
Hello,@kishorenc. I couldn't fine the DELETE method by testing, I checked the openapi spec and I couldn't find the DELETE method for stemming dictionary as well. Is it missing or I'm missing something? Thank you in advance. |
|
Ugh, looks like we implemented this but forgot to hook it up in the routes. I will get you a fixed build once this is addressed soon. |
Change Summary
adding dictionary via end-point
To add plurals, we need to import jsonl file to end-point
/stemming/dictionaries/importvia POST request like below,Here
idis dictionary name we want to store.jsonl file should contain plurals in below format
{"word": "meetings", "root":"meeting"} {"word": "people", "root":"person"} {"word": "attentions", "root":"attention"} {"word": "leathers", "root":"leather"} {"word": "qualities", "root":"quality"}get specific dictionary
To get the stored dictionary, we need to request via GET request to end-point
/stemming/dictionaries/:idlike below,Here
set1is the id of dictionary given while storing the dictionary. We will get the response like below.{"id":"set1","words":[{"root":"attention","word":"attentions"},{"root":"quality","word":"qualities"},{"root":"leather","word":"leathers"},{"root":"person","word":"people"},{"root":"meeting","word":"meetings"}]}get all stored dictionaries
To fetch all dictionary sets stored on typesense server, we need to send a GET request to end-point
/stemming/dictionarieslike below,Which will respond in below format,
{"dictionaries":["set1"]}using the dictionary with collection search
We need to specify dictionary name while creating collection in order to use with searches in collection.
Here's how it can be created,
Here
stem_dictionaryparam specifies which dictionary to use for normalizing words while searching.PR Checklist