

This is especially useful to avoid round-trip network latencies incurred otherwise if each of these requests are sent in separate HTTP requests. You can send multiple search requests in a single HTTP request, using the Multi-Search feature.

You'd typically want to generate a scoped API key with this parameter embedded and use that API key to perform the search, so it's automatically applied and can't be changed at search time. Page * per_page should be less than this number for the search request to return results. Maximum number of hits that can be fetched from the collection. Eg: to hide records with IDs 123 and 456, you'd specify 123,456. Overrides are applied first, followed by pinned_hits and finally hidden_hits.Ī list of records to unconditionally hide from search results.Ī comma separated list of record_ids to hide. You could also use the Overrides feature to override search results based on rules. Eg: to include a record with ID 123 at Position 1 and another record with ID 456 at Position 5, you'd specify 123:1,456:5. If the number of results found for a specific query is less than this number, Typesense will attempt to look for tokens with more typos until enough results are found.Ī list of records to unconditionally include in the search results at specific positions.Īn example use case would be to feature or promote certain items on the top of search results.Ī comma separated list of record_id:hit_position. Set drop_tokens_threshold to 0 to disable dropping of tokens. Tokens that have the least individual hits are dropped first. If the number of results found for a specific query is less than this number, Typesense will attempt to drop the tokens in the query until enough results are found. The end tag used for the highlighted snippets.įield values under this length will be fully highlighted, instead of showing a snippet of relevant portion. Separate multiple conditions with the & operator.įor eg: num_employees:>100 & country: Get numeric values between a min and max value, using the range operator You can also filter using multiple values: category:=. To match a string field exactly, you have to mark the field as a facet and use the := operator.įor eg: category:=Shoe will match documents from the category shoes and not from a category like shoe rack. This is necessary for building autocomplete and instant search interfaces.įilter conditions for refining your search results.Ī field can be matched against one or more values. For eg: query_by_weights: 1,1,2 with query_by: field_a,field_b,field_c will give equal weightage to field_a and field_b, and will give twice the weightage to field_c comparatively.īoolean field to indicate that the last word in the query should be treated as a prefix, and not as a whole word. Separate each weight with a comma, in the same order as the query_by fields.

This can be used to boost fields in priority, when looking for matches. The relative weight to give each query_by field when ranking results. So, in the example above, documents that match on the company_name field are ranked above documents matched on the country field. The order of the fields is important: a record that matches on a field earlier in the list is considered more relevant than a record matched on a field later in the list. Separate multiple fields with a comma: company_name, country One or more string / string fields that should be queried against. When excluding values (not-in query), use: 'q':'-value1 -value2','query_by':'field'. This is typically useful when used in conjunction with filter_by.įor example, to return all documents that match a filter, use: q=*&filter_by=num_employees:10. Use * as the search string to return all documents. The query text to search for in the collection. GET $/collections/:collection/documents/search # Arguments Parameter
