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

Fix mime type search queries #98

Merged
merged 1 commit into from
Sep 10, 2020
Merged

Fix mime type search queries #98

merged 1 commit into from
Sep 10, 2020

Conversation

roborourke
Copy link
Contributor

ElasticPress has a bug that results in searches incorrectly filtering on exact matches for truncated mime types such as image meaning no results are returned. This corrects the use of terms and also adds prefix queries which are more performant than the built regex query.

Fixes #97

ElasticPress has a bug that results in searches incorrectly filtering on exact matches for truncated mime types such as `image` meaning no results are returned. This corrects the use of terms and also adds prefix queries which are more performant than the built regex query.

Fixes #97
@roborourke roborourke requested a review from joehoyle September 10, 2020 11:36
@roborourke
Copy link
Contributor Author

I'll make an upstream issue too

@roborourke
Copy link
Contributor Author

Upstream issue here 10up/ElasticPress#1604

inc/namespace.php Show resolved Hide resolved
@roborourke roborourke merged commit 3b85964 into master Sep 10, 2020
@roborourke roborourke deleted the ensure-mime-type-filter branch September 10, 2020 14:30
@hm-backport
Copy link

hm-backport bot commented Sep 10, 2020

The backport to v3-branch failed:

Commits ["0cd19d96c13c2e525511fe5ef0f0cff59cd43594"] could not be cherry-picked on top of v3-branch

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub.
git fetch
# Create new working tree.
git worktree add .worktrees/backport v3-branch
# Navigate to the new directory.
cd .worktrees/backport
# Cherry-pick all the commits of this pull request and resolve the likely conflicts.
git cherry-pick 0cd19d96c13c2e525511fe5ef0f0cff59cd43594
# Create a new branch with these backported commits.
git checkout -b backport-98-to-v3-branch
# Push it to GitHub.
git push --set-upstream origin backport-98-to-v3-branch
# Go back to the original working tree.
cd ../..
# Delete the working tree.
git worktree remove .worktrees/backport

Then, create a pull request where the base branch is v3-branch and the compare/head branch is backport-98-to-v3-branch.

@hm-backport
Copy link

hm-backport bot commented Sep 10, 2020

The backport to v4-branch failed:

Commits ["0cd19d96c13c2e525511fe5ef0f0cff59cd43594"] could not be cherry-picked on top of v4-branch

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub.
git fetch
# Create new working tree.
git worktree add .worktrees/backport v4-branch
# Navigate to the new directory.
cd .worktrees/backport
# Cherry-pick all the commits of this pull request and resolve the likely conflicts.
git cherry-pick 0cd19d96c13c2e525511fe5ef0f0cff59cd43594
# Create a new branch with these backported commits.
git checkout -b backport-98-to-v4-branch
# Push it to GitHub.
git push --set-upstream origin backport-98-to-v4-branch
# Go back to the original working tree.
cd ../..
# Delete the working tree.
git worktree remove .worktrees/backport

Then, create a pull request where the base branch is v4-branch and the compare/head branch is backport-98-to-v4-branch.

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.

Media Manager returning empty results when searching
2 participants