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

  • SEARCH
  • Home
  • 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 8439207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:56:47+00:00 2026-06-10T07:56:47+00:00

Full gist at https://gist.github.com/3442562 I have an analyzer: analyzer : { lowercase_keyword : {

  • 0

Full gist at https://gist.github.com/3442562

I have an analyzer:

"analyzer" : {
            "lowercase_keyword" : {
                "type" : "custom",
                "tokenizer" : "keyword",
                "filter" : ["lowercase", "trim"]
            }
        }

that is referenced in a mapping:

"location_countries" : {
                "properties" : {
                    "country" : {
                        "type" : "string",
                        "analyzer" : "lowercase_keyword"
                    }
                }
            }

And when I use the ‘country’ field in a filter or a facet, the field is (correctly) treated as a keyword.

curl -XGET 'localhost:9200/clinical_trials/_search?pretty=true' -d '
{
    "query" : {
        "term" : { "brief_title" : "dermatitis" }
    },
    "filter" : {
        "term" : { "country" : "united states" }
    },
    "facets" : {
        "tag" : {
            "terms" : { "field" : "country" }
        }
    }
}
'

facet results:

"facets" : {
    "tag" : {
      "_type" : "terms",
      "missing" : 0,
      "total" : 1,
      "other" : 0,
      "terms" : [ {
        "term" : "united states",
        "count" : 1
      } ]
    }

Everything works fine until the machine gets rebooted or the Elastic Search service gets restarted. After a restart, all my filters stop working as if the analyzer does not exist.

The same query against the same data results in:

"facets" : {
    "tag" : {
      "_type" : "terms",
      "missing" : 0,
      "total" : 2,
      "other" : 0,
      "terms" : [ {
        "term" : "united",
        "count" : 1
      }, {
        "term" : "states",
        "count" : 1
      } ]
    }

If I query the _settings/_mappings of my index, the analyzer and mappings are still defined correctly but the analyzer seems to have no effect.

What am I doing wrong?

Thanks in advance!

  • 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-10T07:56:48+00:00Added an answer on June 10, 2026 at 7:56 am

    The country field appears in multiple nested documents but I am only setting the mapping for one of the fields. After a restart, elasticsearch loads the fields in a different order applies the filter/facet to the wrong field.

    Fully qualifying the facet and filter field names fixes my problem.

    curl -XGET 'localhost:9200/clinical_trials/_search?pretty=true' -d '
    {
        "query" : {
            "term" : { "brief_title" : "dermatitis" }
        },
        "filter" : {
            "term" : { "location_countries.country" : "united states" }
        },
        "facets" : {
            "tag" : {
                "terms" : { "field" : "location_countries.country" }
            }
        }
    }
    '
    

    Thanks to Clint on the elasticsearch mailing list for all the help.

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

Sidebar

Related Questions

I have an XML file full of bookmarks from Google Bookmarks. (File: http://gist.github.com/324844 )
Full code at https://gist.github.com/992562 . I am using HTML File API and drag/drop to
UPDATE : The full site code is here - https://github.com/eWizardII/PeerInstruction I have the following
Full implementation is here https://gist.github.com/1306491 I'm using struct with implicit casting to implicitly convert
Using the sample app for rpx_now gem ( http://github.com/grosser/rpx_now_example ) on localhost:3000, I have
Full code. public function indexAction(){ echo '<a href=https://www.facebook.com/dialog/oauth?client_id=475302972487577&redirect_uri=http://bp.mysite.com/en/social/fblogin target=_blank>Login met facebook</a> '; } const
Full error message: You have an error in your SQL syntax; check the manual
full code here... http://pastebin.com/EEnm8vi3 line 378 is not inserting the sections into the current
Full disclosure: this is for an assignment, so please don't post actual code solutions!
Full Question: From a child table linked to a row in its grandparent table

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.