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

Adding projects created for content about hybrid search for an ecommerce #343

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

andreluiz1987
Copy link

This PR contains the frontend and api projects built for the article How to use Hybrid search for an e-commerce product catalogue

Copy link

gitnotebooks bot commented Oct 22, 2024

Found 1 changed notebook. Review the changes at https://app.gitnotebooks.com/elastic/elasticsearch-labs/pull/343

Copy link
Contributor

@carlyrichmond carlyrichmond 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 suggested a few minor code styling considerations. Logic-wise it appears fine.


### API

- Developed with python
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
- Developed with python
- Developed with Python

2. Navigate to the project directory:
```bash
cd repository-name
3. Install dependencies:
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
3. Install dependencies:
3. Install dependencies:

const defaultImage = "https://via.placeholder.com/100";

const handleClick = () => {
//alert(`Produto: ${product.name} - Termo de pesquisa: ${searchTerm}`);
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
//alert(`Produto: ${product.name} - Termo de pesquisa: ${searchTerm}`);

Can we remove the commented out alert since it's not used.

query: searchTerm,
selectedCategories: selectedFacets.categories,
selectedProductTypes: selectedFacets.productTypes,
selectedbrands: selectedFacets.brands,
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
selectedbrands: selectedFacets.brands,
selectedBrands: selectedFacets.brands,

query: searchTerm,
selectedCategories: selectedFacets.categories,
selectedProductTypes: selectedFacets.productTypes,
selectedbrands: selectedFacets.brands,
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
selectedbrands: selectedFacets.brands,
selectedBrands: selectedFacets.brands,


## Referências

- [Documentação do Docker](https://docs.docker.com/)
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
- [Documentação do Docker](https://docs.docker.com/)
- [Docker Documentation](https://docs.docker.com/)

## Referências

- [Documentação do Docker](https://docs.docker.com/)
- [Documentação do Docker Compose](https://docs.docker.com/compose/)
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
- [Documentação do Docker Compose](https://docs.docker.com/compose/)
- [Docker Compose Documentation](https://docs.docker.com/compose/)



if __name__ == '__main__':
# print(get_client_es().info())
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
# print(get_client_es().info())


vector = get_text_vector([term])[0]

# Query híbrida com RRF (Reciprocal Rank Fusion)
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
# Query híbrida com RRF (Reciprocal Rank Fusion)
# Hybrid query with RRF (Reciprocal Rank Fusion)



def build_hybrid_query(term=None, categories=None, product_types=None, brands=None, hybrid=False):
# Query padrão
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
# Query padrão
# Standard query

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.

2 participants