No internet connection
  1. Home
  2. Support

Search finds only exact words

By Frank Steinberg @frsteinb
    2019-07-04 09:06:15.679Z2019-07-05 09:12:53.476Z

    It seems like the search function only finds exact words, e.g., when I search for "search" I won't find articles containing "searching". Is there a way to change this behavior so that substring matching would work?

    Update: The title and the paragraph above are incorrect! I initially wrote it this way, because I wanted to explain my case of German words in my multi language forum by using an example with English words.

    • 7 replies
    1. Actually the search function does find "searching" when you search for "search". Maybe ElasticSearch (the search engine) thought some results with only "search" were better search results and showed those first, so it seemed only "search" was searched for.

      Now with this new topic though, you can search for "search" and then "searching" in this topic will be found :- )

      https://www.talkyard.io/-/search?q=search

      (About substring matching: Yes apparently ElasticSearch can do that, see: https://stackoverflow.com/q/23243867 — and I think this isn't needed.)

      1. Frank Steinberg @frsteinb
          2019-07-05 06:40:37.701Z

          This article contains the full word „search“, so of course this article will be found. But as an example, if you search for the first part of „ElasticSearch“, you won‘t find this article.

          ...meanwhile, I found that ElasticSearch seems to to some language specific analysis. So, how can I configure ElasticSearch? I am using the "prod-one" release for a site where we expect articles in English and German.

          1. If you study the serch results and the words that ElasticSearch has highlighted here: https://www.talkyard.io/-/search?q=search, you'll notice that ElasticSearch matched not only "search" but also "searching" and "searched", and a bit further down, "searches".

            ElasticSearch considers "ElasticSearch" different from the word "search". I think ElasticSearch matches only conjucations of the verb "search" and variations (like pluralis) of the noun "search". (So, the way ElasticSearch has been integrated with Talkyard, ES doesn't do substring matching, but instead finds variations of the same word.)

            1. Frank Steinberg @frsteinb
                2019-07-05 08:02:12.852Z

                If I search for "Elastic" (or "Elastic*") I would expect to find also occurrences of "ElasticSearch", but I don't. (No, we do find this thread, because now I've typed this word not just as a prefix of a longer word.)

                And of course, if the forum contains articles in another language all this language specific power of ElasticSearch does not make sense. So, is there a way to configure ElasticSearch for my own needs?

              • In reply tofrsteinb:

                So, how can I configure ElasticSearch

                I'd need to look into that and get back to you. What configurations do you want to do? Maybe ... Ensuring conjuations and noun forms work also for German? So if you search for "schreibe" you'll find also "schreiben" and "schreibt'? Or you have more / different things in mind?

                The English and German articles — are they in the same Talkyard forum? Or you've created two different forums, one in English only and one in German only?

                1. Frank Steinberg @frsteinb
                    2019-07-05 08:07:43.027Z

                    To be honest, I do not yet really know, how I would configure ElasticSearch, because I did not know about its language specific knowledge.

                    Before, I would have expected a simple substring (or prefix) search. If I would stick with language features, I would need both, German and English, in the same forum.

                    1. In reply toKajMagnus:
                      SAndrea Ghensi @sanzoghenzo
                        2021-04-30 08:56:14.114Z

                        Hi, I have a similar request... I would like to support both English and Italian in the same forum, so I would like to leverage ElasticSearch indexing for both languages.
                        I'm not worried about the display language, since the usage is straightforward I'm defaulting to English (for now).
                        Is there a way to configure ElasticSearch to add another language?
                        Would it be enough to add a new IndexSettingsAndMappings to the Indexes variable at the end of this source file?
                        Obviously, it would be great to have the option to add it from the admin console...