Hi,

I need to retrieve a search from services module, using the search.nodes method, but the service only returns the results written with the main languages.

With the site default search, i can see my translated nodes when i change the language flag, but with service no.

so...how does i18n module makes it possible?
how to search at the specifiec language? can pass it as argument?

i tried to understand the code behind search module and search service but i still can't understant it very well.

i don't know how to implement the search hook to respect the language, as when you use the site normally.
(making it more clear: i can find my nodes with i18n trough search module, but not with search service)

at search-service.inc there is a call to:
$results = module_invoke('node', 'search', 'search', $keys);

but in node.module, there is
function node_search($op = 'search', $keys = NULL) { [...] and there in the case 'search' , the actual search is being made, but i don't know where at the code the i18n affects.

i can't see the difference between the search made trougth search module (normal search form from site) and the search made with services.

any tip?

thanks in advance.

Comments

jose reyero’s picture

Status: Active » Fixed

I think each service call is run on a different request so you'll need to specify the language as a parameter for your service.

The language is selected by query rewriting, db_rewrite_sql...

See also #316147: Multilingual Search for Multilanguage site

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.