Search finds only exact words
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
- KajMagnus @KajMagnus2019-07-04 23:20:02.614Z
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.)
- Frank Steinberg @frsteinb2019-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.
- KajMagnus @KajMagnus2019-07-05 07:53:41.446Z
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.)
- Frank Steinberg @frsteinb2019-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⬆:KajMagnus @KajMagnus2019-07-05 07:59:52.256Z
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?
- Frank Steinberg @frsteinb2019-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.
- In reply toKajMagnus⬆:
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
Indexesvariable at the end of this source file?
Obviously, it would be great to have the option to add it from the admin console...