Algolia Wordpress indexing cause duplicate entries - wordpress

I am using Algolia plugin in Woocommerce site for searching, after indexing from woocommerce algolia plugin then in algolia dashboard i see there are multiple duplicate entries (everything except object id is same) of same product with different object id and same post id . But in wordpress dashboard there is only one entry of the product. This is happening only in some products not all.
Anyone please help me out.

Allow me to quote the docs of the Algolia plugin for WordPress:
I have more records than I have posts, is that normal?
This is intentional and allows you to fully leverage the Algolia engine.
The plugin takes care of the splitting for you and makes sure that
your articles are fully indexed independently from their size.
This means that even if your article is huge and you are searching for
a word that is at the very bottom, you will have it as part of the
suggested articles.
So to answer your question it is expected that you have multiple records per post. This ensures Algolia provides you with as fast and as relevant results as possible.
You can eventually disable the post splitting by defining a constant in your wp-config.php file: define( 'ALGOLIA_SPLIT_POSTS', false );
I only recommend doing so if you are not interested in search inside the content of the posts. In general disabling the post splitting negatively impacts the relevance of the results.

Related

How to change wp-admin/edit.php categories filter to a multiselect?

I'm using GoDaddy hosting, with WordPress Managed plan, so I can't edit anything in wp-admin/ or wp-includes/ folder, the only folder I've permission is wp-content/.
I tried to look it on google, and tried to find the plugins, I found this plugin Post Filter Multiselect but it doesn't working anymore, my WordPress version is 4.9.5 and the plugin were not updated since 9 month ago. So I tried another plugins but neither of them are working.
If I want to add this with themes or plugins how to do it? because I can't found the answer, thank you.
What I want is to make the wp-admin/edit.php categories filter be a multiselect, because in 1 post, there are so many categories, so to narrow it down, it need multiple categories. and there are a lot of categories, around 50 categories.
Have you tried other plugins like search & filter ? I haven't used it myself but it seems to be what you are looking for. Also, have you tried contacting the support to see if they could grant you access to the folder?
OK, so this is slightly a sledgehammer-to-crack-nut approach, but you could install the Advanced Custom Fields plugin and create a Taxonomy field. You can select an Appearance of Multiple Values > Multi Select and make sure that Create Terms, Save Terms and Load Terms are all true so that your categories are synced properly with the post. Finally, in the field group settings you can select the checkbox to hide the normal categories meta box.
It's one that's worked for me in the past without requiring extra plugins (since I already use ACF).

Algolia Wordpress plugin not indexing post content

Just wondering if you guys could help me. I have indexed all my content from WP and when using the instant search only a few posts are showing any sort of excerpt. I have reindexed a few times to see if it resolved it to no luck.
I am looking on algolia's dashboard and when searching for specific items they have only specific attributes filled in. screenshot from algolia dashboard
Any help is appreciated.
By default the plugin will split the post's content into multiple Algolia records.
Then when displaying results, we display the most relevant matched record as the excerpt.
You could customize this behaviour by following this guide: https://community.algolia.com/wordpress/customize-search-page.html
Let us know if there is something you would like to achieve that does not seem supported or easy to implement.
Update:
It seems like some users are more satisfied with putting the post_title as last in the ranking. That way, the displayed excerpt will be relevant.
the only cases where this would not be ideal is if you want the post title to be more important as the content of your post.

RSS Feed "Delete" Signal

I've been using the RSS feed of my personal site to export its posts to a Wordpress installation, using the plugin FeedWordPress.
In its current state, when a post is deleted from my personal site, it also disappears from the RSS feed, but remains on the Wordpress installation (an undesirable behavior). There is an option in the FeedWordPress plugin to retain only the posts that are currently in the RSS, but then I have a different problem, because only the latest 50 entries are stored in the RSS at any time, so older posts would be deleted as well.
The most promising lead for a solution came from another option for the plugin, which goes:
Allow Feeds to Delete Posts: Yes. If a feed indicates that one of its
posts has been deleted, delete the local copy syndicated to this
website.
How would I go about adding such a deletion indication/signal in my RSS feed?
I would use the built in option in feedpress or create a category and add the unwanted posts there and exclude them from the feed.
Turns out it was referring to tombstones (deleted-entry elements) in Atom.
https://www.rfc-editor.org/rfc/rfc6721

wordpress similar/related posts by title

I know that there are many plugins which does this. but I am wondering why all plugins only get related post by tags and not by title?
what is an efficient way to retrieve all similar post only by title in the single.php. for example, if I have two posts whose title are "speed up wordpress loading time" and "speed up wordpress backend". then in one post, the other one should be related and shown.
I can think of a way to do that, which is to get all posts under the same category and using similar_text() to compare each title against the current one. then order the result and show the top ones from the list. is this a good and effecient way to do that?
any suggestions? please attach a snippet of code if you have a solution.
I'd suggest you don't load related posts on page load because this will dramatically hurt your website's performance.
The free WordPress plugin Related Posts for WordPress automatically finds related posts (amongst others based on title) and caches them for you, offering you real related posts without hurting your website's performance. After the automatic linking is done you can, if required, manually add, edit or delete related posts.
You can give it a try via the WordPress.org repo: http://wordpress.org/plugins/related-posts-for-wp/
It involves a bit more work, but you could add a fulltext index to the title column of the posts table and then use MATCH AGAINST in your query to retrieve similar posts ordered by relevance.
To add a fulltext index:
CREATE INDEX fulltext2 ON wp_posts(post_title(255));
To make a query using MATCH AGAINST:
SELECT ID, post_title,
MATCH(post_title) AGAINST ('$post_title') AS Similarity
FROM wp_posts
WHERE MATCH(post_title) AGAINST('$post_title')
ORDER BY Similarity DESC;
Note: I am not specially fluent in SQL, if you decide for this option perhaps someone could improve the SQL above.

Organising Custom Content for Wordpress

I am already very confused as I am typing this thread out. Please forgive me if my query is a little too difficult to understand.
I have an existing Real Estate Site that I intend to move 100% into WordPress. The existing site has one backend for listings and another blog section for reviews.
You can probably see why I have decided to make the move to a full WordPress powered site. Maintaining both ends of the site is both tedious & cumbersome.
I have read and understood Custom Post Types & Custom Taxonomies and how they work. I am rather excited about implementing them. However there is some content I am finding difficult to organise.
* An existing database table of about 4,000 Condominium Projects
Each entry in the Condominiums table has some "bio-data" like Year Completed, No. of Units, Facilities, Amenities etc.
Currently each listing in my site has an ajax query that fetches information from this table on demand.
In the new site, I intend to have a link to the respective condominium in each property listing.
This link should display information about the specific condo and display 'results' of matching listings.
Also, some condos have long article reviews done for them. In my current site, these reviews are displayed in the blog section. Separated altogether.
So here's my question.
How would I connect everything together. A duplicate perhaps? Taxonomy & Post for each condo? That will mean over 3,000 unique entries. Wouldn't that be an "overkill"?
If it is a taxonomy, the link will probably display all posts (listings) that have that condo name. But it wouldn't link to an actual page of either it's review or bio-data.
Any thoughts will be very much appreciated... Please feel free to ask if I have missed out any vital information!
Thanks in advance
The seems very straightforward to me and a perfect fit for WordPress (and I shudder to think of doing anything in Drupal you don't have too; and this from someone who developed in Drupal for 2+ years...)
Anyway:
Each condo gets stored in a custom post type.
All the "bio-data" gets stored in a custom field. Alternately you could create a taxonomy called "bio-data" and have a term value for each of the options but this won't work well for things like "SqFt" unless you do ranges (i.e. 1200sft-1300sqft) because terms can only be used for "true/false" attributes (i.e. either it applies or it doesn't) and not for specifics like exact offer prices, etc.
The long articles can just be stored in the "content" section of the condo post type (unless you have multiple per condo then you can either store in comments as #Jan Fabry suggested or you can create a custom post type "review")
Like I said this is really straightforward. Of course I've lived and breathed database apps for 20+ years so it comes second nature to me. Any questions, just ask...
This was how I managed to solve my own question!, Ironically enough, MikeSchinkel had an almost identical answer, so I accepted his answer instead.. So here's what I have:
A Custom Post Type for Condominiums labelled 'Reviews' in the admin section. The property 'Bio-data' is in custom fields. This Custom Post Type has a rewrite rule:
array( 'slug' => 'condominium' );
That way, I managed to have each Permalink to show something like:
http://domain.com/condominium/post-title
I have added a page called Condominiums and had it set to use a custom template - which basically shows the latest posts of condominiums with reviews. I also intend to extend the template for it to show a Search Condominiums function.
Added relevant taxonomies that can be searchable - like Brands & Developers.
I have already converted previous reviews to this. The last thing I will have to do will be to post all the Condominiums from the condominiums database to the wp_posts table using this Custom Post Type.
This is the part I am crossing my fingers for as I will have to see if the rewrite rules are going to significantly slow down my site as this will be 4,000 entries. This issue has been recently brought to my attention here
http://core.trac.wordpress.org/ticket/12935
I will update this thread once I have completed the importing - since this is the only place I have posted a question and have it answered - if anyone might be interested!
Thank you for your suggestions. I hope this helps someone else who is in a similar predicament.
Would it work if you view the Condominiums as posts, and the reviews as comments to these posts? This would keep them together, and is conceptually not even too far from the original intention. You can put the extra information in custom fields and tags (which gives you free searching capabilities). Then you should see for yourself if you still need to create a custom post type, or just do it with regular posts (why not?).
But yes, you are stretching the original WordPress concept a little. Drupal or some other CMS might be a better option, and have more plugins that are suited to your situation.

Resources