Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonbosco committed Apr 12, 2021
1 parent 654d63b commit 4c61dc7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 4 additions & 2 deletions docs-site/content/0.19.0/guide/features/faceting.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Faceting is a way to classify search results into smaller groups based on the attributes in each result. For example, in a dataset of books, after users search for a book title, they'd want to categorize the search results by authors, genre, etc. Similarly, in a movie dataset, users may want to search for movies by first grouping them via actor, director, genre, etc. This subclassification of search results is known as Faceting. Faceting is not to be confused with Filtering, as Filtering provides a way to remove results that don't meet certain criteria, while Faceting provides a way to group results into categories.

In a UI based system, facets can be used to refine search results. For exmaple, in [book search demo](https://books-search.typesense.org/), if you search for an author, you can see facet fields in the left navigation panels. You can use either subject facet or author facet to narrow down your search. It also shows the count for the facet fields. In the image below, you can see that the `Fiction` facet has 408 docuemnts, while `Classics` facet has 363 documents.
In a UI based system, facets can be used to show options to users to help them further refine search results. For example, in our [Book Search Showcase](https://books-search.typesense.org/), if you search for an author, you'll see fields in the left panel giving users the option to further refine their search results by subject or author. It also shows the count for the facet fields. In the image below, you can see that the `Fiction` facet has 408 docuemnts, while `Classics` facet has 363 documents. We were able to categorize and count all the authors and subjects in the result set, by setting authors and subject as facet fields.

![Typesense facet example](~@images/typesense-facet.png)

Expand Down Expand Up @@ -279,7 +279,7 @@ client.collections['books'].documents.search(search_parameters)
</template>
</Tabs>

Smaple response:
Sample response:

```json
{
Expand Down Expand Up @@ -336,3 +336,5 @@ Smaple response:
```

Note the additional `stats` field in the result that shows the avg, min, max and sum value for `ratings_count` field. You can limit the number of faceted results using `max_facet_value` parameter. More details on these arguments can be found [here](../../api/documents.html#arguments).

In summary, we use facets to group results into categories and present them to users. Then users can pick one of those categories as a [filter](./filtering.md).
7 changes: 3 additions & 4 deletions docs-site/content/0.19.0/guide/features/filtering.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Filtering

Filtering is the process of excluding results that don't meet certain criteria. Filtering can help users narrow down their searches and find the most relevant result. For example, in a book dataset, users might be looking for a specific book by an author. They can filter the data with the author's name and limit the number of results they need to look through.
Filtering is the process of excluding results that don't meet certain criteria. Filtering can help users narrow down their searches and find the most relevant result. For example, in a books dataset, users might be looking for a specific book by an author. They can filter the data with the author's name and limit the number of results they need to look through.

Filtering and Faceting can work together in UI based systems. In [book search demo](https://books-search.typesense.org/), if you search for an author, you would see facets on the left navigation panel. The faceted fields in this case are `Subject` and `Authors`. The widget will show the values and count of documents. But once you click on a facet value, a filter would be applied that will exclude the documents that don't meet the condition. In the image below, when we click on `Fiction`, a filter would be applied to the search results.
Filtering and Faceting can work together in UI based systems. In our [Book Search Showcase](https://books-search.typesense.org/), if you search for an author, you would see facets on the left navigation panel. The faceted fields in this case are `Subject` and `Authors`. The widget will show the values and count of documents. But once you click on a facet value, a filter would be applied that will exclude the documents that don't meet the condition. In the image below, when we click on `Fiction`, a filter would be applied to the search results.

![Typesense filter example](~@images/typesense-filter.png)

Expand All @@ -12,7 +12,7 @@ With Typesense, you can add `filter_by` parameter to your search query to filter
<template v-slot:JavaScript>

```javascript
llet searchParameters = {
let searchParameters = {
'q' : 'harry',
'query_by' : 'title',
'filter_by' : 'publication_year:<1998',
Expand Down Expand Up @@ -105,4 +105,3 @@ Here is a sample response:
```
You can also filter results by matching a field with more than one value. More details on the argument can be found [here](../../api/documents.html#arguments).
# Filtering
4 changes: 3 additions & 1 deletion docs-site/content/0.19.0/guide/features/typo-tolerance.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

Typo, short for typographical error, is a mistake made while typing something. A typo is generally an unintentional mistake that can happen due to typing faster or typing on a screen where the keypad is small. However, sometimes your users might not know the exact spelling of the word and they type what they think is an approximation of the exact term, in the hope that the system would understand and bring up the relevant results.

Typesense can handle typos out of the box. It can understand what users are looking for even if there is a mistake in the search query and provide relevant results. Let's see it in action! To follow this example, first [create](../../api/collections.html#create-a-collection) a collection named "companies" and [index](../../api/documents.html#index-a-document) a sample document. Now, let's perform a search (notice the typo!):
Typesense can handle typos out of the box. It can understand what users are looking for even if there is a mistake in the search query and provide relevant results. Let's see it in action!

To follow this example, first [create](../../api/collections.html#create-a-collection) a collection named "companies" and [index](../../api/documents.html#index-a-document) a sample document. Now, let's perform a search (notice the typo!):

<Tabs :tabs="['JavaScript','PHP','Python','Ruby']">
<template v-slot:JavaScript>
Expand Down

0 comments on commit 4c61dc7

Please sign in to comment.