Which type of multi_match query should I choose?


(何之真) #1

I want to search institutes with the keyword China, and it should be matched in some fields like name, slug, state, etc. Here are some problems I am confronted with. First of all, not all institutes have all the fields listed before, which means it matches nothing in some fields. Secondly, the fields weigh differently according to the query. For instance, if I search with the word China, it may refer to the state, which is, institutes in China; or it may refer to a part of the name, like Renmin University of China, and then it is less important to match it in some fields like introduction and job. Best_fields, most_fields and cross_fields all have some problems to meet the need of searching well. Which type should I choose and what kind of customization should I do? Any suggestions will be greatly appreciated.


(Alexander Reelsen) #2

Hey,

this is an extraordinarily broad question and you have not really mentioned what problems all the options of a multi field query exactly have in your use case. Maybe you need to explain in more detail what is considered a good search result and what is considered a bad search result in combination with example documents. Otherwise it is really hard to find out what you are after.

--Alex


(何之真) #3

oh, right. Tomorrow I will add some more details. Thank you for your reply.


(何之真) #4

Let me give more details. The language I am handling with is Chinese, so it may be a little different. An English sentence can be divided into a stream of words just by the whitespace, but a Chinese sentence can not be done in the same way. Let me give an example here. 普林斯顿大学 is the Chinese name of Princeton University. If the Chinese name is divided into 6 single Chinese words, it is meaningless. A better result is 2 parts - 普林斯顿 and 大学. So the choice of analyzers is a problem.
Suppose we have solved the problem, here comes the next problem. If I search with the string 北京大学,I probably look for Peking University, and universities in Beijing are acceptable. But if there are universities beyond Beijing or even beyond China in the result, it is awful. I want to say more about the order. If I search with the string 北京大学,I probably want to see Peking University first, and then other universities in Beijing which have 北京 as a part of their names, like 北京XX大学, and then universities like 清华大学. But if I search with the string 北京 大学, giving a whitespace between the 2 Chinese phrases, I probably just want to know universities in Beijing, so the range should be all universities in Beijing, and they can be sorted according to some ranking rule, like qs.
I hope the description above can make the question more concrete.


(system) #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.