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

Search description instead of post content #28

Closed
iandunn opened this issue Nov 28, 2020 · 5 comments · Fixed by #44
Closed

Search description instead of post content #28

iandunn opened this issue Nov 28, 2020 · 5 comments · Fixed by #44
Assignees
Labels
[Component] Pattern Directory The backend of the pattern directory: submission, management, etc [Type] Enhancement New feature or request
Milestone

Comments

@iandunn
Copy link
Member

iandunn commented Nov 28, 2020

Normally Core searches post_content, but that probably won't make sense for most patterns, since that's storing the HTML and demo content. It'd make more sense to search the meta description field instead.

See #11

One way to do this might be to save the description into post_excerpt, instead of a meta field. Then it'd be searched for free. We'd still want to disable searching post_content, though.

That'd also require changing the two APIs that proxy this API, which would be a pain. We might also want to search by other post meta per #11, so we might need that functionality anyway. We'll probably need to update them anyway, as the design evolves, so maybe those updates can be batched together after more are settled.

@iandunn iandunn added [Type] Enhancement New feature or request [Component] Pattern Directory The backend of the pattern directory: submission, management, etc labels Nov 28, 2020
@iandunn iandunn self-assigned this Nov 28, 2020
@iandunn
Copy link
Member Author

iandunn commented Nov 30, 2020

Core doesn't provide a lot of ways to customize search results, somewhat intentionally.

It's tempting to create a search_index meta field like #core34211 suggested, but without the API from Core, we'd need to re-create the parse_search() logic around stop words, multiple-word queries, exclusionary operators, etc.

A different approach would be to use w.org's Sphinx service, or Elasticsearch (via Jetpack). That seems like it'll be more practical, so I'm going to look into that.

@iandunn
Copy link
Member Author

iandunn commented Nov 30, 2020

@tellyworth , is there any documentation around why the plugin directory uses a forked version of the Jetpack_Search class? Do you think the pattern directory should reuse that, or the canonical version in wp-content/plugins/jetpack?

iandunn added a commit that referenced this issue Feb 22, 2021
@ryelle ryelle added this to the Initial Launch milestone Mar 30, 2021
iandunn added a commit that referenced this issue Jun 30, 2021
Meta queries are slow, so running them through will be much faster, and may be necessary for scaling.

A future commit will setup ES for this (probably after #28), this commit just gets the data there so it's possible to test.

See #244
@iandunn
Copy link
Member Author

iandunn commented Jul 7, 2021

WordPress/wordpress.org#33 demonstrates how to integrate w/ Jetpack Search. I think we can mostly do the same things here.

@iandunn
Copy link
Member Author

iandunn commented Jul 20, 2021

#307 also has some functionality that should be incorporated: the requested locale should be prioritized rather than exclusive.

iandunn added a commit that referenced this issue Aug 18, 2021
This lets us search the meta description field instead of `post_content`.

Fixes #28
@iandunn
Copy link
Member Author

iandunn commented Aug 18, 2021

I opened a couple new issues for refinement: #347, #348

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] Pattern Directory The backend of the pattern directory: submission, management, etc [Type] Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants