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

Add to choose language(localization) for search #667

Open
KaylonMD opened this issue Mar 1, 2023 · 8 comments
Open

Add to choose language(localization) for search #667

KaylonMD opened this issue Mar 1, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@KaylonMD
Copy link

KaylonMD commented Mar 1, 2023

Hi everyone! I use from documentation https://docs.meilisearch.com/learn/getting_started/quick_start.html#search function .search and get all documents needed, but problem is - need to filter / choose language before search phrases/word. At the moment show only initial locale from strapi, but other languages it puts in massive localizations, where can get documents.

Problem is - when put title from localizations document, meilisearch cannot search this document and give that not found something

@bidoubiwa bidoubiwa added the support Issues related to support questions. label Mar 1, 2023
@oluademola
Copy link
Contributor

Hello @KaylonMD, Sorry, I'm not sure I completely understand you. Could you please provide more context about your setup? How did you handle the indexing of your documents in different languages? Do you have them separate in different indexes, or do your documents contain fields for each language? If you have configured the languages per index you should be able to select which index to target from the client side.

@KaylonMD
Copy link
Author

Hello @KaylonMD, Sorry, I'm not sure I completely understand you. Could you please provide more context about your setup? How did you handle the indexing of your documents in different languages? Do you have them separate in different indexes, or do your documents contain fields for each language? If you have configured the languages per index you should be able to select which index to target from the client side.

At the moment, when i make request from Meilisearch, I get only primary localization documents, const client = new MeiliSearch({
host: MEILISEARCH_URL,
apiKey: apiKey
});
client
.index(selectedIndex.index)
.search(word)
.then((res) => res.hits});
};

But unfortunately, the second language cannot pass, only can see in localizations

( Put url screen https://i.imgur.com/IXgB0Xr.jpeg ) - red underline is documents primary language, but if has translations, put in parameters translations, but cannot find it when search title name in function .search

@KaylonMD
Copy link
Author

Hello @KaylonMD, Sorry, I'm not sure I completely understand you. Could you please provide more context about your setup? How did you handle the indexing of your documents in different languages? Do you have them separate in different indexes, or do your documents contain fields for each language? If you have configured the languages per index you should be able to select which index to target from the client side.

just need to get documents from "en" version and "ro" version

@soapwong703
Copy link

soapwong703 commented Mar 22, 2023

@oluademola I am having the same problem, it seems entriesQuery: { locale: 'all'} doesn't work exactly like REST API's locale. In meilisearch documents, I see it only stores the 'en' version of entity instead of all locales, therefore the search only searched in 'en' documents.

You can see there are only 12/14 document stored in meilisearch, the extra 2 is in other locales.
image

@bidoubiwa
Copy link
Contributor

Hey @soapwong703, unfortunately currently it does not seem possible with the plugin. It would require multiple indexation of the same collection and that is not supported yet.

Meanwhile, if you use the localisation plugin you can play around with the locale parameter in the entriesQuery plugin parameter. See here

@bidoubiwa bidoubiwa added enhancement New feature or request and removed support Issues related to support questions. labels May 17, 2023
@BenCherif
Copy link

@bidoubiwa any update about this, without localization this plugin is useless when you use multiple locales for your content on strapi

@curquiza
Copy link
Member

Hello @BenCherif

Does #915 will fix your problem? If not, any PR are welcome and we will review it when we have some time 😊

@BenCherif
Copy link

BenCherif commented Apr 29, 2024

Hello @BenCherif

Does #915 will fix your problem? If not, any PR are welcome and we will review it when we have some time 😊

i'm not talking about the ui localizations , but i'm talking about retrieve entries with some locale from strapi .Can we add attribute
{..., locale : en, } to meilisearch queries like we do already in strapi .Kind regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants