strapi / documentation

Strapi Documentation
https://docs.strapi.io
Other
1.02k stars 1.08k forks source link

[Request]: improve search #1673

Closed Boegie19 closed 10 months ago

Boegie19 commented 1 year ago

Summary

if you search anything related to query related you get the query engine before entity service What means

Why is it needed?

to make the entity service better findable

Suggested solution(s)

No response

Related issue(s)/PR(s)

No response

Boegie19 commented 1 year ago

@pwizla dmed you more information about the plan for this in dms on discord

My idea is 1 research what people search for and if the results are what we expect them to be. Also check if what people clicked on was what they where actually looking for. 2 add page weight to give some pages like rest higher ratings and others like migration lower to improve the search 3 make selectors in search that would be saved in local storage to make the search more spesific examples would be GraphQL vs rest plugin vs normal Developer vs User (I would say this one would default depending on where you are in the docs) This could be filters or ranking tie breakers I would only go for the filter for graphQL vs rest

The 2 options to do 2 are Also what would be better

<head>
  <meta property="weight" content="1" />
</head>

or

---
sidebar_label: 'Introduction'
displayed_sidebar: devDocsSidebar
slug: /dev-docs/intro
sidebar_position: 1
weight: 1
---

first one would work out of the box second one would have to add a handler in to the react layout to transform it onto the same as 1

We also probebly want to test this change first on the next branch

pwizla commented 1 year ago

Thanks for creating this request. I replied to your DM, but please refrain from DMing me, especially with duplicate content. In short, overhauling the search is not on our roadmap for now. Built-in Algolia solutions exist to modify the weight of a page, for instance this one. We'll consider it if we receive very frequent feedback about search results being incorrect or unexpected, which is not currently the case. Having "QueryEngine" returned when you search for "query" is expected. Please search for "entity," and you'll get results about "EntityService", or search for "requests" and you'll get results for the "REST API". We'll eventually draft an introduction page for our various APIs for disambiguation.

Boegie19 commented 1 year ago

for me as a individual this solves the issue. but for the 100 other people who search for the same thing this issue still exists. And it means that they get the wrong information. other example where the same thing happens is findone

Also it is really hard to complain that you get the wrong information if you don't know the information is wrong.

since for new people using strapi the diffrence between db.query and entity service is none.

pwizla commented 1 year ago

I get what you mean. However, for Strapi newcomers, the big disambiguation callouts in both the Query Engine (QE) and Entity Service (ES) API introductions explain the differences. Thanks to your recent PR, we also have reminders that Entity Service should be favored over Query Engine, so if people find QE first they will be redirected to ES. Finally, as I said, we'll eventually add an introduction to our APIs so that people understand all the differences and use cases.

Now if you can think of a quick solution that would allow us to add a property to the YAML part of the Markdown files, and give some weight to a given page in the search results, go for it, and please create a PR! :) But as previously mentioned elsewhere we can't allocate internal resources for that at the moment, and for cost & privacy reasons, I can't give you access to Algolia tools as usage is restricted to Strapi employees.

Boegie19 commented 1 year ago

Will make a pr for this

I should be more clear next time since I did not expect strapi to spend to match time on it but I wanted to have confirmed that the PR if made would be accepted. before starting on it since I was not sure if that would have been off limits. sorry for the confusion.

pwizla commented 10 months ago

I'll close the PR as it's already added to our internal backlog. We'll probably rediscuss improving Algolia search in Q1 or Q2 2024 and I'll get back to you :)