elasticsearch 中文term精确匹配

问题描述

用es需要用到精确匹配和模糊匹配的时候,发现term匹配中文短语时没有返回结果,而匹配数字和符号时有。

遂查阅官网的《term》描述,在下方有个Why doesn’t the term query match my document?内容,惊喜了一番,但在照着配置的时候,发现还是不行。

继续查找,找到一篇csdn博客,经测试,在生成index时增加”not_analyzed”的设定,即可。但要注意,这样就无法进行match模糊查找,但是可以增加一个没设定not_analyzed的字段。

[ElasticSearch]Term精确匹配中文字符串短语

30 thoughts on “elasticsearch 中文term精确匹配”

  1. I have recently started a website, the info you offer on this web site has helped me greatly. Thank you for all of your time & work.

  2. My wife and i felt so thankful when Edward could round up his web research using the precious recommendations he acquired while using the web page. It’s not at all simplistic to simply be giving out key points people today might have been trying to sell. Therefore we fully understand we now have you to be grateful to for that. The type of illustrations you have made, the simple site navigation, the relationships your site give support to engender – it’s got most astounding, and it is leading our son in addition to the family consider that that subject is thrilling, which is quite pressing. Thanks for all!

  3. What¦s Happening i am new to this, I stumbled upon this I’ve found It absolutely useful and it has aided me out loads. I am hoping to give a contribution & aid different users like its aided me. Good job.

  4. Hey! I just wanted to ask if you ever have any problems with hackers? My last blog (wordpress) was hacked and I ended up losing months of hard work due to no backup. Do you have any solutions to prevent hackers?

  5. I am often to blogging and i really appreciate your content. The article has really peaks my interest. I am going to bookmark your site and keep checking for new information.

  6. You actually make it seem so easy along with your presentation but I in finding this topic to be really something that I believe I’d never understand. It sort of feels too complex and extremely wide for me. I am looking ahead in your next post, I¦ll attempt to get the cling of it!

  7. of course like your web-site however you have to test the spelling on several of your posts. Several of them are rife with spelling issues and I to find it very bothersome to tell the truth however I’ll surely come again again.

  8. Thanks for your entire work on this blog. Betty delights in managing investigation and it is simple to grasp why. Most people know all regarding the compelling method you offer valuable tips and tricks via the web site and even attract response from other individuals on the issue while our own princess is certainly studying a great deal. Take pleasure in the rest of the year. Your doing a useful job.

  9. This web page can be a walk-by way of for all the info you needed about this and didn’t know who to ask. Glimpse here, and you’ll undoubtedly uncover it.

  10. I’m impressed, I must say. Really hardly ever do I encounter a weblog that’s both educative and entertaining, and let me inform you, you could have hit the nail on the head. Your concept is excellent; the issue is something that not enough individuals are speaking intelligently about. I am very comfortable that I stumbled across this in my seek for one thing regarding this.

  11. There are some fascinating points in time in this article however I don’t know if I see all of them center to heart. There may be some validity however I’ll take maintain opinion till I look into it further. Good article , thanks and we want extra! Added to FeedBurner as well

  12. Great V I should definitely pronounce, impressed with your site. I had no trouble navigating through all tabs as well as related information ended up being truly simple to do to access. I recently found what I hoped for before you know it at all. Quite unusual. Is likely to appreciate it for those who add forums or something, website theme . a tones way for your client to communicate. Excellent task..

Comments are closed.