Athul
05/05/2025, 11:30 AM{
"q": "iphone16",
"page": "1",
"per_page": "125",
"query_by": "title,category,brand,color",
"exclude_fields": "embedding",
"enable_synonyms": true,
"split_join_tokens": "always"
}
Fanis Tharropoulos
05/05/2025, 11:31 AMsplit_join_tokens
parameter:Athul
05/05/2025, 11:39 AMsplit_join_tokens
in my query!Fanis Tharropoulos
05/05/2025, 11:43 AMAthul
05/05/2025, 11:43 AMFanis Tharropoulos
05/05/2025, 11:44 AMAthul
05/05/2025, 11:49 AMFanis Tharropoulos
05/05/2025, 11:50 AMAthul
05/05/2025, 12:24 PMcurl
queries I used:
curl -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
"<http://localhost:8108/collections/my_store/documents/search?q=iphone%2016&query_by=title,category,brand,color&exclude_fields=embedding&enable_synonyms=true&split_join_tokens=always>"
curl -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
"<http://localhost:8108/collections/my_store/documents/search?q=iphone16&query_by=title,category,brand,color&exclude_fields=embedding&enable_synonyms=true&split_join_tokens=always>"
Kishore Nallan
05/05/2025, 12:45 PMAthul
05/06/2025, 4:23 AMexport TYPESENSE_API_KEY=xyz
curl "<http://localhost:8108/debug>" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}"
curl "<http://localhost:8108/collections>" \
-X POST \
-H "Content-Type: application/json" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
-d '{
"name": "ecommerce_store",
"fields": [
{"facet": false,"index": true,"infix": false,"locale": "","name": "title","optional": true,"sort": false,"stem": true,"stem_dictionary": "","store": true,"type": "string"},
{"facet": true,"index": true,"infix": false,"locale": "","name": "category","optional": true,"sort": false,"stem": true,"stem_dictionary": "","store": true,"type": "string[]"},
{"facet": true,"index": true,"infix": false,"locale": "","name": "brand","optional": true,"sort": false,"stem": true,"stem_dictionary": "","store": true,"type": "string"},
{"facet": false,"index": true,"infix": false,"locale": "","name": "color","optional": true,"sort": false,"stem": true,"stem_dictionary": "","store": true,"type": "string"},
{"facet": false,"index": true,"infix": false,"locale": "","name": "price","optional": true,"sort": true,"stem": false,"stem_dictionary": "","store": true,"type": "float"}
]
}'
curl "<http://localhost:8108/collections/ecommerce_store/documents/import?action=create>" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
-H "Content-Type: text/plain" \
-X POST \
-d '{"id": "124","title": "Apple iPhone 16 128GB - Ultramarine","category": ["phones","apple"],"brand": "apple","color": "ultramarine","price": 999}
{"id": "125","title": "Apple iPhone 16 Plus 256GB - Black","category": ["phones","apple"],"brand": "apple","color": "Black","price": 444}'
Working example:
curl "<http://localhost:8108/multi_search>" \
-X POST \
-H "Content-Type: application/json" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
-d '{
"searches": [
{
"collection": "ecommerce_store",
"q": "iphone 16",
"query_by": "title,category,brand,color"
}
]
}'
This will give empty result :
curl "<http://localhost:8108/multi_search>" \
-X POST \
-H "Content-Type: application/json" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
-d '{
"searches": [
{
"collection": "ecommerce_store",
"q": "iphone16",
"query_by": "title,category,brand,color"
}
]
}'
Kishore Nallan
05/06/2025, 4:48 AM"stem": true
Which will change the query to a form which will NOT trigger the split joins behavior.