Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8637841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:34:28+00:00 2026-06-12T10:34:28+00:00

In my elasticsearch.yml file am trying to implement some mapping where one field belonging

  • 0

In my elasticsearch.yml file am trying to implement some mapping where one field belonging to one type is indexed using a different analyzer to the rest.

At present the yaml file has the following structure:

index:
  bookshelf:
    types:
      book:
        mappings:
          title: {analyzer: customAnalyzer}
  analysis:
    analyzer:
      # set standard analyzer with no stop words as the default
      default:
        type: standard
        stopwords: _none_
      # set custom analyser to provide relative search results
      customAnalyzer:
        type: custom
        tokenizer: nGramTokenizer
        filter: [lowercase,stopWordsFilter,asciifolding]
    tokenizer:
      nGramTokenizer:
        type: nGram
        min_gram: 1
        max_gram: 2
    filter:
      nGramFilter:
        type: nGram
        min_gram: 1
        max_gram: 2
      stopWordsFilter:
        type: stop
        stopwords: _none_

This does not apply the custom analyzer to the title field, so I was hoping someone may be able to point me in the right direction for applying custom analyzers to individual fields?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:34:29+00:00Added an answer on June 12, 2026 at 10:34 am

    I answered this in the ml:

    If you are using Java you don’t have to use an yml file. You can, but you don’t have to.

    If you are using Spring, you can have a look at the ES spring factory project:  https://github.com/dadoonet/spring-elasticsearch

    If not, there is different ways of creating index and mappings in Java:

    1. You can have a look here to see how I’m doing this by reading a json
      mapping file: 
      https://github.com/dadoonet/spring-elasticsearch/blob/master/src/main/java/fr/pilato/spring/elasticsearch/ElasticsearchAbstractClientFactoryBean.java#L616

    2. You can also use XContent objects provided by ES to build your
      mappings in Java: 
      https://github.com/dadoonet/rssriver/blob/master/src/test/java/org/elasticsearch/river/rss/RssRiverTest.java#L14

    3. Using this object is described here:  https://github.com/dadoonet/rssriver/blob/master/src/test/java/org/elasticsearch/river/rss/AbstractRssRiverTest.java#L98

    Adding the mapping as follows:

    node .client() .admin () .indices()
     .preparePutMapping ("yourindex" )
     .setType ( "yourtype" )
     .setSource ( mapping ())
     .execute() .actionGet ();
    

    I hope this could help you

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the Elasticsearch JSON Mapping as { mappings: { test: { _routing:
I had a problem with ElasticSearch and Rails, where some data was not indexed
I'm trying using ElasticSearch with Codeigniter framework. What i did is just install ElasticSearch
We are trying to develop a strategy for using elasticsearch for full-text searching on
Using elasticsearch, I'd like to get a histogram facet for a price field in
I have several models indexed with elasticsearch and one of them has an association
From the documentation here: http://www.elasticsearch.org/guide/reference/mapping/geo-point-type.html It says geo_point accept different format. Ex: these two
In ElasticSearch, I've created two documents with one field, CategoryMajor In doc1, I set
I'm using ElasticSearch to index documents. My mapping is: mongodocid: { boost: 1.0, store:
I'm trying to implement elasticsearch in my play 2 app: https://github.com/cleverage/play2-elasticsearch but I get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.