Giter VIP home page Giter VIP logo

Comments (9)

marevol avatar marevol commented on September 28, 2024

Did you add nori?

from elasticsearch-cluster-runner.

sangkyunkim89 avatar sangkyunkim89 commented on September 28, 2024

@marevol
yes i have a nori

@Override
    public Map<String, AnalysisModule.AnalysisProvider<TokenFilterFactory>> getTokenFilters() {
        Map<String, AnalysisModule.AnalysisProvider<TokenFilterFactory>> extra = new HashMap<>();
      
        extra.put("nori_part_of_speech", NoriPartOfSpeechStopFilterFactory::new);
        extra.put("nori_readingform", NoriReadingFormFilterFactory::new);
        extra.put("nori_number", NoriNumberFilterFactory::new);


        return extra;
    }
    @Override
    public Map<String, AnalysisModule.AnalysisProvider<TokenizerFactory>> getTokenizers() {
        final Map<String, AnalysisModule.AnalysisProvider<TokenizerFactory>> extra = new HashMap();
        extra.put("reloadable_nori_tokenizer", ReloadableNoriTokenizerFactory::new);
        extra.put("nori_tokenizer", NoriTokenizerFactory::new);

        return extra;
    }

from elasticsearch-cluster-runner.

sangkyunkim89 avatar sangkyunkim89 commented on September 28, 2024

@marevol
I know you are very busy, but please ask when you can!

from elasticsearch-cluster-runner.

marevol avatar marevol commented on September 28, 2024

How did you send the mappings.json?

from elasticsearch-cluster-runner.

sangkyunkim89 avatar sangkyunkim89 commented on September 28, 2024

@marevol
For reference, there was no problem when creating an index directly on es.

thank u

{
                 "settings": {
                   "index": {
                     "analysis": {
                       "tokenizer": {
                         "korean_nori_tokenizer": {
                           "type": "reloadable_nori_tokenizer",
                           "decompound_mode": "discard"
                         }
                       },
                       "analyzer": {
                         "my_nori_analyzer": {
                           "tokenizer": "korean_nori_tokenizer",
                           "filter": [
                             "my_nori_filter"
                           ]
                         }
                       },
                       "filter": {
                         "my_nori_filter": {
                           "type": "nori_part_of_speech",
                           "stoptags": [
                             "SP"
                           ],
                           "updateable": true
                         }
                       }
                     }
                   }
                 },
                 "mappings": {
                   "properties": {
                     "test": {
                       "type": "keyword",
                       "fields": {
                         "nori": {
                           "search_analyzer": "my_nori_analyzer",
                           "analyzer": "my_nori_analyzer",
                           "type": "text"
                         }
                       }
                     }
                   }
                 }
               }

from elasticsearch-cluster-runner.

marevol avatar marevol commented on September 28, 2024

Could you provide information to reproduce it?

from elasticsearch-cluster-runner.

sangkyunkim89 avatar sangkyunkim89 commented on September 28, 2024
package org.elasticsearch.plugin.analyzerTest;

import java.io.File;

import junit.framework.TestCase;
import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.node.Node;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class ReloadableNoriTokenizerFactoryTest extends TestCase {

    private ElasticsearchClusterRunner runner;

    private int numOfNode = 1;

    private File[] keywordFiles;

    private String clusterName;

    @Before
    public void setUp() throws Exception {
        clusterName = "es-analysisja-" + System.currentTimeMillis();

        runner = new ElasticsearchClusterRunner();
        runner.onBuild(new ElasticsearchClusterRunner.Builder() {
            @Override
            public void build(final int number, final Settings.Builder settingsBuilder) {
                settingsBuilder.put("http.cors.enabled", true);
                settingsBuilder.put("http.cors.allow-origin", "*");
                settingsBuilder.put("discovery.type", "single-node");
                // settingsBuilder.putList("discovery.seed_hosts", "127.0.0.1:9301");
                // settingsBuilder.putList("cluster.initial_master_nodes", "127.0.0.1:9301");
            }
        }).build(new ElasticsearchClusterRunner.Configs().clusterName(clusterName).numOfNode(numOfNode));

        keywordFiles = null;
    }

    @After
    public void cleanUp() throws Exception {
        runner.close();
        runner.clean();
        if (keywordFiles != null) {
            for (File file : keywordFiles) {
                file.deleteOnExit();
            }
        }
    }

    @Test
    public void test_basic() throws Exception {

        runner.ensureYellow();
        Node node = runner.node();

        final String index = "dataset";

        final String indexSettings = "{\n" +
                "" +
                "  \"mappings\": {\n" +
                "    \"properties\": {\n" +
                "      \"hahahoho\": {\n" +
                "        \"type\": \"keyword\"\n" +
                "      }\n" +
                "    }\n" +
                "  }\n" +
                "}";
        runner.createIndex(index, Settings.builder().loadFromSource(indexSettings, XContentType.JSON).build());
        runner.ensureYellow();


    }
}

@marevol

I tried with a simple code, but this doesn't work either
Am I unable to load the default plugin?

unknown setting [index.mappings.properties.hahahoho.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
java.lang.IllegalArgumentException: unknown setting [index.mappings.properties.hahahoho.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings

from elasticsearch-cluster-runner.

marevol avatar marevol commented on September 28, 2024

It's for an index setting, not mapping.

        final String indexSettings = "{\n" +
                "    \"properties\": {\n" +
                "      \"hahahoho\": {\n" +
                "        \"type\": \"keyword\"\n" +
                "      }\n" +
                "    }\n" +
                "}";
        runner.createIndex(index, builder -> builder.addMapping("_doc",
                indexSettings, XContentType.JSON));

from elasticsearch-cluster-runner.

sangkyunkim89 avatar sangkyunkim89 commented on September 28, 2024

@marevol
From what you tested elsewhere, I think you should remove the settings property and set it up.
Is it impossible to test until data is mapped and retrieved?

from elasticsearch-cluster-runner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.