Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Using the /search endpoint #5929

Merged
merged 15 commits into from
Nov 19, 2019
Merged

Using the /search endpoint #5929

merged 15 commits into from
Nov 19, 2019

Conversation

pmarjan
Copy link
Contributor

@pmarjan pmarjan commented Nov 5, 2019

Using the /search endpoint

whatsnew
Added the Search for products with the /search endpoint topic.

@nuzil nuzil self-requested a review November 5, 2019 16:28
@devops-devdocs
Copy link
Collaborator

An admin must run tests on this PR before it can be merged.

@nuzil nuzil self-assigned this Nov 5, 2019
@magento-engcom-team
Copy link

@pmarjan thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@dobooth
Copy link
Contributor

dobooth commented Nov 5, 2019

Hi @pmarjan Thanks for your contribution! The red 'x's above note a couple issues: First, please sign the new Adobe CLA so we can get this merged. Second, you have some markdown errors. Click the Details link above to see them. When using unordered lists, there should be two spaces between the * and the text. This is so it aligns the same way as ordered lists. And if each version is identical, consider symlinking them. For API call examples, please use ```http.

@keharper keharper self-assigned this Nov 6, 2019
Copy link
Contributor

@keharper keharper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've committed some changes for grammar, style, and linting. Please pull them in to your local branch and address the remaining comments. I'll have some follow-up questions, but we need to take care of the basics first.

If you're with a partner that isn't showing up in the list yet, add the company name and URL to the contributor_name/_link lines. Otherwise, include your name and a link to your GitHub account or professional website.

On the surface, the v2.2 and v2.3 versions of the file look the same. If they are, delete the v2.3 version and replace it with a symlink to the v2.2 version. If they're different, apply the changes I made to the v2.2 to the v2.3 version as much as possible.

@@ -54,6 +54,9 @@ pages:
- label: Search using REST
url: /rest/performing-searches.html

- label: Search using /search endpoint
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- label: Search using /search endpoint
- label: Search with the /search endpoint

guides/v2.2/rest/search-endpoint.md Show resolved Hide resolved
```
GET {{URL}}rest/V1/search?searchCriteria[requestName]=quick_search_container&
searchCriteria[filter_groups][0][filters][0][field]=search_term&
searchCriteria[filter_groups][0][filters][0][value]=Shirt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shirt doesn't look correct here.

guides/v2.2/rest/search-endpoint.md Show resolved Hide resolved
@keharper keharper added 2.2.x 2.3.x Magento 2.3 related changes New Topic A major update published as an entirely new document labels Nov 6, 2019
guides/v2.2/rest/search-endpoint.md Show resolved Hide resolved
guides/v2.2/rest/search-endpoint.md Outdated Show resolved Hide resolved
---

By using `GET {{URL}}rest/V1/search`, you can search through the catalog. The obtained results will come from your configured search engine (**Stores** > Settings > **Configuration** > **Catalog** > **Catalog Search** > **Search engine**).
This means you can collect results from Elasticsearch, for example, that are very similar to the results that are visible by using the regular frontend search.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not be strict here to which engine is used even as example, maybe better to write
"This means you can collect results from search engine that is enabled. And those results will be equal to the results that are coming by using the regular frontend search."

@nuzil nuzil added Partner: Comwrap partners-contribution PR created by Magento partner labels Nov 6, 2019
@nuzil nuzil closed this Nov 6, 2019
@ghost
Copy link

ghost commented Nov 6, 2019

Hi @pmarjan, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@nuzil
Copy link
Contributor

nuzil commented Nov 6, 2019

Sorry, I closed and re-open PR cause I added Marjan to comwrap team and wanted that system recognised that

@pmarjan
Copy link
Contributor Author

pmarjan commented Nov 8, 2019

@keharper , @nuzil
the requested changes are done.
Please let me know if anything extra is needed.

@keharper
Copy link
Contributor

keharper commented Nov 8, 2019

I don't know how to push filesystem changes, so I have to just give instructions on setting up a symlink from 2.2 to 2.3.

  1. cd <devdocs_root>/guides/v2.3/rest/
  2. rm search-endpoint.md
  3. ln -s ../../v2.2/rest/search-endpoint.md .

I've been testing your examples and have some further comments. I'll try to add them by Monday.

@keharper
Copy link
Contributor

keharper commented Nov 8, 2019

Also, this PR should probably be rebased to master. I don't think anything discussed here is new technology--just undocumented. If so, this topic should be made available immediately, instead of waiting till the 2.3.4 release date.

Copy link
Contributor

@nuzil nuzil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for me. Lets wait for some comments from @keharper

@pmarjan
Copy link
Contributor Author

pmarjan commented Nov 11, 2019

@keharper
the symlink is updated and commits are rabased to master.

@keharper keharper changed the base branch from develop to master November 11, 2019 18:45
@keharper
Copy link
Contributor

This topic needs some information about when you'd use GET V1/search vs GET V1/products. Some differences I see between the two:

  • search can be run on behalf of a guest user. products requires an admin token
  • The syntaxes are similar but different. search requires one of 3 requestNames. I'm not sure if products is more flexible on the attributes it can search by default.
  • search can return aggregation/bucket data

Provide descriptions of the 3 search types. quick and advanced is self-explanatory, but I have no idea what catalog_view really means.

The basic usage is:

```http
GET <host>/rest/<store_code>/V1/search?searchCriteria[requestName]=quick_search_container&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this query, except I used name as the search term. The name attribute is set to Use in Search is set to Yes. Based on the statement in line 8, I would expect the search to work. catalog_view_container doesn't work either, but advanced_search_container does.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is like this:
The field can be set to be search_term only in the quick_search_container. This means both catalog_view and advanced will not work in that case.
Please send the queries you use? I could check them.

@keharper keharper added the Waiting for Response Waiting for response from internal/external parties label Nov 13, 2019
@pmarjan
Copy link
Contributor Author

pmarjan commented Nov 13, 2019

I have now made new version where there is an attempt to outline some differences between the search types, but also between using the v1/search and v1/products. At the end small summary is added too.

@keharper
Copy link
Contributor

@pmarjan These are some nice additions. I'm going to move things around a bit, but hopefully we can get this to its final state by tomorrow.

@pmarjan
Copy link
Contributor Author

pmarjan commented Nov 15, 2019

@keharper
I saw your last additions. Much nicer to read now :)
But, is there anything else that I could/should do?

@keharper
Copy link
Contributor

@pmarjan I forgot to tag you and ask for you to review my changes. Since you've done that, you're done. Thanks!

@keharper keharper removed the Waiting for Response Waiting for response from internal/external parties label Nov 15, 2019
@dobooth
Copy link
Contributor

dobooth commented Nov 18, 2019

running tests

@dobooth
Copy link
Contributor

dobooth commented Nov 18, 2019

running tests

@keharper keharper requested a review from dobooth November 18, 2019 18:08
@dobooth
Copy link
Contributor

dobooth commented Nov 19, 2019

running tests

@dobooth dobooth merged commit 4a94960 into magento:master Nov 19, 2019
@ghost
Copy link

ghost commented Nov 19, 2019

Hi @pmarjan, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
2.2.x 2.3.x Magento 2.3 related changes New Topic A major update published as an entirely new document Partner: Comwrap partners-contribution PR created by Magento partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants