Code Monkey home page Code Monkey logo

elasticpress's Introduction

ElasticPress

A fast and flexible search and query engine for WordPress.

Support Level Tests Status Release Version WordPress tested up to version MIT License

Please note: as of ElasticPress 4.0.0 trunk is the stable branch, built assets were removed from the develop branch, a ZIP with the plugin and its built assets are available on the GitHub Releases page, and will include a build script should you want to build assets from a branch. As such, please ensure you have updated any references you have from master to trunk or to GitHub releases depending on whether you require built assets or not.

Overview

ElasticPress, a fast and flexible search and query engine for WordPress, enables WordPress to find or “query” relevant content extremely fast through a variety of highly customizable features. WordPress out-of-the-box struggles to analyze content relevancy and can be very slow. ElasticPress supercharges your WordPress website making for happier users and administrators. The plugin even contains features for popular plugins.

Documentation

Requirements and Compatibility

Requirements

ElasticPress requires these software with the following versions:

Compatibility

The WooCommerce feature is compatible with the last two major versions of the WooCommerce plugin.

Building Assets

Simply downloading the repository files is not enough to have the plugin working, as CSS and JavaScript files are built during the release process. If you want to use a development version of the plugin you will to run:

npm install && npm run build

Node.js (v18) and npm (v8) are required.

React Components

Interested in integrating ElasticPress in your headless WordPress website? Check out ElasticPress React.

Issues

If you identify any errors or have an idea for improving the plugin, please open an issue. We're excited to see what the community thinks of this project, and we would love your input!

Support Level

Active: 10up is actively working on this, and we expect to continue work for the foreseeable future including keeping tested up to the most recent version of WordPress. Bug reports, feature requests, questions, and pull requests are welcome.

Changelog

A complete listing of all notable changes to ElasticPress are documented in CHANGELOG.md.

Upgrade notices

3.5

Search Algorithm Upgrade Notice: Version 3.5 includes a revamp of the search algorithm. This is a backwards compatibility break. If you'd like to revert to the old search algorithm, you can use the following code: add_filter( 'ep_search_algorithm_version', function() { return '3.4'; } );. The new algorithm offers much more relevant search results and removes fuzziness which results in mostly unwanted results for most people. If you are hooking in and modifying the search query directly, it's possible this code might break and you might need to tweak it.

4.0.0

Note that ElasticPress 4.0.0 release removes built assets from the develop branch, replaced master with trunk, added a ZIP with the plugin and its built assets in the GitHub Releases page, and included a build script should you want to build assets from a branch. As such, please plan to update any references you have from master to trunk or to GitHub Releases depending on whether you require built assets or not.

Contributing

Please read CODE_OF_CONDUCT.md for details on our code of conduct, CONTRIBUTING.md for details on the process for submitting pull requests to us, and CREDITS.md for a listing of maintainers of, contributors to, and libraries used by ElasticPress.

Like what you see?

elasticpress's People

Contributors

aaronholbrook avatar brandwaffle avatar burhandodhy avatar christianc1 avatar chriswiegman avatar cmmarslender avatar dependabot[bot] avatar dinhtungdu avatar eugene-manuilov avatar felipeelia avatar goaround avatar ivankristianto avatar jakept avatar jeffpaul avatar joeyblake avatar kallehauge avatar lukaspawlik avatar marqas avatar mlaroy avatar moraleida avatar mustafauysal avatar oscarssanchez avatar petenelson avatar rahmon avatar rebeccahum avatar ritesh-patel avatar sc0ttkclark avatar tlovett1 avatar tott avatar tuanmh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elasticpress's Issues

bbPress Topic/Reply search

bbPress deviates from WordPress's search functionality just a bit, so it's worth making a dedicated issue for it here.

Thankfully, bbPress topics and replies are just post types, so it's easy enough to grok. Providing fast and reliable relevancy-based results in a forum dramatically improves user experience, and the effectiveness of searching what can oftentimes be hundreds of thousands of posts.

Moderators could even have a control panel allowing them to weight certain terms in certain forums or categories, knowing that words and phrases are likely to be reused often in certain sections of the forums more than others.

Code review needed

A thorough code review is necessary before we can launch 1.0. Making an issue here so we can assign it to someone, track progress, and mark it resolved when 1.0 launches.

Support "search_author" in WP_Query

"search_author" should behave similarly to "search_tax" and "search_meta". Given a search string, it should search posts by author based on that string.

Need to re-sync post any time a post is saved

Currently only syncing on publish of post, but this should be done any time a post has been updated as new content may have been added to the post_content taxonomies or post meta data.

Improve code coverage with unit tests

Title says it all. We really need unit tests to test more edge cases related to ES_Query and running searches against the Elasticsearch instance.

Remove `ep_last_synced` post meta storage

I'm still not sold that we need to be doing a DB insert for every post we sync. I'm not clear of what the benefits are over the increased cost of a full index.

I think a stress test to measure the performance between updating the last synced post meta and removing that bit entirely would be a good step in understanding just how much effect it truly has.

In addition, it should be remembered that the Elasticsearch data store should be considered somewhat volatile as opposed to the WP/MySQL data store which does all it can to never lose data. If Elasticsearch's data store gets wiped or needs a re-index, the post meta for determining the last sync time becomes irrelevant.

Replace search in wp-admin

Elastic search is currently only used for improving the visitor experience. Is it possible to improve the accuracy of searches within wp-admin? Accuracy and performance of searching through posts, users, comments, etc... could likely be vastly improved.

Bulk indexing

Rather than submit posts for indexing one at a time, it would be better to use the Elasticsearch bulk index functionality.

We will have to consider error handling when using the bulk api because it's possible that some posts don't get indexed and others do. Elasticsearch will tell us what happened but we will have to resubmit those posts for indexing.

Additionally, we'll need to be aware of the max post size on the server and the max amount of data elasticsearch/java can receive.

Security: prevent malicious post indexing

Via server side - but still an important thing to figure out is how we're limiting and controlling access to the Elasticsearch server. Currently we are proxy pass limiting access to POST - this does not prevent users from maliciously indexing data

Add debug logging if request(s) fails

Currently all requests fail silently without offering an explanation as to the cause. Instead we should aim to allow for easier debugging by offering an explanation to what went wrong.

Discussion as to how we'd offer debugging (straight error log for regular use / print to console for WP CLI) should be thought through before approaching this item.

BuddyPress Integration

BuddyPress components would hugely benefit from indexing of their content:

  • Extended Member Profile fields
  • Activity streams
  • Username @ mentions
  • Individual Groups and Members
  • Private messages

The above list is loosely in priority order as I see it. Users ask for multifaceted member profile search constantly, and there just isn't a real solution out there.

Fix potential issue with indexing non-published posts

Currently the sync is set for posts that are transitioning INTO the publish status, however this doesn't address items that WERE published but are being moved to a draft or private status (or anything other than publish). These items should be removed from the index as they are no longer available for searching.

Equality issues

From @ericmann's review:

Certain locations of the code (like EP_Sync_Manager::action_sync_on_transition()) are using type coercion for checking things like post status. Strict equality (=== and !==) should be used wherever possible and type coercion only when necessary (and documented).

Cross-site setting inconsistency

If cross-site setting is saved on multisite, network deactivated and then re-activated on a sub-site, cross-site is still enabled and the settings page only shows on the network settings page and not the sub-site.

This should behave in a more expected manner and if activated by a sub-site, not automatically re-enable cross site search, and should show itself on the sub-site admin panel.

Add better remote request response checking

Currently remote requests check to ensure that a WP_Error is not present, but do not check the HTTP response code to ensure an ok response was received.

This should be handled to ensure that we receive proper responses from the Elasticsearch server.

Compatibility note

From @ericmann's review:

I notice that, while the plugin declares 3.7.1 compatibility (Travis.yml), it also declares a PHP 5.4 requirement. General plugin distribution should be PHP 5.2 to match WordPress requirements. If this is just for tests, that’s fine, but when developing against PHP 5.4 and supporting 5.2, it’s easy to let newer code syntaxes slip through that will brick an installation.

Separate sync logic from cron/schedule logic

The function ep_full_sync actually calls do_scheduled_syncs. Unfortunately this forces us to first schedule a sync event which in cases where we call from wp-cli, we would not want to do.

The logic behind actually doing a full index/sync should be abstracted out from the do_scheduled_syncs and placed into a function that does a full index that can be called independently and directly.

For reference: https://github.com/10up/ElasticPress/blob/master/classes/class-ep-sync-manager.php#L133

Track/report usage analytics

Record how visitors interact with ES: What they're searching for, what was returned, perhaps what they clicked on as a result.

Submitted by @tddewey.

Great idea - would love to see this reported in a cool dashboard widget even.

Post syncing status gets stuck

Due to an unknown reason, the sync button does not work on my local install. Not only does it not work, but it says it's been syncing for the last two weeks.

We should detect if we're not going to be able to sync for some reason (i.e. wp-cron isn't working or whatever the issue) if possible and prevent syncing from happening or find some other approach.

Additionally - there should be some sort of status check to cancel a sync if it has gone over an abnormal amount of time and if there has been no progress.

Internationalization needed

From @ericmann's review:

No textdomain is set up (though some strings use elasticpress) and not all strings are localized. Even though cron descriptions are an internal tool, strings in places like EP_Cron::filter_cron_schedules() should be localized.

Orphaned post types created when deselecting post type after index.

Indexing a post type, then deselecting that post type to be indexed could leave incorrect post types in the ES index if a full sync is not performed.

Double check that search is being performed only on current post types (pretty sure this is the case, just want to double check) and should look run a full post type delete from index on save of new post types.

On direct post auto-suggest selection direct to post instead of search results

Will have to be careful with this one, as general terms should still return a list of results, however - in some cases it would be helpful and effective to skip the results page and go directly to an individual post.

I'm thinking if they select an autosuggested post title, or if the relevancy score is high enough, then bypass result page and head to post. (Could possibly even provide a helpful link to the results page)

Cache available post types on each sub site in admin

Having to query each site every time causes a noticeably slow user experience on the admin page. Would be good to cache this in settings and inject/remove post types once the query has been performed (possibly also cache this for a small period of time and invalidate on permalink/rewrite flush).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.