Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(search): clarify wildcard operator in search API #302

Merged
merged 2 commits into from
Mar 12, 2025

Conversation

tharropoulos
Copy link
Collaborator

Change Summary

  • Add explicit mention that * is called the wildcard operator in query parameter

PR Checklist

- Add explicit mention that `*` is a wildcard operator in query parameter
@tharropoulos tharropoulos requested a review from kishorenc March 11, 2025 09:57
@@ -208,7 +208,7 @@ When a `string[]` field is queried, the `highlights` structure will include the

| Parameter | Required | Description |
|:---------------------|:---------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| q | yes | The query text to search for in the collection.<br><br>Use `*` as the search string to return all documents. This is typically useful when used in conjunction with `filter_by`.<br><br>For example, to return all documents that match a filter, use:`q=*&filter_by=num_employees:10`.<br><br> Surround words with double quotes to do an exact phrase search. Eg: Setting `q` to `"tennis ball"` (including the surrounding double quotes) will only return documents that have those two words in that exact order, without any typo tolerance. <br><br>To exclude words in your query explicitly, prefix the word with the `-` operator, e.g. `q: 'electric car -tesla'`. |
| q | yes | The query text to search for in the collection.<br><br>Use `*` (wildcard operator) as the search string to return all documents. This is typically useful when used in conjunction with `filter_by`.<br><br>For example, to return all documents that match a filter, use:`q=*&filter_by=num_employees:10`.<br><br> Surround words with double quotes to do an exact phrase search. Eg: Setting `q` to `"tennis ball"` (including the surrounding double quotes) will only return documents that have those two words in that exact order, without any typo tolerance. <br><br>To exclude words in your query explicitly, prefix the word with the `-` operator, e.g. `q: 'electric car -tesla'`. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's reword this to:

Use `q: "*"` (wildcard operator) as the search string...

That way it's clear that you can't use * somewhere in the middle of a keyword like in a regex.

@tharropoulos tharropoulos requested a review from jasonbosco March 12, 2025 09:26
@jasonbosco jasonbosco merged commit 2b1fb57 into typesense:master Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants