Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion docs-site/content/30.0/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ To learn how to install and run Typesense, see the [Guide section](https://types
This release contains important new features, performance improvements and bug fixes.

### New Features

- Support faceting on joined reference field ([Docs](https://typesense.org/docs/30.0/api/search.html#facet-referencing))
- Show related_docs count for a document in joined collection with `include_fields` param [PR#2461] (https://github.com/typesense/typesense/pull/2461)
- Make facet sampling dynamic by adding `facet_sample_slope` param ([Docs](https://typesense.org/docs/30.0/api/search.html#faceting-parameters))
- Support sorting and limit on joined fields with include_fields param([Docs](https://typesense.org/docs/30.0/api/joins.html#Sorting-and-limiting-on-joined-collection-docs))
- Support `group_by` for Union search ([Docs](https://typesense.org/docs/30.0/api/federated-multi-search.html#union-search))


### Enhancements
Expand All @@ -27,6 +31,11 @@ This release contains important new features, performance improvements and bug f
- Add support for Azure OpenAI models in Natural Language Search ([Docs](https://typesense.org/docs/30.0/api/natural-language-search.html#supported-model-types)).
- Add configurable token truncation for string fields to improve exact match filtering on long strings ([Docs](https://typesense.org/docs/30.0/api/collections.html#field-parameters)).
- Add GCP service account authentication for auto-embedding with GCP models ([Docs](https://typesense.org/docs/30.0/api/vector-search.html#service-account-authentication)).
- Use Transliterator objects pool to enhance tokenization performance of cyrilic and chinese langauges [PR#2412] (https://github.com/typesense/typesense/pull/2412)
- Support dynamic `facet_return_parent` fields ([Docs](https://typesense.org/docs/30.0/api/search.html#faceting-parameters))
- Support `pinned_hits` with union search [PR#2422] (https://github.com/typesense/typesense/pull/2422)
- Support altering reference fields [PR#2445] (https://github.com/typesense/typesense/pull/2445)
- Filter our duplicates when using `Union` search with flag `remove_duplicates`. Defaulted to true.

### Bug Fixes
- Fix parsing of `_eval()` expressions when backticks are used to wrap strings containing parentheses.
Expand All @@ -40,6 +49,8 @@ This release contains important new features, performance improvements and bug f
- Set user agent when initializing HTTP client for external API calls.
- Fix hyphen handling in negation searches to only apply special treatment when token starts with `-`.
- Fix query sub-tokenization to respect field-level `symbols_to_index` and `token_separators` configuration.
- Fixed the override matching for wildcard queries, dynamic filter, dynamic sort, and placeholders.
- Fix sort using `_eval()` for `id` fields

### Deprecations / behavior changes

Expand Down
29 changes: 29 additions & 0 deletions docs-site/content/30.0/api/federated-multi-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,35 @@ Since the results of each search are merged into one final result, union differs
}
```
will return an error since the types (`user_name: string`, `rating: float`) are different.
<br><br>
Union search removes duplicates by default. Which can be turned off using flag `remove_duplicates: false`

### Grouping with Union
Union supports `group_by` operations with flag `group_by` params in searches like below,

```curl
curl 'http://localhost:8108/multi_search?page=1&per_page=2' -X POST \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" -d '
{
"union": true,
"searches": [
{
"collection": "posts",
"q": "*",
"filter_by": "user_name:stark_industry",
"group_by": "content",
"group_limit": 2
},
{
"collection": "comments",
"q": "*",
"filter_by": "user_name:rogers_steve",
"group_by": "content"
}
]
}'
```
**NOTE**: Union searches with grouping should be uniform in shape. i.e either all searches should contain grouping params or none of them.

## `multi_search` Parameters

Expand Down
28 changes: 28 additions & 0 deletions docs-site/content/30.0/api/joins.md
Original file line number Diff line number Diff line change
Expand Up @@ -676,3 +676,31 @@ curl -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" -X GET \
```

This will return the book document along with the author's name from the referenced `authors` collection.

## Sorting and limiting on joined collection docs

You can sort and limit the joined collection docs using `sort_by` and `limit` param in `include_fields`.

For example, if you're searching in `authors` collection and including fields from `books` collection, you can sort the docs by `id` like below,

```json
{
"collection": "authors",
"q": "*",
"filter_by": "$books(id:*)",
"include_fields": "$books(*, sort_by: id: desc)"
}
```
Here, the docs will be sorted by their `id` in `desc` order.

Similarly, if you want to limit the docs in referenced collection then you can do it like follwing,

```json
{
"collection": "authors",
"q": "*",
"filter_by": "$books(id:*)",
"include_fields": "$books(*, limit:5)"
}
```
Which will limit the doc count by 5.
Loading