Hello,
I am using the WooCommerce addon, but I am encountering an issue when updating a product. The custom fields I have created are not being updated within the cm_tsfwc_data_before_entry
filter.
For example, my implementation looks like this:
public function formatProductData($formatted_data, $raw_data, $object, $schema_name) {
if ('product' !== $schema_name) { return $formatted_data; }
ob_start();
// custom_product_label();
do_action('custom_product_label');
$formatted_data['woodmart_product_label'] = ob_get_clean();
return $formatted_data;
}
add_filter('cm_tsfwc_data_before_entry', [$this, 'formatProductData'], 10, 4);
However, after a product update, my custom fields do not get updated in Typesense. It seems that the cm_tsfwc_data_before_entry
filter is not correctly handling the custom fields during the update process.
Interestingly, when I manually run the following WP-CLI command:
wp typesense index product --ids={productId}
The indexing works correctly, and the custom fields are included as expected.
Could you please provide guidance on how to resolve this issue? Any suggestions would be greatly appreciated.
]]>I am used to building with WP Grid Builder in WooCommerce and using WP Grid Builder to filter my WooCommerce product categories using facets. Can I do this with Typesense, or do I use Typesense to override the default WordPress search field, and then continue to use WP Grid Builder for the facet search?
]]>I found some bugs in plugin, can I contribute to solve them?
]]>Hello – thanks for developing this.
1. I see your instructions about copying templates, but what about css? How do you suggest we override the loading of the themes, and to override the css being applied?
2. To that end, I have everything disabled, using wordpress search page, but still see this asset attempting to load:
>> Refused to apply style from ‘https://env-cpmssub-dev.kinsta.cloud/wp-content/plugins/search-with-typesense/assets/vendor/css/algolia-satellite.min22.css?ver=61e3d5e205d603b7f9da’ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.
—- This should be trying to load assets when a shortcode is used, or the setting to take over wordpress search is true, right?
/nevermind
]]>Hi all, thank you for the plugin. I’m researching the possiblity to implement typesearch in my prototyping to migrate away from FacetWP to Typesense. I have it up-and-running with facets and taxnomies and all. The only thing I can’t seem to manage / change is by checking 2 checkboxes in a facet that the POST does an AND instead of an OR on the taxonomy search query.
This is from the Typesense docs https://typesense.org/docs/27.1/api/search.html#filter-parameters
Because we would like to make the result-set narrower, instead of larger.
Looking forward to building on-top of Typesense.
Kind regards!
Jaime Martinez
]]>Hey guys – how would we go about making post types all be included in one page of the results, rather than as tabs? Currently, by default template, the post types (page, post) as shown as indivudal result areas, rather than sharing the same result schema. I would like to include several different post types, such as article, products, etc, all in the same result area, so user doesnt have to tab across to post types that weren’t really meant for differentiation, but rather for internal uses like url path slugs
]]>Description
Cannot activate the plugin because of error:
This plugin does not work with your version of WordPress.
Running WordPress 6.3.1 (latest).
Steps to reproduce:
Migrated WP site to a new host (WP Engine).
Tried to activate the Search with Typesense plugin.
Cannot activate because of error mentioned above.
Expected Behavior
Expected to be able to activate the plugin.Actual Behavior
Plugin says Cannot Activate.
]]>I’m having problems showing all custom post tabs on a multisite wordpress.
Everything works fine in all the sites for the common post type. Then, on the first wordpress, the tabs appear correctly. However, in the other sites only the first type appear. Config is the same for all.
First site works ok
Other sites, same config and indexes are ok
But custom content tabs here don’t appear:
Hi!
First of all, thank you for developing this wonderful plugin.
I’m trying to create a translation for the plugin, but it seems that some strings used in the facet panel headings (e.g., category, tags) are not translatable. Is there any other way to translate these without hard-coding them with a overide in a child theme?
Thanks in advance
]]>The plugin has an inherent issue since it only supports port-based access. It does not allow route-based use of Typesense, which is an issue.
public function setupClientCredentials(): void {
$settings = Admin::get_default_settings();
$this->node = ( $settings[‘protocol’] . $settings[‘node’] . ‘:’ . $settings[‘port’] . ‘/’ ?? ” );
$this->admin_api_key = $settings[‘admin_api_key’] ?? ”;
$this->debug_enabled = $settings[‘debug_log’] ?? false;
}
Solution: Have adjusted the code to ensure that the port is only included if the node string does not already contain a forward slash.
$this->node = $settings[‘protocol’] . rtrim($settings[‘node’],’/’) . (strpos($settings[‘node’], ‘/’) !== false ? ” : ‘:’ . $settings[‘port’]) . ‘/’;
]]>Seems like the plugin is not creating the necessary collection? When I retrieve all collections on my cluster, I get only my (unrelated) test collection created via curl previously, none from plugin. Connection with cluster URL and API key seems to work fine – no errors.
When I generate API key in cluster I only get admin key, and that’s the only API key I provided in plugin settings – because I can only provide a search API key for a specific collection if that collection exists. And I don’t want to have to create the collection manually. Shouldn’t the schema come from the plugin?
When I click index on post type, I get following error in my error logs:
WP_Error::__set_state(array(
'errors' =>
array (
404 =>
array (
0 => 'Not Found',
),
),
'error_data' =>
array (
),
'additional_data' =>
array (
),
))
Btw, in debug logs I get HTML response from Github that I need to authenticate. But I did this already and can’t find any place to do it.
]]>Hi,
We’re running two typesense servers – one for staging and one for production. Is it possible to define a constant in WordPress for the URI, Admin Key and Search Key? Currently when we pull a copy of our WordPress site from production into staging we need to manually edit these details. It would be useful if we could have them as part of the environment,
Thanks.
]]>i am looking to use this WordPress plugin to crawl a table that is not a post or category, but has been added to the WordPress database. I want to know if it’s possible to be able to crawl and index it so I can deliver search results on my WordPress site
]]>Hi, Is there a simple solution to display an “All” tabs at the start of the query?
https://typesense.codemanas.com/
It would be something like the autocomplete results that shows all post types on a single list.
Thanks
]]>Hi, what I am trying to achieve is in the demo page:
https://typesense.codemanas.com/
and I search for something, the search term is fixed when changing between the Books – Blog – Pages tab. Right now, when I type something and then change post type the query term is erased.
Thanks!
]]>Your plugin is amazing and typesense for woocommerce is also really good
]]>Error: 404 - Could not find a facet field named
pa_title_attribute_filter
in the schema. value https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 n https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 e https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 u https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 N https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 g https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 t https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 p https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 nrWrapper https://babysonbroadway.com/s/:5 promise callback*7806/L/a.prototype.then https://babysonbroadway.com/s/:5 t https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 p https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 exports https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 nrWrapper https://babysonbroadway.com/s/:5 e https://babysonbroadway.com/s/:5 exports https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 value https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 search https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 _search https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 searchOnlyWithDerivedHelpers https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 search https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 ht https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 M https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 emit https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 _search https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 search https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 searchFunction https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 search https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 r https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 t https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 nrWrapper https://babysonbroadway.com/s/:5 promise callback*7806/L/a.prototype.then https://babysonbroadway.com/s/:5 n https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 value https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 <anonymous> https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 <anonymous> https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 <anonymous> https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 nrWrapper https://babysonbroadway.com/s/:5 nrWrapper https://babysonbroadway.com/s/:5 <anonymous> https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 <anonymous> https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 <anonymous> https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2
instant-search.js:2:380836
Uncaught (in promise) Error: Unhandled Promise Rejection: 404 - Could not find a facet field namedpa_title_attribute_filter
in the schema. value https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 n https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 e https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 u https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 N https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 g https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 t https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 p https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 nrWrapper https://babysonbroadway.com/s/:5 promise callback*7806/L/a.prototype.then https://babysonbroadway.com/s/:5 t https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 p https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 exports https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 nrWrapper https://babysonbroadway.com/s/:5 e https://babysonbroadway.com/s/:5 exports https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 value https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 search https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 _search https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 searchOnlyWithDerivedHelpers https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 search https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 ht https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 M https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 emit https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 _search https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 search https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 searchFunction https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 search https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 r https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 t https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 nrWrapper https://babysonbroadway.com/s/:5 promise callback*7806/L/a.prototype.then https://babysonbroadway.com/s/:5 n https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 value https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 <anonymous> https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 <anonymous> https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 <anonymous> https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 nrWrapper https://babysonbroadway.com/s/:5 nrWrapper https://babysonbroadway.com/s/:5 <anonymous> https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 <anonymous> https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 <anonymous> https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2
instant-search.js:2:382354 nrWrapper https://babysonbroadway.com/s/:5 (Async: promise callback)
then https://babysonbroadway.com/s/:5 _search https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 searchOnlyWithDerivedHelpers https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 search https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 ht https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 M https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 emit https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 _search https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 search https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 searchFunction https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 search https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 r https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 t https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 nrWrapper https://babysonbroadway.com/s/:5 (Async: promise callback)
then https://babysonbroadway.com/s/:5 n https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 value https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 <anonymous> https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 <anonymous> https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 forEach self-hosted:203 <anonymous> https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 nrWrapper https://babysonbroadway.com/s/:5 (Async: EventListener.handleEvent)
nrWrapper https://babysonbroadway.com/s/:5 <anonymous> https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 <anonymous> https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2 <anonymous> https://babysonbroadway.com/wp-content/plugins/typesense-search-for-woocommerce/assets/frontend/instant-search.js?ver=1.7.2:2
Hi. Thanks for your work on this plugin, it’s a great solution for search in WordPress.
I’m having difficulty using the routing option with instant search. Specifically when loading a page with search params in the URL results in the error:
Fatal error: Uncaught TypeError: urldecode(): Argument #1 ($string) must be of type string, array given
Please may you verify that it definately works as intended because I don’t think I have any custom code or other plugins that would cause the issue.
https://share.cleanshot.com/zSzTKSwz
I’ve tested the form on multiple pages across the website, and with permalinks enabled/disabled but all have the same issue.
Any suggestions for things I should try or does this feel like an issue in the search-with-typesense plugin?
Thanks
]]>The taxonomy update fails to function correctly when it is associated with multiple custom post types. please use continue instead of return
First of thank you for this nice plugin.
My question is, I would like to filter posts based on the relationship the posts have. example:
Just to add to this how do we also alter the list of posts/shop as a slider instead of grid, i know i have to do it inside the template on the child theme. but how do i target that search box only. instead of all the search box will be changed?
I hope i explained my question here correctly. and again thank you
]]>Hello,
I have a static site being served by CloudFront. I’m currently using Algolia which works flawlessly but the search queries are limited and are exhausted quickly.
My question is will this work on a static site? Also do I need to configure anything on the server?
Thank you. Best Regards.
]]>Hi.
I’ve setup Typesense on my vps.
curl https://localhost:8108/health
and
https://mysite.com/typesense/health
gives
{"ok":true}
I’ve found the Admin API key in /etc/typesense/typesense-server.ini and created a Search API key via
curl 'https://localhost:8108/keys' \
-X POST \
-H "X-TYPESENSE-API-KEY: myadminkey" \
-H 'Content-Type: application/json' \
-d '{"description":"Search-only companies key.","actions": ["documents:search"], "collections": ["*"]}'
So, on plugin configuration page, when I enter relevant details and click save it says The credentials could not be verified – please check your settings.
I chose https as protocol and node url is mysite.com, and port is 443.
I could not find a solution, what am I doing wrong?
Thanks.
]]>Currently, the plugin calls directly to the Typesense server with the API key included. Do you have plans to have an option to protect the API key? Thank you.
]]>Self-hosted typesense possible for WordPress and woocommerce by this plugin?
]]>Hello, I’m using Typesense with custom filters, one of them is “Desired Hatch Week,” and it’s generating 8 results with empty dates, which also don’t display articles when clicked. The site has a large number of products, and in order to identify which products are generating these empty results I made this GET request to the API with Postman https://search.thechickhatchery.com/collections/product/documents/search?query_by=desired_hatch_week_variation&q=null
But without any results.
Any idea what might be happening here?
Thank you in advance.
https://www.loom.com/share/60f2a90b5e3d42f5886a0d4601ed1c54
Hi I’m wondering if I could add an Advanced Custom Field that is added to a post by using the File type field to the Schema.
I am uploading a PDF to this File field in a Post and wanted to see if the contents of that PDF could be found in search and then displayed in the results for the Post that it is uploaded to?
]]>Hi I was wondering if it’s possible to change the collection that is used in Typesense for the WordPress forms when enabling the replace WordPress Default Search?
]]>Hi,
I host a sites with more than 40 000 posts. And could happen that we need to updates all of them. Since this process will take almost 2 hours, I would like to know if there is a way to index the document only for updating and not for deleting and index from 0. This will allow me to continue to have the search always online.
I would also know if this is not possible in the admin panel, if we can do that by cli o calling some php functions.
]]>So, if I use a typesense cloud server, I can get my searches to work. However as soon as I switch it to a self hosted typesense server the searches will not return any results. When I view the error log file. I get the following results:
=== START ==== ::Time:: 2023-10-19::20:42:15-UTC WP_Error::__set_state(array( ‘errors’ => array ( 404 => array ( 0 => ‘Not Found : Not Found’, ), ), ‘error_data’ => array ( ), ‘additional_data’ => array ( ), )) ===END===
=== START ==== ::Time:: 2023-10-19::20:42:20-UTC WP_Error::__set_state(array( ‘errors’ => array ( 404 => array ( 0 => ‘Not Found : Not Found’, ), ), ‘error_data’ => array ( ), ‘additional_data’ => array ( ), )) ===END===
I’ve created this collection locally and on the cloud system.
curl “https://localhost:8108/collections” \
-X POST \
-H “Content-Type: application/json” \
-H “X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}” \
-d ‘{
“name”: “books”,
“fields”: [
{“name”: “.*”, “type”: “auto” }
]
}’
Still no results using the local typesense server. Any suggestions on what to look for?
Thanks for any guidance you can provide.
]]>Hi
I get a 404 error from TypeSense server API.https://example.com/cms-search:443/collections/stock/documents/search?q=test&query_by=post_title&per_page=5&x-typesense-api-key=REDACTED
The problem looks like the :443
which is in the wrong place.
My TypeSense server is behind a reverse proxy on https://example.com/cms-search
I had to modify the following code to make it work.
BACKEND includes/Main/TypesenseAPI.php
Search for:( $settings['protocol'] . $settings['node'] . ':' . $settings['port'] . '/' ?? '' )
Replace with( $settings['protocol'] . $settings['node'] . '/' ?? '' );
FRONTEND assets/frontend/autocomplete.js
Search for .concat(e.host,":").concat(e.port)
Replace with .concat(e.host)