elasticsearch-analyzers

How to query fields with path_hierarchy analyzer in elasticsearch?

耗尽温柔 提交于 2021-01-28 06:06:10
问题 I have configured path_analyzer in elasticsearch using below configuration. PUT /elastic_course { "settings": { "analysis": { "analyzer": { "path_analyzer": { "tokenizer": "path_tokenizer" }, "reverse_path_analyzer": { "tokenizer": "path_tokenizer" } }, "tokenizer": { "path_tokenizer": { "type": "path_hierarchy", "delimiter": "/", "replacement": "-" }, "reverse_path_tokenizer": { "type": "path_hierarchy", "delimiter": "/", "replacement": "-" } } } }, "mappings": { "book" : { "properties": {

Desire feature of searching for part of word in Elasticsearch returning nothing. Only works with complete word

浪尽此生 提交于 2020-05-24 04:44:23
问题 I tried two different approaches for creating index and both are returning anything if I search for part o the word. Basically, if I search for first letters or letters in the middle of the word I want get all the documents. FIRST TENTATIVE BY CREATING INDEX THAT WAY (other stackoverflow question a bit old): POST correntistas/correntista { "index": { "index": "correntistas", "type": "correntista", "analysis": { "index_analyzer": { "my_index_analyzer": { "type": "custom", "tokenizer":

search in elasticsearch errors when applying analyzer/filter

给你一囗甜甜゛ 提交于 2020-05-16 01:51:01
问题 I have downloaded the onet dataset which comprise of skills taxonomy and I have uploaded it into a elasticsearch. In skills taxonomy there are some skills like c++, .net, C#. I want to give c# and get only c# in skills. by checking some links, I have set the mapping and settings of my index as below. { "onnet_taxonomy": { "mappings": { "text": { "properties": { "Occupation": { "type": "text", "fields": { "keyword": { "type": "keyword", "ignore_above": 256 } } }, "Skill": { "type": "text",

Elasticsearch analyzer to remove quoted sentences

风格不统一 提交于 2020-04-11 12:36:26
问题 I'm trying to create an analyzer that would remove (or replace by white/empty space) a quoted sentence within a document. Such as: this is my \"test document\" I'd like, for example, the term vector to be: [this, is, my] 回答1: Daniel Answer is correct, but as corresponding regex and replacement are missing, I am providing it, which includes the test of your text. Index setting as below which uses pattern replace char. { "settings": { "analysis": { "analyzer": { "my_analyzer": { "tokenizer":

Disabling Elasticsearch search analyzer

为君一笑 提交于 2020-02-24 12:26:20
问题 I'm working on the elasticsearch version 7.2 and i'm in the process of improving the performance of ES calls made by the application. From what I read, if we haven't set a "search analyzer" , by default standard analyzer will be set. But in a case where a analyzer is not needed ,having an analyzer may affect performance. Do having all fields as "keywords" prevents this? Or is there any other way to disable this "search analyzer" Ps: For any answer if you could point me to the ES official

Create analyzer with Edge N Gram analyzer and char filter which replaces space with new line

ε祈祈猫儿з 提交于 2019-12-24 11:15:30
问题 I have below type of text coming in. foo bar , hello world etc. I created an analyzer using Edge NGram tokenizer and using the analyze api it creates below token. { "tokens": [ { "token": "f", "start_offset": 0, "end_offset": 1, "type": "word", "position": 1 }, { "token": "fo", "start_offset": 0, "end_offset": 2, "type": "word", "position": 2 }, { "token": "foo", "start_offset": 0, "end_offset": 3, "type": "word", "position": 3 }, { "token": "b", "start_offset": 4, "end_offset": 5, "type":

ElasticSearch Analyzer on text field

孤街浪徒 提交于 2019-12-24 08:12:43
问题 Here is my field on elasticSearch : "keywordName": { "type": "text", "analyzer": "custom_stop" } Here is my analyzer : "custom_stop": { "type": "custom", "tokenizer": "standard", "filter": [ "my_stop", "my_snow", "asciifolding" ] } And here are my filters : "my_stop": { "type": "stop", "stopwords": "_french_" }, "my_snow" : { "type" : "snowball", "language" : "French" } Here are my documents my index (in my only field : keywordName) : "canne a peche", "canne", "canne a peche telescopique",

Setting not_analyzed for a property in Nest 5.5.0

萝らか妹 提交于 2019-12-14 03:46:01
问题 I have tried to set the "not_analyzed" index type via Nest 5.5.0 and I have no idea how to do it. My init: var map = new CreateIndexDescriptor(INDEX_NAME) .Mappings(ms => ms.Map<Project>(m => m.AutoMap())); var connectionSettings = new ConnectionSettings().DefaultIndex(INDEX_NAME); _client = new ElasticClient(connectionSettings); _client.Index(map); And the Project class: [ElasticsearchType(Name = "project")] public class Project { public Guid Id { get; set; } [Text(Analyzer = "not_analyzed")