This is a spin-off from #950460: Language selection in advanced search filters broken

The problem is (even after that bug is fixed) that there is currently no way to search for language-neutral content. If you choose a language, I think the language-neutral content should be returned along with the content in the specific language you chose.

An alternative would be to have "language neutral" be one of the choices when you are choosing a language, but I personally think this is not the preferred way to do it.


jhodgdon’s picture

Just to clarify:
If you choose at least one language in the Advanced Search box, you get only content in that languge. But you don't get the language neutral content, and there is no option for returning the language neutral content. If you don't choose a language at all in advanced search, then content in all languages is returned. But if you a node that is language neutral, there is no way to get it as a search result if the language is chosen.

This probably has further implications for Internationalization module... In D6, Internationalization would restrict searches to the current language, via the db_rewrite_sql mechanism. And Advanced Search didn't have language options. I'm not sure what's planned for D7 for Internationalization.

The two possible fixes:
a) Add an option for "language neutral" to the language checkboxes.
b) Change the filtering so that if you pick one or more languages, you also get content that is marked language neutral.

I am currently leaning towards (a), because it is easier and more transparent what is going on from the advanced search form, but I think we should consider what Internationalization module would do, and whether this would even work with Internationalization.

jhodgdon’s picture

Issue tags:+i18n, +internationalization

Just as a note, it looks like the Internationalization module is not too close to having a release (#980728: D7 port), so probably we should just figure out what's best and do that.

jhodgdon’s picture

See also #1012342: Plans for query alters in 7.x, which I just filed on the Internationalization project.

Gábor Hojtsy’s picture

Currently in Drupal 8, all special languages (including 'Not applicable' and 'Not specified', two spin-offs of Language neutral from Drupal 7) are displayed in the search UI. I think we eventually either want to only show languages for which we have data (once we have langcode in the search index via #1669876: Add missing language functionality in search module, we'll be able to tell that) or let contrib / site specific modules customize this form, which is already possible.

klonos’s picture

The D8 part will be probably solved by #2083717: Convert Search Results to Views. When searches are views, people will be able to tweak them as they see fit when it comes to whether to including or excluding language neutral content.